Google Maps Javascript API, DirectionsService, list of countries

断了今生、忘了曾经 提交于 2019-12-24 04:09:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!