Skip to content

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

Closed

Description

@martinfleis

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.

Activity

  1. Conengmo commented on Jan 24, 2025

    @Conengmo
    Member

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

  2. added
    bugAn issue describing unexpected or malicious behaviour
    on Jan 24, 2025
  3. LukasWallisch commented on Mar 13, 2025

    @LukasWallisch

    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
    
  4. Conengmo commented on Mar 15, 2025

    @Conengmo
    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?

  5. martinfleis commented on Mar 15, 2025

    @martinfleis
    CollaboratorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue describing unexpected or malicious behaviour

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions