GoogleMapPlotter.geocode

classmethod GoogleMapPlotter.geocode(location, apikey='')


Return the lat/lng coordinates of a location string.

Requires Geocoding API.

  • Parameters

    location str – Location or address of interest, as a human-readable string.

  • Optional Parameters

    apikey str – Google Maps API key.

  • Returns

    (float, float) – Latitude/longitude coordinates of the given location string.

Usage:

import gmplot
apikey = '' # (your API key here)
location = gmplot.GoogleMapPlotter.geocode('Versailles, France', apikey=apikey)
print(location)