Combining `GeoJson` markers in a `MarkerCluster` shows unclustered markers
See original GitHub issuePlease add a code sample or a nbviewer link, copy-pastable if possible
with open('examples/data/search_bars_rome.json') as f:
data = json.load(f)
data_url = 'https://raw.githubusercontent.com/python-visualization/folium/master/examples/data/search_bars_rome.json'
m = folium.Map((41.9, 12.5), tiles='cartodbpositron')
marker_cluster = folium.plugins.MarkerCluster(name='mc').add_to(m)
folium.GeoJson(data_url, embed=False).add_to(marker_cluster)
folium.GeoJson(data_url, embed=False, name='geojson').add_to(m)
folium.LayerControl(collapsed=False).add_to(m)
m.save('_map.html')
m
Problem description
I expected to see the markers in a clustered fashion
I can’t tell from #1190, #1129 and #1188 if this is fixed in version 0.10.0, and if it is, what’s the right syntax?
Expected Output
Clustered markers (This was taken from another example)
Output of folium.__version__
‘0.10.0’
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Combining Feature Selection and Marker Clustering
I am using the basic structure for layer toggling found in this CartoDB tutorial, with buttons wired to a ul navigation menu.
Read more >Styling individual markers in markercluster - Stack Overflow
I am trying to style individual markers, or clusters of size 1, based on some feature property. var markers = L.markerClusterGroup(); function ...
Read more >Marker cluster in leaflet | GeoJSON points to cluster | GeoDev
marker cluster Github: https://github.com/Leaflet/Leaflet.markerclustertutorial code: ...
Read more >leaflet.markercluster - npm Package Health Analysis - Snyk
Provides Beautiful Animated Marker Clustering functionality for Leaflet For more information about how to use this package see README.
Read more >leaflet-cluster · development · MAKB / MapKB · GitLab - USGS
package.json ... Provides Beautiful Animated Marker Clustering functionality for ... Install with npm: npm install leaflet.markercluster.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The fix has been merged. It will be in the next release, v0.12.0, release date yet unknown. If you want it earlier you can install folium from the main branch:
It seems combining
GeoJsonTooltip
andMarkerCluster
plugin is not supported behavior. Note that while everything in the base folium library should work well together we can’t guarantee that for the plugins.I don’t think using the
FeatureGroupSubGroup
plugin is a real solution here. I’ll make a PR where we do the ajax call asynchronously.