Ihsan chahi
Ihsan chahi

Reputation: 307

Google maps add marker

I want to add marker to Google map in android can any one please help me to do it and if you guys have sample code it would help me a lot, and also tell me that how can i set size to map fragment ?

Thanks in advance.

Upvotes: 2

Views: 17309

Answers (1)

Tarsem Singh
Tarsem Singh

Reputation: 14199

use addMarker()

like :

myMap.addMarker(new MarkerOptions().position(yourLatLng).icon(BitmapDescriptorFactory.fromResource(R.drawable.yourmarkericon)));

where myMap is the Object of GoogleMap and yourLatlng is Latlng Where you want to add marker and yourmarkericon is icon which you want to display on map

Edit :

References

https://developers.google.com/maps/documentation/android/marker

https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Marker

Simple Tutorial

http://bon-app-etit.blogspot.be/2012/12/add-informationobject-to-marker-in.html

Upvotes: 5

Related Questions