I would like to play with the available icon in folium.Marker().
Is there a list somewhere so I can output with your icon before customizing?
Thank in advance.
Not sure what you mean there. Can you clarify what if that you want to do?
Also, take a look at the custom icons example and the many builtin options.
In your following example :
map_1 = folium.Map(location=[45.372, -121.6972],
zoom_start=12,
tiles='Stamen Terrain')
folium.Marker([45.3288, -121.6625],
popup='Mt. Hood Meadows',
icon=folium.Icon(icon='cloud')
).add_to(map_1)
folium.Marker([45.3311, -121.7113],
popup='Timberline Lodge',
icon=folium.Icon(color='green')
).add_to(map_1)
folium.Marker([45.3300, -121.6823],
popup='Some Other Location',
icon=folium.Icon(color='red',icon='info-sign')
).add_to(map_1)
map_1
you give the label icon='cloud' and icon='info-sign'
are there other types of icons? and if so is there a list of all the available options : icon='availableLabel'
Take a look at the docs with help(folium.Icon). I believe you'll find what you want.
yes indeed I found what I wanted.
Thank you very much.
No problem. Also browse the examples. I am pretty sure there are more use cases there:
http://nbviewer.jupyter.org/github/python-visualization/folium/tree/master/examples/
I keep finding this result in my Google searches for list of icons and always ending running help(folium.Icon) to find the following urls:
So this is a service to future me.
According to https://stackoverflow.com/questions/58607693/how-to-use-folium-icon-with-fontawesome/58609263#58609263 , only fontawesome v4 is supported. Thus, the list of available icons is this: https://fontawesome.com/v4.7.0/icons/
Had some frustrations with this as well. As far as I can tell this is what you can do:
Bootstrap icon list https://getbootstrap.com/docs/3.3/components/#glyphicons
```
folium.Marker(location=[],
icon=folium.Icon(
icon_color='#EC3323',
icon='euro'), # icon code take from above link. Note no prefix argument is used
).add_to(m)
Font Awesome icon list https://fontawesome.com/v4.7.0/icons/
folium.Marker([],
icon=folium.Icon(
icon_color='#3C711E',
icon='circle', # icon code from above link
prefix='fa'), # note fa prefix flag to use Font Awesome
).add_to(m)
```
Had some frustrations with this as well. As far as I can tell this is what you can do:
Bootstrap icon list https://getbootstrap.com/docs/3.3/components/#glyphicons
folium.Marker(location=[], icon=folium.Icon( icon_color='#EC3323', icon='euro'), # icon code take from above link. Note no prefix argument is used ).add_to(m)Font Awesome icon list https://fontawesome.com/v4.7.0/icons/
folium.Marker([], icon=folium.Icon( icon_color='#3C711E', icon='circle', # icon code from above link prefix='fa'), # note fa prefix flag to use Font Awesome ).add_to(m)
Unluckly, it doesn't work for me.
If I use one of the two icon, "cloud" or "info-sign", as in the quickstart guide, I can render them correctly. But if I point to a fa-icon or glyphicon (with the suggested syntax) I get always a color filled marker.
I am writing a Jupyter notebook on IBM Cloud platform. Could this be the problem? Anyway I underline that icons "cloud" and "info-sign" work fine.
Thnak you,
Federico
Had some frustrations with this as well. As far as I can tell this is what you can do:
Bootstrap icon list https://getbootstrap.com/docs/3.3/components/#glyphiconsfolium.Marker(location=[], icon=folium.Icon( icon_color='#EC3323', icon='euro'), # icon code take from above link. Note no prefix argument is used ).add_to(m)Font Awesome icon list https://fontawesome.com/v4.7.0/icons/
folium.Marker([], icon=folium.Icon( icon_color='#3C711E', icon='circle', # icon code from above link prefix='fa'), # note fa prefix flag to use Font Awesome ).add_to(m)Unluckly, it doesn't work for me.
If I use one of the two icon, "cloud" or "info-sign", as in the quickstart guide, I can render them correctly. But if I point to a fa-icon or glyphicon (with the suggested syntax) I get always a color filled marker.
I am writing a Jupyter notebook on IBM Cloud platform. Could this be the problem? Anyway I underline that icons "cloud" and "info-sign" work fine.
Thnak you,
Federico
I have solved. The right syntax that works for me is:
```folium.Marker([],
icon=folium.Icon(
icon_color='#3C711E', #acceptable colors are thos in color_options set.
icon='heart', # directly the code name of the target icon
prefix='glyphicon'), # note 'glyphicon' prefix flag
).add_to(m)
- for Font Awesome ones:
```folium.Marker([],
icon=folium.Icon(
icon_color='#3C711E', #acceptable colors are thos in color_options set.
icon='fa-circle', # note the 'fa-' prefix also in icon parameter
prefix='fa'), # note fa prefix flag to use Font Awesome
).add_to(m)
where color options is:
color_options = {'beige', 'black', 'blue', 'cadetblue', 'darkblue', 'darkgreen', 'darkpurple', 'darkred', 'gray', 'green', 'lightblue', 'lightgray', 'lightgreen', 'lightred', 'orange', 'pink', 'purple', 'red', 'white'}
Cheers, Federico
Most helpful comment
I keep finding this result in my Google searches for list of icons and always ending running
help(folium.Icon)to find the following urls:So this is a service to future me.