问题
I am creating a route using google.maps.DirectionsService.
What would be the best method to get the list of countries the route goes through?
I can't find this info in the DirectionsResult https://developers.google.com/maps/documentation/javascript/reference#DirectionsResult
回答1:
Each route from the routes array have a overview_path array with all the coordinates. You can geocode each of this coordinates and get the country of it (remember the limitation of geocoding calls!). Isn't the best solution but....
来源:https://stackoverflow.com/questions/20923710/google-maps-javascript-api-directionsservice-list-of-countries