Android: change marker's size/color based on parameter

南楼画角 提交于 2019-12-11 19:22:05

问题


Currently I'm using google-map-API V2 for android google map,is there any way I can based on one variable parameter change the marker(pin) size/color of google map?


回答1:


float valueBetween0and360 = 222.222;
marker.setIcon(BitmapDescriptorFactory.defaultMarker(valueBetween0and360));

will change marker icon color.

For size you will have to provide your own icons and use BitmapDescriptorFactory.fromResource.



来源:https://stackoverflow.com/questions/18822504/android-change-markers-size-color-based-on-parameter

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