user1291437
user1291437

Reputation: 81

Map overlays in android

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

Answers (3)

K_Anas
K_Anas

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

Rafael T
Rafael T

Reputation: 15689

Android GoogleMaps API Documentation may also help.

Upvotes: 0

Tony the Pony
Tony the Pony

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

Related Questions