-
Notifications
You must be signed in to change notification settings - Fork 256
GoogleMapPlotter.directions
frslm edited this page Jun 26, 2020
·
10 revisions
GoogleMapPlotter.directions(origin, destination, **kwargs)
Display directions from an origin to a destination.
Requires Directions API.
-
Parameters
-
origin
(float, float)– Origin, in latitude/longitude. -
destination
(float, float)– Destination, in latitude/longitude.
-
-
Optional Parameters
-
travel_mode
str– Travel mode. Defaults to ‘DRIVING’. -
waypoints
[(float, float)]– Waypoints to pass through.
-
Usage:
import gmplot
apikey = '' # (your API key here)
gmap = gmplot.GoogleMapPlotter(37.766956, -122.438481, 13, apikey=apikey)
gmap.directions(
(37.799001, -122.442692),
(37.832183, -122.477914),
waypoints=[
(37.801036, -122.434586),
(37.805461, -122.437262)
]
)
gmap.draw('map.html')