'Polyline Problems
Create the map
m_3 = folium.Map(location=[-12.04318,-77.02824], tiles='cartodbpositron', zoom_start=10)
# Display the map
mc = MarkerCluster()for idx, row in df.iterrows():if not math.isnan(row['end_lon']) and not math.isnan(row['end_lat']):mc.add_child(Marker([row['end_lat'], row['end_lon']],popup='FIN', icon=folium.Icon(color='red',icon_color='#FF0000'),color='#008000',fill_color='#008000'))m_3.add_child(mc)
for idx, row in df.iterrows():if not math.isnan(row['start_lon']) and not math.isnan(row['start_lat']):mc.add_child(Marker([row['start_lat'], row['start_lon']],popup='INICIO', icon=folium.Icon(color='green',icon_color='#008000'), color='#FF0000',fill_color='#FF0000'))m_3.add_child(mc)
I don know , i need your HELP in the next code (I need the line between start and end):
folium.PolyLine(([row['start_lat'], row['start_lon']], [row['end_lat'], row['end_lon']]))
folium.PolyLine(points, color='red').add_to(m_3)m_3.add_child(mc)
Display the map
m_3
create a conection two point with line for cabify case
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|