thn*_*iss 4 iphone google-maps iphone-sdk-3.0
我是谷歌apis和iphone LBS相关应用程序的新手.我需要知道如何使用谷歌api并获取我的GPS位置周围的酒店列表.
这里通过javascript实现相同的功能.如何在iPhone应用程序上执行此操作?
http://code.google.com/apis/ajax/playground/#localsearch_with_markers
你有没有尝试过 - http://code.google.com/apis/maps/documentation/places/#PlaceSearches?
它看起来像一个普通的web服务,你可以发一个请求,它应该给你一个包含你周围所有酒店的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": [ ]
}
Run Code Online (Sandbox Code Playgroud)