0
我使用谷歌地理編碼API在PHP中獲取一個地方的緯度和經度。地理編碼器返回錯誤的結果
<?php
$url = 'http://maps.googleapis.com/maps/api/geocode/json?address=Hollywood,+Newyork,+CA&sensor=true';
$response = file_get_contents($url);
$response = json_decode($response, true);
$lat = $response['results'][0]['geometry']['location']['lat'];
$long = $response['results'][0]['geometry']['location']['lng'];
echo "latitude: " . $lat . " longitude: " . $long;exit;
?>
它的返回經度和緯度值爲34.1408919,-118.350441。但好萊塢在美國佛羅里達州。所以它不應該爲我返回任何結果。我將如何實現此目標