use of com.google.android.maps.Projection in project ignition by mttkay.
the class AccuracyCircleOverlay method draw.
@Override
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
Projection projection = mapView.getProjection();
if (shadow && projection == null) {
Log.v(LOG_TAG, "drawing not done because shadow and projection are null");
return;
}
Point pt = new Point();
projection.toPixels(geoPoint, pt);
float circleRadius = metersToRadius(accuracy, projection, geoPoint.getLatitudeE6());
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setColor(0x186666ff);
paint.setStyle(Style.FILL_AND_STROKE);
canvas.drawCircle(pt.x, pt.y, circleRadius, paint);
paint.setColor(0xff6666ff);
paint.setStyle(Style.STROKE);
canvas.drawCircle(pt.x, pt.y, circleRadius, paint);
paint.setColor(Color.RED);
paint.setStyle(Style.FILL_AND_STROKE);
canvas.drawCircle(pt.x, pt.y, 3, paint);
super.draw(canvas, mapView, shadow);
}
Aggregations