For showing direction based on a map in Python, you can use several libraries such as folium
, geopy
, and gmaps
. Here is an example using geopy
and folium
:
main.py1036 chars30 lines
In this example, we use Nominatim
from geopy
to get the geolocation of the starting and destination points. Then, we use folium
to create a map object and add markers for the two points. Finally, we use geolocator.route
to get the route between the two points and add it to the map as a PolyLine
. The result is a map showing the route between New York City and Los Angeles.
gistlibby LogSnag