How to get walking or driving distance via google maps with php

后端 未结 1 1195
一向
一向 2020-12-30 16:32

I\'ve worked with google maps before, but when implementing it, I\'ve never found any documentation on how to get the exact distance between 2 given locations via Javascript

相关标签:
1条回答
  • 2020-12-30 17:21

    This posting gives a way and a warning.

    To break it down you use google maps to query a URL like this

    http://maps.google.com/maps?q=from+A+to+B&output=kml

    and then you view the data retrieved from that url (in kml format) and look at the placemark tags (run it through simplexml) each placemark tag will have a description child that will have a text description of the next step in the route from A to B.

    Also mentioned in the article is that by using this method you are bound by the google maps T&C which states

    Also, you may not use Google Maps in a manner which gives you or any other person access to mass downloads or bulk feeds of numerical latitude and longitude coordinates.

    So you may want to keep that in mind.

    0 讨论(0)
提交回复
热议问题