ercan
ercan

Reputation: 1706

Setting color of the defaultMarker by using more than "hue"

I am trying to set marker color to the following color:

Hue (H): 0º
Saturation (S): 100%
Value (V): 80%

But the default marker can only be colored using the "hue".

mMap.addMarker(new MarkerOptions()
                    .position(latlng)
                    .title("Marker")
                    .icon(BitmapDescriptorFactory.defaultMarker(myColor)));

myColor is supposed to be a float describing the "hue" of color. However, in order to set it to the exact color I want, I also need to set the saturation and the value. Is it not allowed to set them somehow? Are the decimal places for the saturation/value? How am I supposed to set it? Is creating my own marker-PNGs the only solution?

Upvotes: 1

Views: 1595

Answers (1)

MaciejGórski
MaciejGórski

Reputation: 22232

Is creating my own marker-PNGs the only solution?

Yes. And it's the best solution too. Default markers may appear different on different devices depending on what drawables are bundled into Google Play Services. Avoid them when possible.

Also you may want to make a request for BitmapDescriptorFactory.defaultMarker(hue, saturation, value) on gmaps-api-issues if you feel that is important.

Upvotes: 2

Related Questions