Skip to content

Instantly share code, notes, and snippets.

@abhishek-shrm
Last active May 3, 2022 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhishek-shrm/52c68b7ef24c1e81df64752394dcf55f to your computer and use it in GitHub Desktop.
Save abhishek-shrm/52c68b7ef24c1e81df64752394dcf55f to your computer and use it in GitHub Desktop.
# Creating feature groups
f1=folium.FeatureGroup("Vehicle 1")
f2=folium.FeatureGroup("Vehicle 2")
f3=folium.FeatureGroup("Vehicle 3")
# Adding lines to the different feature groups
line_1=folium.vector_layers.PolyLine(coords_1,popup='<b>Path of Vehicle_1</b>',tooltip='Vehicle_1',color='blue',weight=10).add_to(f1)
line_2=folium.vector_layers.PolyLine(coords_2,popup='<b>Path of Vehicle_2</b>',tooltip='Vehicle_2',color='red',weight=10).add_to(f2)
line_3=folium.vector_layers.PolyLine(coords_3,popup='<b>Path of Vehicle_3</b>',tooltip='Vehicle_3',color='green',weight=10).add_to(f3)
@miladad8
Copy link

miladad8 commented May 3, 2022

Hi. thank you for very helpful tutorial. I have a list of coordinates representing a trajectory, but the problem is unlike your coords_1 to coords_3, the latitude and longtitude are displaced in which the first element in every index is longtitude and second element is latitude. since folium.map(location) gets latitude first , what should i do for represnting my trajectory using folium? thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment