/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
private class MyOverlay extends Overlay { private GeoPoint center; private float radius; public MyOverlay(GeoPoint c) { center = c; radius = 20; } @Override super.draw(canvas, mapView, shadow); if (shadow == false) { // class exercise // Step 1: get pixel coordinate of center (in GeoPoint) mapView.getProjection().toPixels(center, screenPt); // Step 2: draw a circle at the converted pixel coordinate cPaint.setAlpha(100); canvas.drawCircle(screenPt.x, screenPt.y, radius, cPaint); } } }