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

2019-09-04 11:32发布

问题:

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.