Folium: AttributeError: 'Map' object has no attribute 'circle_marker'

Created on 3 Dec 2017  路  1Comment  路  Source: python-visualization/folium

How should I fix this?

Traceback (most recent call last):
  File "tweet_map.py", line 19, in <module>
    tweet_map.circle_marker(location=geo, radius=250)
AttributeError: 'Map' object has no attribute 'circle_marker'
#create a map of tweets using Folium

import folium, pandas, ast

# get geo data only from rows with non-empty values
locations = pandas.read_csv('./usa_tweets.csv', usecols=[3]).dropna()

geos = []

for location in locations.values:
  # add to geos array an evaluated python literal syntax of the data
  geos.append(ast.literal_eval(location[0])['coordinates'])

# initialize and create map
tweet_map = folium.Map(location=[52.8, -2], tiles='Mapbox Bright', zoom_start=7)

# add markers
for geo in geos:
  tweet_map.circle_marker(location=geo, radius=250)

tweet_map.create

Most helpful comment

for geo in geos:
  #tweet_map.circle_marker(location=geo, radius=250)
  folium.CircleMarker(location=geo, radius=5).add_to(tweet_map)

#tweet_map.create_map(path='map.html')
tweet_map.save('map.html')

>All comments

for geo in geos:
  #tweet_map.circle_marker(location=geo, radius=250)
  folium.CircleMarker(location=geo, radius=5).add_to(tweet_map)

#tweet_map.create_map(path='map.html')
tweet_map.save('map.html')
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ispmarin picture ispmarin  路  17Comments

reaganch picture reaganch  路  13Comments

FlorianHoevelmann picture FlorianHoevelmann  路  14Comments

olibchr picture olibchr  路  19Comments

Alcampopiano picture Alcampopiano  路  14Comments