You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Font Awesome fonts built under version 5 don't render in folium 0.5.0 #923
Hi, I can't get the FA icons to render if they have a prefix other than "fa". FA built out a bunch of new ones and reclassified many of the older ones.
mapout=folium.Map(location=[33.46,-111.79], zoom_start=7, tiles="OpenStreetMap", control_scale=True)
v= {'latitude': 34, 'longitude': -115, 'ID': 12345}
w= {'latitude': 34.5, 'longitude': -114.5, 'ID': 12346}
iconprefix='fab'iconname='fa-cloudversify'iconcolor='green'label='Customer ID: '+str(v['ID'])+'<br>'pointpopup=folium.Popup(IFrame(label, width=300, height=150))
fga=folium.FeatureGroup(name="Active Customers") #add a group of features to a single objectfga.add_child(folium.Marker(location=[float(v['latitude']),float(v['longitude'])], popup=pointpopup , \
icon=folium.Icon(color=iconcolor,prefix=iconprefix, icon=iconname)))
iconprefix='fa'iconname='fa-shopping-cart'iconcolor='green'label='Customer ID: '+str(w['ID'])+'<br>'pointpopup=folium.Popup(IFrame(label, width=300, height=150))
fga.add_child(folium.Marker(location=[float(w['latitude']),float(w['longitude'])], popup=pointpopup , \
icon=folium.Icon(color=iconcolor,prefix=iconprefix, icon=iconname)))
mapout.add_child(fga) #add the group/layer of addressesmapout.add_child(folium.LayerControl()) #add layer control after all layers addedmapout.save('mapout.html')
[mapout.txt](https://github.com/python-visualization/folium/files/2242508/mapout.txt)
Problem description
Font Awesome icons with prefixes other than 'fa' do not render in popup markers, when using folium 0.5.0. According to a response from the FA help desk:
"It looks like folium is using Font Awesome version 4, so those prefixes won't work. Folium will need to be updated for version 5."
Expected Output
icon to lower left should have a small cloud. icon to upper right should have a shopping cart. ticket includes an .html file renamed as .txt for uploading purposes
Output of folium 0.5.0
Lower left icon is missing. Upper right shopping cart is showing.
Reacted by bilow-factual, Pablo Jadzinsky and q-wertz
Thanks for pointing this out. I just looked into it a bit and indeed folium is using version 4. Do we want to move to 5?
We're using a Leaflet plugin for the markers: https://github.com/lvoogdt/Leaflet.awesome-markers
This library is made for FA version 4 and it won't work with version 5, because it uses the prefix argument for both the loose fa and the fa-icon-name. The library isn't being actively maintained and PR's don't seem to get accepted, so I'm not sure how we can solve this.
Hi @robsomething, we recently forked the awesome marker library to take control of updating it. You're very welcome to contribute to it if you have the time! @rougeth will help out maintaining it. I think right now PR's that add FA 5 support are welcome. You can probably look into other forks to see how others did it. We'll then have to patch folium to work with the changes.
Activity
Conengmo commentedon Aug 2, 2018
Thanks for pointing this out. I just looked into it a bit and indeed folium is using version 4. Do we want to move to 5?
We're using a Leaflet plugin for the markers:
https://github.com/lvoogdt/Leaflet.awesome-markers
This library is made for FA version 4 and it won't work with version 5, because it uses the
prefixargument for both the loosefaand thefa-icon-name. The library isn't being actively maintained and PR's don't seem to get accepted, so I'm not sure how we can solve this.The library was more recently updated on this fork, but still no FA v.5 support.
https://github.com/sigma-geosistemas/Leaflet.awesome-markers
So it seems we're stuck with FA v.4 for now. Unless maybe...
folium is maintained by volunteers so ideas or help is welcome!
Conengmo commentedon Oct 12, 2018
Hi @robsomething, we recently forked the awesome marker library to take control of updating it. You're very welcome to contribute to it if you have the time! @rougeth will help out maintaining it. I think right now PR's that add FA 5 support are welcome. You can probably look into other forks to see how others did it. We'll then have to patch folium to work with the changes.
https://github.com/python-visualization/Leaflet.awesome-markers
Conengmo commentedon Nov 18, 2022
This can be closed since #1637 was merged.