public class CrossHairsOverlay extends Overlay { public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); GeoPoint centerGp = mapView.getMapCenter(); Projection projection = mapView.getProjection(); Point centerPoint = projection.toPixels(centerGp, null); Paint p = new Paint(); Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.crosshairs_dial); canvas.drawBitmap(bmp, centerPoint.x, centerPoint.y, p); return true; } }
source share