代码之家  ›  专栏  ›  技术社区  ›  ACP

有没有可能根据谷歌地图上的Pincode(627357)在印度找到一个地方

  •  0
  • ACP  · 技术社区  · 14 年前

    我试图实现一个搜索选项在我的谷歌地图使用pincode。。。有可能吗?有什么建议吗。。。。

    2 回复  |  直到 14 年前
        1
  •  1
  •   MJB    14 年前
        2
  •  0
  •   Sarath Nair    8 年前

    我知道现在回答这个问题已经晚了,但它可能会帮助其他寻找它的人。去 geonames.org . 他们确实有一个api从邮政编码中获取位置信息。响应包含纬度和经度信息。你可以利用这些信息把它放在地图上。

    以下是请求和响应示例:

    请求: http://api.geonames.org/postalCodeLookupJSON?postalcode=627357&username=demo&country=IN

    {
      "postalcodes": [{
        "adminName2": "Tirunelveli",
        "adminName3": "Tirunelveli",
        "postalcode": "627357",
        "adminCode1": "25",
        "countryCode": "IN",
        "lng": 77.38515755863037,
        "placeName": "Karaiyiruppu",
        "lat": 9.042148763528974,
        "adminName1": "Tamil Nadu"
      }, {
        "adminName2": "Tirunelveli",
        "adminName3": "Tirunelveli",
        "postalcode": "627357",
        "adminCode1": "25",
        "countryCode": "IN",
        "lng": 77.38515755863037,
        "placeName": "Nanajankulam",
        "lat": 9.042148763528974,
        "adminName1": "Tamil Nadu"
      }, {
        "adminName2": "Tirunelveli",
        "adminName3": "Tirunelveli",
        "postalcode": "627357",
        "adminCode1": "25",
        "countryCode": "IN",
        "lng": 77.38515755863037,
        "placeName": "Naranammalpuram",
        "lat": 9.042148763528974,
        "adminName1": "Tamil Nadu"
      }, {
        "adminName2": "Tirunelveli",
        "adminName3": "Tirunelveli",
        "postalcode": "627357",
        "adminCode1": "25",
        "countryCode": "IN",
        "lng": 77.38515755863037,
        "placeName": "Pallaikottai",
        "lat": 9.042148763528974,
        "adminName1": "Tamil Nadu"
      }, {
        "adminName2": "Tirunelveli",
        "adminName3": "Tirunelveli",
        "postalcode": "627357",
        "adminCode1": "25",
        "countryCode": "IN",
        "lng": 77.38515755863037,
        "placeName": "Sankarnagar",
        "lat": 9.042148763528974,
        "adminName1": "Tamil Nadu"
      }, {
        "adminName2": "Tirunelveli",
        "adminName3": "Tirunelveli",
        "postalcode": "627357",
        "adminCode1": "25",
        "countryCode": "IN",
        "lng": 77.38515755863037,
        "placeName": "Tenkulam",
        "lat": 9.042148763528974,
        "adminName1": "Tamil Nadu"
      }]
    }