Skip to content

Make cluster "bubbles" ignorable by Geoman #1249

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

Merged

Conversation

lopezvoliver
Copy link
Contributor

@lopezvoliver lopezvoliver commented May 12, 2025

Thanks to #1220, the base Layer class now sets pm_ignore by default to True so that Geoman ignores created layers by default -- including for example, markers. However, the Leaflet.markercluster plugin also creates additional L.Markers with an icon that represent the clusters, i.e. a "cluster bubble" which is shown as a circle and a label indicating the number of markers represented by the cluster. Currently, Geoman doesn't ignore this by default and causes issues such as being able to move the cluster bubble around the map or deleting the bubble.

This PR intercepts the creation of this L.Marker (in jupyter_leaflet) so that it can also be ignored by Geoman.

@martinRenou and/or @iisakkirotko could you please review? If possible, a new release (latest one was in July 2024) including these latest improvements (see also #1250, #1251) would be appreciated.

@lopezvoliver lopezvoliver changed the title Monkey-patch _featureGroup.addLayer in markerClusterGroup to disable pm Make cluster "bubbles" ignorable by Geoman May 13, 2025
@martinRenou martinRenou force-pushed the markercluster-disablepm branch from 44d7263 to 93e805a Compare June 3, 2025 12:17
Copy link
Contributor

@arjxn-py arjxn-py left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lopezvoliver.

Works pretty well:

Screen.Recording.2025-06-04.at.17.37.40.mp4

@martinRenou martinRenou merged commit 9a12952 into jupyter-widgets:master Jun 4, 2025
4 checks passed
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.

3 participants