Android:根据参数更改标记的大小/颜色 [英] Android: change marker's size/color based on parameter

查看:130
本文介绍了Android:根据参数更改标记的大小/颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前我正在使用适用于Android谷歌地图的google-map-API V2,是否有任何方法可以基于一个可变参数更改google地图的标记(大头针)大小/颜色?

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?

推荐答案

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.

这篇关于Android:根据参数更改标记的大小/颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆