Reputation: 307
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
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
Simple Tutorial
http://bon-app-etit.blogspot.be/2012/12/add-informationobject-to-marker-in.html
Upvotes: 5