I am trying to write a piece of code that plots a list of markers on a map. The markers are formatted by longitude and latitude:
trip_markers[0:4]:
[[40.64499, -73.78115],
[40.766931, -73.982098],
[40.77773, -73.951902],
[40.795678, -73.971049]]
I am trying to write a function that iterates through this list, and plots each point on a map.
def map_from(location, zoom_amount):
return folium.Map(location=location, zoom_start=zoom_amount)
manhattan_map = map_from([40.7589, -73.9851], 13)
The code below seems to be the problem
def add_markers(markers, map_obj):
for marker in markers:
return marker and marker.add_to(map_obj)
map_with_markers = add_markers(trip_markers, manhattan_map)
I expect my output of map_with_markers
to produce a map with each point plotted
However I am getting:
<folium.vector_layers.CircleMarker at 0x7f453a365c50>