Tag: 街道地址的

从地理编码结果中获取城市?

从Geocoder结果中获取不同的数组内容时遇到问题。 item.formatted_address工程,但不是item.address_components.locality? geocoder.geocode( {'address': request.term }, function(results, status) { response($.map(results, function(item) { alert(item.formatted_address+" "+item.address_components.locality) } }); //返回的数组是 "results" : [ { "address_components" : [ { "long_name" : "London", "short_name" : "London", "types" : [ "locality", "political" ] } ], "formatted_address" : "Westminster, London, UK" // rest of array… 任何帮助赞赏! DC