对于我的应用程序,我需要一台服务器来计算行车路线。使用PHP计算驾车路线?
该Google Maps API是专为客户端使用,使用Javascript和Flash API。有什么方法可以运行他们的API的服务器端?
对于我的应用程序,我需要一台服务器来计算行车路线。使用PHP计算驾车路线?
该Google Maps API是专为客户端使用,使用Javascript和Flash API。有什么方法可以运行他们的API的服务器端?
我所知,这不是正式的和谷歌不支持它,但它的工作原理:
$url = str_replace(' ', '%20', "http://maps.google.com/maps/nav?client=yourclient&output=json&q=from: ".$lat1.",".$lon1." to: ".$lat2.",".$lon2);
$result = file_get_contents($url);
$data = json_decode(utf8_encode($result), true);
而且你必须在$ data数组的方向。
嗨, 是否必须是Google地图,或者您可以使用Bing地图吗?如果是后者,您可以检查Bing Maps SDK(http://www.microsoft.com/maps/developers/),因为它提供了SOAP Web服务,我认为这可以从服务器调用。 – keyboardP 2009-11-25 23:13:43
[Google Maps HTTP API for driving and walking directions]的可能重复(http://stackoverflow.com/questions/2041601/google-maps-http-api-for-driving-and-walking-directions) – miguev 2016-07-07 10:21:48