Skip to content

Conversation

@saheelsapovadia
Copy link
Contributor

Fixes #2149 : Add documentation for the Geoman plugin.

Summary
This PR adds complete documentation for the Geoman plugin that was released in Folium 0.19.6 but previously lacked documentation.

@saheelsapovadia
Copy link
Contributor Author

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

Additionally, I am trying to add Geoman to FeatureGroup and toggle visibility using LayerControl. But i am not able to. Is my implementation correct? @hansthen

@saheelsapovadia
Copy link
Contributor Author

@hansthen , i later discovered the available methods are already listed here - https://python-visualization.github.io/folium/latest/reference.html

Should I remove it from my changes in this PR?

@hansthen
Copy link
Collaborator

hansthen commented Sep 7, 2025

@hansthen , i later discovered the available methods are already listed here - https://python-visualization.github.io/folium/latest/reference.html

Should I remove it from my changes in this PR?

Yes, it is a bit redundant now.

@hansthen
Copy link
Collaborator

hansthen commented Sep 7, 2025

Fixes #2149 : Add documentation for the Geoman plugin.

Summary This PR adds complete documentation for the Geoman plugin that was released in Folium 0.19.6 but previously lacked documentation.

Very nice. You might want to add a few sentences about the advantages of the Geoman plugin compared to the Draw plugin. It is more recent. It supports more functionality, such as drawing shapes with holes inside of them. It also has paid add-ons with advanced functionality.

Otherwise, looks good to merge to me.

@hansthen
Copy link
Collaborator

hansthen commented Sep 7, 2025

Additionally, I am trying to add Geoman to FeatureGroup and toggle visibility using LayerControl. But i am not able to. Is my implementation correct? @hansthen

I think you found a bug. It seems like newly created elements are not added to the feature group. I will create a ticket for that.

@saheelsapovadia
Copy link
Contributor Author

@hansthen , i later discovered the available methods are already listed here - https://python-visualization.github.io/folium/latest/reference.html
Should I remove it from my changes in this PR?

Yes, it is a bit redundant now.

removed and pushed.

@saheelsapovadia
Copy link
Contributor Author

Fixes #2149 : Add documentation for the Geoman plugin.
Summary This PR adds complete documentation for the Geoman plugin that was released in Folium 0.19.6 but previously lacked documentation.

Very nice. You might want to add a few sentences about the advantages of the Geoman plugin compared to the Draw plugin. It is more recent. It supports more functionality, such as drawing shapes with holes inside of them. It also has paid add-ons with advanced functionality.

Otherwise, looks good to merge to me.

have added the information. let me know if anything is missing (don't have complete background on these plugins 😊).

@saheelsapovadia
Copy link
Contributor Author

Additionally, I am trying to add Geoman to FeatureGroup and toggle visibility using LayerControl. But i am not able to. Is my implementation correct? @hansthen

I think you found a bug. It seems like newly created elements are not added to the feature group. I will create a ticket for that.

Okay, thats interesting. will add it to my list of things to explore next 👍.

@hansthen
Copy link
Collaborator

hansthen commented Sep 7, 2025

Additionally, I am trying to add Geoman to FeatureGroup and toggle visibility using LayerControl. But i am not able to. Is my implementation correct? @hansthen

I think you found a bug. It seems like newly created elements are not added to the feature group. I will create a ticket for that.

Okay, thats interesting. will add it to my list of things to explore next 👍.

Too late :-) PR is already done. But if you are interested in solving bugs, there is a new one that I have not had the chance to look at #2175. It looks very similar to this one.

@hansthen
Copy link
Collaborator

hansthen commented Sep 7, 2025

LGTM. Thanks for your updates.

@hansthen hansthen merged commit 469bae3 into python-visualization:main Sep 7, 2025
1 check passed
@saheelsapovadia
Copy link
Contributor Author

Too late :-) PR is already done. But if you are interested in solving bugs, there is a new one that I have not had the chance to look at #2175. It looks very similar to this one.

No problem, will check this one out.

hansthen pushed a commit to hansthen/folium that referenced this pull request Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update documentation for the Geoman plugin

2 participants