jupyter-widgets / ipyleaflet

A Jupyter - Leaflet.js bridge
https://ipyleaflet.readthedocs.io
MIT License
1.49k stars 365 forks source link

cannot use css color for marker_color #1101

Closed 12rambau closed 1 year ago

12rambau commented 1 year ago

I wanted to add some coloring to the Awesomeicon that i'm using as a marker. I got my color saved as an hex string: "#1976D2" but when I try to apply it to marker_color I got the following error :

TraitError: The 'marker_color' trait of an AwesomeIcon instance expected any of ['white', 'red', 'darkred', 'lightred', 'orange', 'beige', 'green', 'darkgreen', 'lightgreen', 'blue', 'darkblue', 'lightblue', 'purple', 'darkpurple', 'pink', 'cadetblue', 'white', 'gray', 'lightgray', 'black'], not the str '#1976D2'.

Would it be possible to add support for any CSS color descriptor instead ?

martinRenou commented 1 year ago

This is a limitation of https://github.com/lennardv2/Leaflet.awesome-markers, see this table. ipyleaflet cannot do anything about it.

12rambau commented 1 year ago

dommage.

It seems that a solution has been proposed in 2016: https://github.com/lennardv2/Leaflet.awesome-markers/pull/74 but the repository seems on stale so I guess nothing is going to change.

12rambau commented 1 year ago

Just to come back on this one. I was looking at leaflet divIcons recently and I asked myself would it be possible to reproduce the leaflet.awesome_markers behavior without relying on the lib from lennardv2 (as it's an abandonned projet).

Would it be a desirable feature ? it would solve this little color issue and modernize the fa version by relying on the one provided with Jupyter instead

martinRenou commented 1 year ago

That's be great