Calculate driving directions using PHP?
问题 For my application I need a server to calculate driving directions. The Google Maps API was designed for clientside use only, with a Javascript and Flash API. Is there any way I can run their API's server-side? 回答1: As I know it this isn't official and google doesn't support it but it works: $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