8

I found a googlemaps package to access google map from python,but didn't find any demo to show the result in python code.

For example:

gmaps = googlemaps.Client(key='Add Your Key here')

# Geocoding an address
geocode_result = gmaps.geocode('1600 Amphitheatre Parkway, Mountain View, CA')

# Look up an address with reverse geocoding
reverse_geocode_result = gmaps.reverse_geocode((40.714224, -73.961452))

# Request directions via public transit
now = datetime.now()
directions_result = gmaps.directions("Sydney Town Hall",
                                     "Parramatta, NSW",
                                     mode="transit",
                                     departure_time=now)

I can print the directions_result to console but don't know how to show the map in graphic mode. How to show the search result as a map in python?

1 Answer 1

15

Because googlemaps package is only for data/responses API.


For more information read this tutorial (writing JS map & data analysis): https://github.com/invisibleroads/invisibleroads-tutorials/blob/master/geodjango-googlemaps-build.rst


For plotting data on google maps use: https://github.com/vgm64/gmplot

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.