【问题标题】:how use google api in iphone to query hotels around my place如何在 iphone 中使用 google api 查询我家附近的酒店
【发布时间】:2011-02-21 07:44:46
【问题描述】:

我是 google apis 和 iphone LBS 相关应用程序的新手。我需要知道如何使用 google api 并获取我的 GPS 位置附近的酒店列表。

这里同样的功能是通过 javascript 实现的。如何在 iphone 应用程序上执行此操作?

http://code.google.com/apis/ajax/playground/#localsearch_with_markers

【问题讨论】:

    标签: iphone iphone-sdk-3.0 google-maps


    【解决方案1】:

    您尝试了吗 - http://code.google.com/apis/maps/documentation/places/#PlaceSearches

    它看起来像一个普通的网络服务,你可以只发布一个请求,它应该会给你一个 XML / JSON 列表你周围的所有酒店..

    来自网站 -

    请求 = http://maps.google.com/maps/api/place/search/json?location=40.717859,-73.957790&radius=1600&client=clientId&sensor=true_or_false&signature=SIGNATURE

    响应 =

    {
      "status": "OK",
      "results": [ {
        "name": "Williamsburg",
        "types": [ "locality", "political" ],
        "icon": "http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png",
        "reference": "ClRBAAAAXP...lHAPyHom2aG"
      }, {
        "name": "Greenpoint",
        "vicinity": "New York",
        "types": [ "neighborhood", "political" ],
        "icon": "http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png",
        "reference": "CkQ_AAAAhd...MF45fwr44Ek"
      }, {
        "name": "Peter Luger Steakhouse",
        "vicinity": "Broadway, Brooklyn",
        "types": [ "restaurant", "food", "establishment" ],
        "icon": "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
        "reference": "ClRCAAAAt3...6Nt7k11iQdT"
      }, {
        "name": "Music Hall of Williamsburg",
        "vicinity": "North 6th Street, Brooklyn",
        "types": [ "establishment" ],
        "icon": "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
        "reference": "ClRFAAAAN...6UOKCbjv7Sxy"
      },
      ...additional results ...  
      ],
       "html_attributions": [ ]
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-09
      • 1970-01-01
      • 2016-06-25
      • 1970-01-01
      • 2023-03-30
      • 2016-07-14
      • 2016-12-06
      • 1970-01-01
      相关资源
      最近更新 更多