【发布时间】:2012-04-04 14:55:54
【问题描述】:
这是what 我已经完成了:
var geocoder = new google.maps.Geocoder();
var location = new google.maps.LatLng(45.930976,10.639744);
geocoder.geocode({ 'latLng': location }, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
alert(results[1].address_components[0].long_name);
}
});
但我不想使用 address_components[i] 哪个参数,因为每个请求可能会有所不同。获取城市的参数如何? (或位置,或国家,等等......)。
【问题讨论】:
-
你有没有得到这个工作?我很想知道解决方案是什么。
标签: google-maps google-maps-api-3 geolocation