2010-05-19 4 views
4

나는 구글 API와 아이폰 LBS 관련 애플 리케이션에 새로운입니다. 나는 Google API를 사용하고 내 GPS 위치 주변의 호텔 목록을 얻는 방법을 알아야합니다.어떻게 내 자리 주위에 호텔을 쿼리 아이폰에 구글 API를 사용

동일한 기능이 자바 스크립트를 통해 구현됩니다. 어떻게 아이폰 응용 프로그램 에서이 작업을 수행 할 수 있습니까?

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

답변

9

당신은 시도해 봤어 - 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": [ ] 
}