Skip to content

Font Awesome fonts built under version 5 don't render in folium 0.5.0 #923

@robsomething

Description

@robsomething

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 object
fga.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 addresses
mapout.add_child(folium.LayerControl()) #add layer control after all layers added
mapout.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.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature request or idea about how to make folium better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions