Last active
May 3, 2022 13:01
-
-
Save abhishek-shrm/52c68b7ef24c1e81df64752394dcf55f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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