draw ployline along with street view
sandiemann opened this issue · comments
Describe the bug
I want to draw the polyline that connects between two coordinate points but it always draws as a straight line.
To Reproduce
my_map = folium.Map(location=df['Coordinates'].iloc[0][0], zoom_start=12)
for index, row in df.iterrows():
routes = row['Named_Routes']
coords = row['Coordinates']
if start_route_name in routes and end_route_name in routes:
folium.Marker(location=coords[0], popup=f"Start: {routes[0]}", icon=folium.Icon(color='green')).add_to(
my_map)
folium.Marker(location=coords[-1], popup=f"End: {routes[-1]}", icon=folium.Icon(color='red')).add_to(my_map)
for i in range(1, len(coords) - 1):
folium.Marker(location=coords[i],
icon=folium.Icon(color='blue', icon_color='white', prefix='fa', icon='bus'),
popup=f"Route: {routes[i]}", tooltip=f"Route: {routes[i]}").add_to(my_map)
Expected behavior
I prefer the line go over the nearest street view to connect coordinates, possibly osmx impl. because the route looks like the way over the park.
Could you suggest how to overcome this issue?
![Screenshot 2024-01-27 at 20 30 04](https://private-user-images.githubusercontent.com/36822600/300210851-e89f348a-dbec-4cc1-96d3-16c1a4a644a6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTQ4MDg5NDMsIm5iZiI6MTcxNDgwODY0MywicGF0aCI6Ii8zNjgyMjYwMC8zMDAyMTA4NTEtZTg5ZjM0OGEtZGJlYy00Y2MxLTk2ZDMtMTZjMWE0YTY0NGE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTA0VDA3NDQwM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkNzg1ZDUyZTYwNzEzOTBkN2Y1ZTZiMDNlNmI3YWQ2MmI2NDIyYzM5OWRjMDFmOGNhYWIwZThmNzA1NzJhNWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5VAC-J4rFfwaDY5ep1_WhmVvtYRI1_rOuFh5T32eWWk)
found a workaround on OSM. closing this.