Google Distance Matrix Api

时间:2017-07-10 04:52:09

标签: google-distancematrix-api

任何人都知道,如何使用谷歌距离矩阵Api但来自网络服务器的目的地? 例如,我想使用谷歌距离矩阵api和纬度经度目的地从这个网址sempatbimbel.esy.es/actions/jsontbimbel.php

1 个答案:

答案 0 :(得分:0)

我知道已经晚了。首先,你需要获得这个网站的IP地址(比如ASP,PHP,......中的ping),然后将IP转换为lat / long,就像这样http://geoipinfo.org/。现在,您有两组坐标:网站的地理坐标和目的地。 然后将这些地理定位传递给Google AP,就像这样

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=40.6655101,-73.89188969999998&destinations=40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.659569%2C-73.933783%7C40.729029%2C-73.851524%7C40.6860072%2C-73.6334271%7C40.598566%2C-73.7527626%7C40.659569%2C-73.933783%7C40.729029%2C-73.851524%7C40.6860072%2C-73.6334271%7C40.598566%2C-73.7527626&key=YOUR_API_KEY

来自https://developers.google.com/maps/documentation/distance-matrix/intro