Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"module 'folium.features' has no attribute 'CircleMarker' "

Tags:

python

folium

I would like to use circlemarker to show geomap on my project.
Here is what I wrote:

states = folium.map.FeatureGroup()
i=0
for lat, lng, in zip(dataframe_filtered.location_latitude, dataframe_filtered.location_longitude):
    states.add_child(
        folium.features.CircleMarker(
            [lat, lng],
            radius=5, # define how big you want the circle markers to be
            color='yellow',
            fill=True,
            fill_color='blue',
            fill_opacity=0.6,
        )
    )
    i+=1

However, I am getting an error:

"module 'folium.features' has no attribute 'CircleMarker' "

like image 772
Neelima Kamtam Avatar asked Jul 13 '26 06:07

Neelima Kamtam


1 Answers

Change

folium.features.CircleMarker

to

folium.CircleMarker

I guess the new folium.features has removed the .CircleMarker option. Just call .CircleMaker directly from folium should be fine. Hope this help.

like image 52
Tim Lin Avatar answered Jul 15 '26 20:07

Tim Lin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!