Reputation: 81
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.
Upvotes: 1
Views: 249
Reputation: 31456
To add a pin to the user's location use MyLocationOverlay it's in the google maps API see this link
Upvotes: 0
Reputation: 41447
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.
Upvotes: 1