Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android map marker color?

What color is available to make a marker on Android map?
How many colors are there and how to write the code of color?

like image 440
kucluk Avatar asked Sep 29 '13 08:09

kucluk


People also ask

How do you change the color of a marker on a map?

To edit the marker color, click or tap on the marker icon. When you do that, you can change both the color of the marker and its style. Go for the color or style you want to change and then click OK to see the effect. Click on the button labeled Done to save your new marker color settings.

How do I change the marker on Google Maps Android?

For adding a custom marker to Google Maps navigate to the app > res > drawable > Right-Click on it > New > Vector Assets and select the icon which we have to show on your Map. You can change the color according to our requirements. After creating this icon now we will move towards adding this marker to our Map.


1 Answers

Here is a method I am using to generate dynamic Hue colors for markers based on given String color.

May be useful for someone :)

Marker melbourne = mMap.addMarker(new MarkerOptions().position(MELBOURNE) .icon(getMarkerIcon("#ff2299")));  // method definition public BitmapDescriptor getMarkerIcon(String color) {     float[] hsv = new float[3];     Color.colorToHSV(Color.parseColor(color), hsv);     return BitmapDescriptorFactory.defaultMarker(hsv[0]); } 
like image 154
S.Thiongane Avatar answered Oct 02 '22 19:10

S.Thiongane