Neelima Kamtam
Neelima Kamtam

Reputation: 31

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

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' "

Upvotes: 2

Views: 3951

Answers (3)

Yassine Hayf
Yassine Hayf

Reputation: 1

Try pip install --upgrade folium

Upvotes: -1

Tim Lin
Tim Lin

Reputation: 91

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.

Upvotes: 9

Aaron Mann
Aaron Mann

Reputation: 84

It's entirely possible that this is caused due to use of a old release of folium. Try updating your module download and letting us know if it worked.

Upvotes: 0

Related Questions