Python 如何使用';多段线';
使用jupyter笔记本/蟒蛇3 我想使用带标记的多段线,但它不起作用Python 如何使用';多段线';,python,python-3.x,jupyter-notebook,polyline,folium,Python,Python 3.x,Jupyter Notebook,Polyline,Folium,使用jupyter笔记本/蟒蛇3 我想使用带标记的多段线,但它不起作用 map = folium.Map(location=[37.4601908, 126.4406957]) for index,lat in enumerate(place_lat): folium.Marker([lat, place_lng[index]], popup=('patient3 \n 74contacts'),
map = folium.Map(location=[37.4601908, 126.4406957])
for index,lat in enumerate(place_lat):
folium.Marker([lat,
place_lng[index]],
popup=('patient3 \n 74contacts'),
icon = folium.Icon(color='green',icon='plus')).add_to(map)
folium.Polyline(color='red').add_to(map)
map
我以为多段线在叶状体中
但是错误说
AttributeError: module 'folium' has no attribute 'Polyline'
如何使用多段线?从中,您应该使用多段线
例如:
import folium
m = folium.Map(location=[37.4601908, 126.4406957],
zoom_start=15)
place_lat = [37.4601928, 37.4593108, 37.4641108, 37.4611508]
place_lng = [126.4406957, 126.4432957, 126.4476917, 126.4423957]
points = []
for i in range(len(place_lat)):
points.append([place_lat[i], place_lng[i]])
for index,lat in enumerate(place_lat):
folium.Marker([lat,
place_lng[index]],
popup=('patient{} \n 74contacts'.format(index)),
icon = folium.Icon(color='green',icon='plus')).add_to(m)
folium.PolyLine(points, color='red').add_to(m)
m