2012-03-13 11 views
0

私はGoogleプレイスAPIを使用してiphoneに位置情報を表示しています。私は、APIのパラメータとして渡されるデバイスの現在の位置を取得するために、ClLocationマネージャクラスを使用しています。Google Place Api-複数の場所

ただし、複数のデバイスの別々の場所で毎回機能しません。

任意のヘルプ??

+0

解決策がありますか? –

答えて

0
このうち

http://code.google.com/apis/maps/documentation/places/#PlaceSearches

あなたは、そのに通常のWebサービスを リクエストを投稿し、XML/JSONのリストを取得することができます

Aプレイス検索リクエストがHTTPである

チェック

のURLは、

です。

例えば

https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AddYourOwnKeyHere

この

<?xml version="1.0" encoding="UTF-8"?> 
<PlaceSearchResponse> 
<status>OK</status> 
<result> 
    <name>Zaaffran Restaurant - BBQ and GRILL, Darling Harbour</name> 
    <vicinity>Harbourside Centre 10 Darling Drive, Darling Harbour, Sydney</vicinity> 
    <type>restaurant</type> 
    <type>food</type> 
    <type>establishment</type> 
    <geometry> 
    <location> 
    <lat>-33.8719830</lat> 
    <lng>151.1990860</lng> 
    </location> 
    </geometry> 
    <rating>3.9</rating> 
    <icon>http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png</icon> 
    <reference>CpQBjAAAAJd_vFgeIo6ogU2gDLEe85XpxRi8LwIQXSVcPS5dxGIytvbNWic7gTlGIleeFRbrP-Rs4_V6AmCcF1RtaUXcb26_Oai6k6n34Ag17Cle3pnVl740CyNpp0VT48lOf7XkMngj75wKHqnApPZ9Bfcn0myuYeEZoKXw7c3pneO4Ty8FTxDqQyLiJk8CAkodTzSn5BIQj0ovOoMS5u-ds6_jygEGxRoUbKMNq2DBZdiS16jO3yku2DOBwNI</reference> 
    <id>677679492a58049a7eae079e0890897eb953d79b</id> 
</result> 
<result> 
    <name>Criniti's Darling Harbour</name> 
    <vicinity>Shop 461, 2-10 Darling Drive, Harbourside Shopping Centre, DARLING HARBOUR</vicinity> 
    <type>restaurant</type> 
    <type>food</type> 
    <type>establishment</type> 
    <geometry> 
    <location> 
    <lat>-33.8722580</lat> 
    <lng>151.1986550</lng> 
    </location> 
    </geometry> 
    <rating>3.6</rating> 
    <icon>http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png</icon> 
    <reference>CnRwAAAAwE_vlF04Iix2hijlKQsJLhpvAj8hwpfXGxtc0ckpBe0d54-rk4dxn8d1ZbaPGxxYfytkf4WJ7l5UC4Zh8jFZg0MTu1S8d66BK4vb2ktpAsKkfb28i3Mrf77ORRPXXjWwRtA7PEEfMP07mjfX3Xdg-RIQwjSMECQHM5S9WAohBIVB0BoUAb4i1DW-fL9E6XbgiDnmyZKrzRE</reference> 
    <id>27ea39c8fed1c0437069066b8dccf958a2d06f19</id> 
</result> 
...additional results... 
<html_attribution>Listings by &lt;a href="http://www.yellowpages.com.au/"&gt;Yellow Pages&lt;/a&gt;</html_attribution> 
</PlaceSearchResponse> 
のようなXMLを取得

{ 
    "html_attributions" : [ 
    "Listings by \u003ca href=\"http://www.yellowpages.com.au/\"\u003eYellow Pages\u003c/a\u003e" 
    ], 
    "results" : [ 
    { 
     "geometry" : { 
     "location" : { 
      "lat" : -33.8719830, 
      "lng" : 151.1990860 
     } 
     }, 
     "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png", 
     "id" : "677679492a58049a7eae079e0890897eb953d79b", 
     "name" : "Zaaffran Restaurant - BBQ and GRILL, Darling Harbour", 
     "rating" : 3.90, 
     "reference" : "CpQBjAAAAHDHuimUQATR6gfoWNmZlk5dKUKq_n46BpSzPQCjk1m9glTKkiAHH_Gs4xGttdOSj35WJJDAV90dAPnNnZK2OaxMgogdeHKQhIedh6UduFrW53wtwXigUfpAzsCgIzYNI0UQtCj38cr_DE56RH4Wi9d2bWbbIuRyDX6tx2Fmk2EQzO_lVJ-oq4ZY5uI6I75RnxIQJ6smWUVVIHup9Jvc517DKhoUidfNPyQZZIgGiXS_SwGQ1wg0gtc", 
     "types" : [ "restaurant", "food", "establishment" ], 
     "vicinity" : "Harbourside Centre 10 Darling Drive, Darling Harbour, Sydney" 
    }, 
    { 
     "geometry" : { 
     "location" : { 
      "lat" : -33.8722580, 
      "lng" : 151.1986550 
     } 
     }, 
     "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png", 
     "id" : "27ea39c8fed1c0437069066b8dccf958a2d06f19", 
     "name" : "Criniti's Darling Harbour", 
     "rating" : 3.60, 
     "reference" : "CnRwAAAA-5kh5WZ3m1CMTO3LslvhRtAYsrOcQP7wB9AE1bV5R6Bd46NN5wB16MtImXWQ9eS1nWVbV_j-8iXYXRpU13Efp1t_d-Dp4WfEsFcYj-_g6db1SC1vAukyeCyotjS5xrwhzqWWAhgmA4qIliWeev2u1BIQprWzxl_hkj_w3QdTiUBYKxoUDVTjF4RugJdaJWkC4n6w6pSajKw", 
     "types" : [ "restaurant", "food", "establishment" ], 
     "vicinity" : "Shop 461, 2-10 Darling Drive, Harbourside Shopping Centre, DARLING HARBOUR" 
    }, 
    ...additional results... 
    ], 
    "status" : "OK" 
} 

としてJSON出力を取得します。

+0

こんにちは、応答ありがとうが、私はGoogleの場所のapiだけでなく、上記の問題を言及されているものと同じものを使用している場合は、場所の変更は、任意のデータを取得していない...でも、それ以外の場所でテストしたときはそれ以外のものはありません。 – user1192828

+0

いいえ...解決策があれば教えてください –

関連する問題