AttributeError- 'MarkerCluster'
See original GitHub issuePlease add a code sample or a nbviewer link, copy-pastable if possible
# Your code here
map2 = folium.Map(location=[53.232350, -1.422151], tiles='CartoDB dark_matter', zoom_start=11)
marker_cluster = folium.MarkerCluster().add_to(map2)
for point in range(0, len(locationlist)):
folium.Marker(locationlist[point], popup=df_counters['Name'][point]).add_to(marker_cluster)
map2
Problem description
When I try to run the above code, I get the following error. [this should explain why the current behavior is a problem and what is the expected output.]
Expected Output
Output of folium.__version__
AttributeError Traceback (most recent call last) <ipython-input-131-d98ae273548c> in <module>() 6 map2 = folium.Map(location=[53.232350, -1.422151], tiles=‘CartoDB dark_matter’, zoom_start=11) 7 ----> 8 marker_cluster = folium.MarkerCluster().add_to(map2) 9 10 for point in range(0, len(locationlist)):
AttributeError: module ‘folium’ has no attribute ‘MarkerCluster’
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
error message 'module' object has no attribute 'MarkerCluster'
I'm trying to create a very simple leaflet/folium map using python. It works without marker clusters (all the relevant locations show up on...
Read more >AttributeError: 'Map' object has no attribute 'Marker'
I have the following code: import folium from folium.plugins import MarkerCluster ...
Read more >plugins — Folium 0.12.1 documentation - GitHub Pages
Add marker clusters to a map using in-browser rendering. Using FastMarkerCluster it is possible to render 000's of points far quicker than the...
Read more >Can't use Folium modules : r/IPython - Reddit
I've imported folium, but whenever I run folium.MarkerCluster(), I get an AttributeError: module 'folium' has no attribute 'MarkerCluster'.
Read more >AttributeError: 'Map' object has no attribute 'Marker'
I have the following code: import folium from folium.plugins import MarkerCluster map1 = folium.Map(location=SF_COORDINATES, zoom_start=12) marker_cluster ...
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
To clarify,
MarkerCluster
is a plugin and is not available in the main folium module. So you cannot use it asfolium.MarkerCluster
. Instead you have to import the plugins and get it from there. Two options:or
I’m closing the issue. Feel free to add comments with additional questions of info. We can reopen the issue if needed.
Thank you for your help, but I just solved the problem!
Also, I need to say that your Github’s files have been very helpful! I am just a beginner with Python, and I have found a lot of useful info in your account and your comments. Thank you so much!