plot a different marker for each place googlemap v2 android

邮差的信 提交于 2019-12-11 22:07:34

问题


I have managed to place a marker for each item in my database using their stored title and coordinates.

I am now trying to change the content of each InfoWindow so that it shows information related to each place (other than the title and snippet)also each place have a different icon marker. how to give a custom icon and a different infowindow for each place? i create the different icons for marker. the information are loading in format json and the icon marker are also in my database.should i load them or put them in drawable folder.


回答1:


Google covers most of what you want to do in their Google Maps API v2 documentation.

Info Window Customization and Customizing a MArker have code example how-to's. For your marker icons, are they just a different colour marker or are they completely customized? Storing them in drawable is ok and can be accessed easily using

.icon(BitmapDescriptorFactory.fromResource(R.drawable.your_custom_marker))

when creating/adding the Marker.



来源:https://stackoverflow.com/questions/29431446/plot-a-different-marker-for-each-place-googlemap-v2-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!