Skip to content

Geoman drawn elements cannot be controlled using a LayerControl #2182

@hansthen

Description

@hansthen

Describe the bug
Elements that are created using Geoman are not enabled/disabled when clicking the appropriate LayerControl layers.

To Reproduce

import folium
from folium.plugins import GeoMan

m = folium.Map(location=[45.5236, -122.6750], zoom_start=13)

# Create a feature group for drawn items
drawn_items = folium.FeatureGroup(name="Drawn Items")
drawn_items.add_to(m)

# Add Geoman with the feature group
GeoMan(feature_group=drawn_items).add_to(m)

# Add layer control to toggle visibility of drawn items
folium.LayerControl().add_to(m)

m```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions