Google Maps API - “road” distance between 2 points

▼魔方 西西 提交于 2019-12-10 12:15:32

问题


I have a website where "near locations" are shown for each item, based on the latitude and longitude coordinates stored in a database.

Problem is that this calculated distance is the air-line distance, which differs a lot ferom the actual driving distance.

Google Maps does only have a JavaScript API for driving directions by now, I need it as a web service API to make calls directly from the server.

Is there any possibility to do this?


回答1:


The Google Maps API has a HTTP service for geocoding, but not for directions. You can only access that functionality through the Javascript API. You could hack it, but it would break Google's ToS.

More discussion here.



来源:https://stackoverflow.com/questions/1470309/google-maps-api-road-distance-between-2-points

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