folium icon indicating copy to clipboard operation
folium copied to clipboard

Passing folium.Icon to folium.Marker seems to be broken on main

Open martinfleis opened this issue 10 months ago • 1 comments

GeoPandas CI is failing with Folium main due to the icon passed to the marker no longer being used.

import folium

fc = {'type': 'FeatureCollection',
 'features': [{'id': '0',
   'type': 'Feature',
   'properties': {'name': 'Vatican City'},
   'geometry': {'type': 'Point', 'coordinates': (12.4533865, 41.9032822)},
   'bbox': (12.4533865, 41.9032822, 12.4533865, 41.9032822)}],
 'bbox': (12.4533865, 41.9032822, 12.4533865, 41.9032822)}

m = folium.Map()
marker = folium.Marker(icon=folium.Icon(icon="star"))
folium.GeoJson(
        fc,
        marker=marker,
).add_to(m)
m

This creates a marker with a star symbol in folium 0.19.4 but uses default on main.

martinfleis avatar Jan 18 '25 16:01 martinfleis

Sorry about that Martin! I made a fix that should hopefully solve this issue.

Conengmo avatar Jan 24 '25 12:01 Conengmo

Shouldn't this be fixed in 0.19.5 ?

For me it still is there in this Version 🙃

> pip show folium   
Name: folium
Version: 0.19.5
> pip show geopandas      
Name: geopandas
Version: 1.0.1

LukasWallisch avatar Mar 13 '25 10:03 LukasWallisch

Hi @LukasWallisch, I tried the example Martin posted in the OP with Folium 0.19.5 and Geopandas 1.0.1 and it works. If it doesn't work for you, could you maybe share a complete reproducible example that leads to your issue?

Conengmo avatar Mar 15 '25 10:03 Conengmo

Yeah,can confirm that the issue GeoPandas was facing has been fixed.

martinfleis avatar Mar 15 '25 12:03 martinfleis