Code example for Point

Methods: set

0
    @Override 
    public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) {
 
        if (usersLocation != null){
            //---translate the GeoPoint to screen pixels--- 
            Point screenPts = new Point();
            mapView.getProjection().toPixels(usersLocation, screenPts);
            screenPts.set(screenPts.x, screenPts.y);
 
            // users current location: 
            Preferences prefs = Application.getInstance().getPreferences(mapView.getContext());
            int radius = Integer.parseInt(prefs.getEffectiveRadiusValue());
            float radiusInPixels = mapView.getProjection().metersToEquatorPixels((float) radius);
            Paint paint = new Paint();
            paint.setStyle(Paint.Style.FILL);
            paint.setAntiAlias(true);
            paint.setStrokeCap(Paint.Cap.ROUND);
            paint.setStrokeWidth(6);
            paint.setColor(Color.GREEN);
            paint.setAlpha(30);
            canvas.drawCircle(screenPts.x, screenPts.y, radiusInPixels, paint);