1
votes

I would like to ask about how can I add different overlays to my android application? as I already have one overlay class that extends Overlay and it draws polylines according to some points in a KML file. and now I would like to create another overlay that adds a pin in the user's location using GPS, so I don't know how this could be done.

please anyone knows how to help me ? thank you in advance.

3

3 Answers

1
votes

You can have multiple overlays on top of one map.

Just create the second layer as an ItemizedOverlay, and add it to the map:

    myMapView.getOverlays().add(myItemizedOverlay);

To learn how to add markers to an ItemizedOverlay, see http://android-coding.blogspot.com/2011/06/using-itemizedoverlay-to-add-marker-on.html.

0
votes

To add a pin to the user's location use MyLocationOverlay it's in the google maps API see this link