Road distance,Actual distance between two places

后端 未结 3 1778
没有蜡笔的小新
没有蜡笔的小新 2020-12-19 21:23

I want to calculate the driving distance between two locations [the user\'s specified locations], before user starts the driving. I used many formulas and getDistanceFrom in

3条回答
  •  感动是毒
    2020-12-19 21:43

    If you have two LatLongs you can calculate the direct distance between them; however, since you want driving directions (not as the crow flies) you'll need access to street-center-lines, so you can calculate the distance for each "leg" of the trip.

    Google Maps may provide driving directions along with route distance, you'll need to check the documentation for that specific functionality.

    edit

    On a second look, it appears this may not be available on the API (as of 2006), but a work-around is posted here: http://groups.google.com/group/Google-Maps-API/msg/4dc2fad4f74e3314

提交回复
热议问题