I want to be able to get some reference to the curent object being drawn
@Override
public void draw(Canvas canvas, MapView mapView,boolean shadow) {
//Log.i("DRAW","MARKER");
super.draw(canvas, mapView, false);
}
Above is my draw method and I want to extend the draw method to write the title underneath each item for example. This would require the .getTitle() method from the OverlayItem. Possibly some tracking of objects outside of this method but not sure where to put it….
I’ve done something similar.
I’ve added some markers to a
MapViewand afterwards connecting them with a line.I have a class
LineOverlaywhich extendsOverlay.In the constructor it gets the list of items to be connected by lines.
Something like:
and then on the
onDraw()I do this:In your case you can do something similar creating a
SubtitleOverlaywhich extendsOverlaythat receives all items in the constructor and then on thedrawmethod create a subtitle in the correct position.