2012-04-04 56 views
1

这是what我做:如何使用Google Maps V3从lat/lng获取城市?

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],它的参数,因为事实上它可能是为每个请求的不同来prefeer。参数如何得到城市? (或位置,或国家,等等......)。

+0

你有没有得到这个工作,我很好奇,想知道解决的办法是什么? – huzzah 2012-06-12 17:29:34

回答

3

不知道如果我读的API权(Geocoding API doc),但它看起来像它可能是“类型:地方”

+0

您是否曾经解决过这个问题?我很想知道如果您确实如此。 – huzzah 2012-04-25 15:28:00

相关问题