“ID”和“place_ID”字符串有什么区别?
这两个ID是世界上任何一个城市都独一无二的吗?
Google地方是否会为世界上的每个城市分配ID?
例如,Somers,NY,USA的身份是否与Somers,纽约,美国相同?
有一个简单的方法来获得一个城市的身份z? (从谷歌地图网址或东西?)
以下是来自Somers NY USA的自动完成API调用的JsON响应:
{ "HTML_attributions" : [],"result" : { "address_components" : [ { "long_name" : "Somers","short_name" : "Somers","types" : [ "administrative_area_level_3","political" ] },{ "long_name" : "Westchester County","short_name" : "Westchester County","types" : [ "administrative_area_level_2",{ "long_name" : "New York","short_name" : "NY","types" : [ "administrative_area_level_1",{ "long_name" : "United States","short_name" : "US","types" : [ "country","political" ] } ],"adr_address" : "Somers,NY,USA","formatted_address" : "Somers,USA","geometry" : { "location" : { "lat" : 41.29963050000001,"lng" : -73.7360175 },"vIEwport" : { "northeast" : { "lat" : 41.3550988,"lng" : -73.65881709999999 },"southwest" : { "lat" : 41.2379047,"lng" : -73.78000709999999 } } },"icon" : "http://maps.gstatic.com/mapfiles/place_API/icons/geocode-71.png","ID" : "8e846f7cdf419380d138e6d605137e739075b777","name" : "Somers","place_ID" : "ChIJ6wv7yGixwokRIwjh6OWI4I0","reference" : "CoQBcgAAAKxvwwjlyK3ZaVA5dam52DU8tMMplyvamYxXVJuMydplQ3SUs-9ONvZgIN4sDW_sUz9z7wdobCmPcgWHY9Oi_l0hImvMtie8s6TKaUCDju2vzlcSEGXtDW0bvixVbbuF35AP2stRw80YjcrnwuMDglKEHKUVdH8vzSVG91WNOcOcEhBda300E-VstT6ZQ1zCx30eGhQBUGcFLuUeB484h1AzDW75Aw5wxA","scope" : "Google","political" ],"url" : "https://maps.Google.com/maps/place?q=Somers,+NY,+USA&ftID=0x89c2b168c8fb0beb:0x8de088e5e8e10823" },"status" : "OK"}解决方法 “ID”和“reference”已被弃用,将于2015年中期从结果中删除.从某种意义上说,它们不是“独特的”,你可以从那些信息中找到它.
PlaceID与众不同 – 它既是独特的位置,也是位置通常只有一个PlaceID. (在大多数情况下都是如此.但是,“地点”可以包含引用不同范围的其他ID(Google范围与用户范围),或者企业是否已移至不同的地方,为其提供新的place_ID.但在所有情况下,place_ID仍然是持久的.)此外,您使用PlaceID访问Details API.
请参阅此处的弃用通知:https://developers.google.com/places/documentation/search
总结Note: The ID and reference fIElds are deprecated as of June 24,2014. They are replaced by the new place ID,a unique IDentifIEr that can be used to compare places and to retrIEve information about a place. The Places API currently returns a place_ID in all responses,and accepts a placeID in the Place Details and Place Delete requests. Soon after June 24,2015,the API will stop returning the ID and reference fIElds in responses. Some time later,the API will no longer accept the reference in requests. We recommend that you update your code to use the new place ID instead of ID and reference as soon as possible.
以上是内存溢出为你收集整理的android – Google Places API:“place_id”或“id”对于世界上任何一个城市都是唯一的吗?全部内容,希望文章能够帮你解决android – Google Places API:“place_id”或“id”对于世界上任何一个城市都是唯一的吗?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)