-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Combining GeoJson
markers in a MarkerCluster
shows unclustered markers
#1209
Comments
GeoJson
with MarkerCluster
GeoJson
markers in a MarkerCluster
shows unclustered markers
Hi @diegoquintanav, I think that #1190 fixed the problem you mention, and it was done after the release of version 10. Therefore, would be better install folium directly from github give it a try again. |
It seems #1190 (merged July 2019) and #1289 (merged April 2020) are at odds with each other. We have to resolve the conflicting requirements. Some ideas:
|
I think I've found a way round it. If you make the GeoJson a subgroup of the MarkerCluster it seems to work. Although weirdly you need to untick and tick GeoJson layer (Housing) for it show anything. 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='Developments')
mc1= folium.plugins.FeatureGroupSubGroup(marker_cluster, 'Housing')
m.add_child(marker_cluster)
m.add_child(Housing)
mc1.add_child(folium.GeoJson(data_url, embed=False))
folium.LayerControl(collapsed=False).add_to(m)
m My next query is, how can I show labels, either tooltips or popups? Substituting mc1.add_child(folium.GeoJson(data_url, tooltip=folium.GeoJsonTooltip(fields=['addr:street']), embed=False)) |
It seems combining I don't think using the |
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:
|
Please add a code sample or a nbviewer link, copy-pastable if possible
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'
The text was updated successfully, but these errors were encountered: