Revision: 58611
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 24, 2012 23:05 by l01241
Initial Code
private class MyOverlay extends Overlay { private GeoPoint center; private float radius; private Paint cPaint; public MyOverlay(GeoPoint c) { center = c; radius = 20; cPaint = new Paint(); } @Override public void draw(Canvas canvas, MapView mapView, boolean shadow) { super.draw(canvas, mapView, shadow); if (shadow == false) { // class exercise // Step 1: get pixel coordinate of center (in GeoPoint) Point screenPt = new Point(); mapView.getProjection().toPixels(center, screenPt); // Step 2: draw a circle at the converted pixel coordinate cPaint.setColor(Color.RED); cPaint.setAlpha(100); canvas.drawCircle(screenPt.x, screenPt.y, radius, cPaint); } } }
Initial URL
Initial Description
Initial Title
Android MyOverlay extends Overlay
Initial Tags
android
Initial Language
Java