我找到了一个
googlemaps软件包来从python访问谷歌地图,但没有找到任何演示以在python代码中显示结果.
例如:
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)
我可以将directions_result打印到控制台,但不知道如何以图形模式显示地图.如何在python中将搜索结果显示为地图?