0

我正在编写一个移动应用程序 - 我想在其中获取纬度和经度附近的街道列表。我得到了一条街道,但我喜欢得到更多,因为有时街道由于纬度的准确性而不正确,并为用户提供选择正确街道的选项。

我正在使用 Javascript 和在 Phonegap 中开发的应用程序进行编程。

谷歌地图网址 https://maps.googleapis.com/maps/api/place/search/json?location=42.28684519999999,-83.0525493&radius=10&types=route&sensor=false&key= ...

它只返回一条街道 - 圣克莱尔,但我在加利福尼亚街。

谢谢阿迪亚

4

1 回答 1

6

看看谷歌地图 反向地理编码API

http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true_or_false

返回

{
  "status": "OK",
  "results": [ {
    "types": street_address,
    "formatted_address": "275-291 Bedford Ave, Brooklyn, NY 11211, USA",
    "address_components": [ {
      "long_name": "275-291",
      "short_name": "275-291",
      "types": street_number
    }, {
      "long_name": "Bedford Ave",
      "short_name": "Bedford Ave",
      "types": route
    }, {
      "long_name": "New York",
      "short_name": "New York",
      "types": [ "locality", "political" ]
    }, {
      "long_name": "Brooklyn",
      "short_name": "Brooklyn",
      "types": [ "administrative_area_level_3", "political" ]
    }, {
      "long_name": "Kings",
      "short_name": "Kings",
      "types": [ "administrative_area_level_2", "political" ]
    }, {
      "long_name": "New York",
      "short_name": "NY",
      "types": [ "administrative_area_level_1", "political" ]
    }, {
      "long_name": "United States",
      "short_name": "US",
      "types": [ "country", "political" ]
    }, {
      "long_name": "11211",
      "short_name": "11211",
      "types": postal_code
    } ],
    "geometry": {
      "location": {
        "lat": 40.7142298,
        "lng": -73.9614669
      },
      "location_type": "RANGE_INTERPOLATED",
      "viewport": {
        "southwest": {
          "lat": 40.7110822,
          "lng": -73.9646145
        },
        "northeast": {
          "lat": 40.7173774,
          "lng": -73.9583193
        }
      }
    }
  },

  ... Additional results[] ...
于 2012-05-31T14:39:27.677 回答