Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
martinfleis opened this issue Jan 18, 2025 · 4 comments · Fixed by #2086
Closed

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

martinfleis opened this issue Jan 18, 2025 · 4 comments · Fixed by #2086
Labels
bug An issue describing unexpected or malicious behaviour

Comments

@martinfleis
Copy link
Collaborator

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.

@Conengmo
Copy link
Member

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

@Conengmo Conengmo added the bug An issue describing unexpected or malicious behaviour label Jan 24, 2025
@LukasWallisch
Copy link

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

@Conengmo
Copy link
Member

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?

@martinfleis
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue describing unexpected or malicious behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants