Google Place Api-在多个位置

Google Place Api-在多个位置

问题描述:

我正在使用Google Place api在iphone中显示位置。我正在使用ClLocation管理器类来获取将作为api参数传递的设备的当前位置。Google Place Api-在多个位置

但它不会每次都在多个设备的不同位置工作。

任何帮助?

+0

得到了解决方案? – 2012-03-28 06:22:21

检查了这一点

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

可以 其正常的网络服务,post请求,并得到一个XML/JSON列表

的地方搜索请求是HTTP以下URL为

https://maps.googleapis.com/maps/api/place/search/output?parameters

e.g

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

获取JSON输出

{ 
    "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" 
} 

获取XML这样

<?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> 
+0

嗨,感谢您的回应,但我使用的是谷歌的地方api以及上面提到的相同的东西,但问题是它没有得到任何数据,如果位置变化......即使在某些设备上,它工作正常,但在其他它不会当我们在不同的地点进行测试。 – user1192828 2012-03-13 10:23:33

+0

不知道...如果你有解决方案,请告诉我 – 2012-03-14 06:57:37