【问题标题】:Geo coder returning wrong results地理编码器返回错误结果
【发布时间】:2014-09-24 09:36:45
【问题描述】:

我在 php 中使用 google geocoder API 来获取一个地方的 lat 和 lang。

<?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。但是好莱坞在美国佛罗里达州。所以它不应该为我返回任何结果。我将如何实现这一目标

【问题讨论】:

    标签: php google-maps google-geocoder google-geocoding-api


    【解决方案1】:

    返回基于您的查询,在本例中为:Hollywood, New York, CA。 Google 正在返回 New York St, North Hollywood, CA 91602, USA 的经纬度

    如果您正在寻找不同的地址,请更改您的查询..

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多