Leaflet.awesome-markers icon indicating copy to clipboard operation
Leaflet.awesome-markers copied to clipboard

For icons why can we only choose a marker color from a set list and not use a css color code?

Open olly-writes-code opened this issue 7 years ago • 5 comments

Yet it is possible to change the color of the icon in the marker to anything

markerColor -> 'red', 'darkred', 'orange', 'green', 'darkgreen', 'blue', 'purple', 'darkpuple', 'cadetblue'

iconColor -> 'white', 'black' or css code (hex, rgba etc)

olly-writes-code avatar Sep 08 '17 20:09 olly-writes-code

Ha! I just stumbled on this myself via folium's documentation and came upstream to understand why.

Indeed, why give hex flexibility the outline color but not the fill? This would be really helpful as I'm defining other fill colors via a list of hex colors for a polygon. It would be nice to specify that my marker is color_list[i], just like I do with my polygon.

jwhendy avatar Nov 22 '17 23:11 jwhendy

The problem with this script is that it uses big PNG images with the current possible colors. As you can say they use a sprite.

So for now it seems impossible to use your own colors. Something that would be solved with a svg marker.

tvdsluijs avatar Nov 25 '18 12:11 tvdsluijs

Wow, so there exists a sprite with all those different colours!

Sti2nd avatar Nov 30 '18 09:11 Sti2nd

I thought they had changed them to SVG: (https://github.com/lvoogdt/Leaflet.awesome-markers/pull/74)

victorhdc avatar Feb 20 '19 22:02 victorhdc

Hmm, not sure, I did encounter this problem in the python package Folium. I remade the whole map in JavaScript with BeatifyMarker, though, so don't have that problem any more 😼

Sti2nd avatar Feb 21 '19 20:02 Sti2nd