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

Created on 8 Sep 2017  路  3Comments  路  Source: python-visualization/folium

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

```
class Icon(MacroElement):
"""
Creates an Icon object that will be rendered
using Leaflet.awesome-markers.

Parameters
----------
color : str, default 'blue'
    The color of the marker. You can use:

        ['red', 'blue', 'green', 'purple', 'orange', 'darkred',
         'lightred', 'beige', 'darkblue', 'darkgreen', 'cadetblue',
         'darkpurple', 'white', 'pink', 'lightblue', 'lightgreen',
         'gray', 'black', 'lightgray']

icon_color : str, default 'white'
    The color of the drawing on the marker. You can use colors above,
    or an html color code.

Most helpful comment

I found de way! From Folium 0.6.0 there exists a BeautifyIcon in the plugins module https://python-visualization.github.io/folium/docs-v0.6.0/plugins.html

If you do
from folium import plugins
you can use it!

All 3 comments

Feel free to submit a PR to improve the situation. I'll close b/c there is no real answer to "why?" That was not really by design, just convenience at the time of implementation.

@ocefpaf
It's how it is because of how https://github.com/lvoogdt/Leaflet.awesome-markers is built. I'll see if I can change it there.

I found de way! From Folium 0.6.0 there exists a BeautifyIcon in the plugins module https://python-visualization.github.io/folium/docs-v0.6.0/plugins.html

If you do
from folium import plugins
you can use it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wangchenwc picture wangchenwc  路  18Comments

ibayer picture ibayer  路  21Comments

EMarcantonio picture EMarcantonio  路  41Comments

achourasia picture achourasia  路  19Comments

Demetrio92 picture Demetrio92  路  18Comments