在 google maps geocoder api 的第 2 版中,有一个方法 geocoder.getLocations 提供了很多有关请求地址的信息,例如:国家、街道、邮政编码、纬度、lng 等......
似乎该方法在 v3 中消失了,我们需要迭代 address_component
当我尝试这样做时,运行此程序时出现错误“未定义 j”
$.each(results[0].address_component, function (index, value) {
alert(index + ': ' + value);
});
http://maps.googleapis.com/maps/api/geocode/xml?address=75001,france&sensor=false
我如何迭代 adress_component 或更好的是如何到达 adress_component->输入国家/地区->短名称
谢谢