Google地图添加标记 [英] Google maps add marker
问题描述
我想在android中添加标记到谷歌地图,任何人都可以帮助我做到这一点,如果你们有示例代码,它会帮助我很多,并告诉我如何设置地图片段大小?
预先感谢。
addMarker()
像:
myMap.addMarker(new MarkerOptions()。position(yourLatLng).icon(BitmapDescriptorFactory.fromResource(R.drawable.yourmarkericon)));
其中 myMap 是 GoogleMap
和 yourLatlng 是经纬度
您想添加标记和 yourmarkericon 是您想要的图标在地图上显示
编辑: >
https://开发者.google.com / maps / documentation / android / marker
简单教程
HTTP://bon-app-etit.blogspot .BE / 20 12/12 / add-informationobject-to-marker-in.html
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.
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
这篇关于Google地图添加标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!