此处地图:我最初使用此代码获取类别搜索的地址,但现在地址似乎已被删除并替换为HTML中的邻近属性。这是正确的,有没有办法获得这种程度的细节?
if (locations[i].address.house != undefined) {
catResults2 = catResults2 + locations[i].address.house + " "
}
if (locations[i].address.street != undefined) {
catResults2 = catResults2 + locations[i].address.street
}
if (locations[i].address.district != undefined) {
catResults2 = catResults2 + ", " + locations[i].address.district
}
if (locations[i].address.city != undefined) {
catResults2 = catResults2 + ", " + locations[i].address.city
}
if (locations[i].address.state != undefined) {
catResults2 = catResults2 + ", " + locations[i].address.state
}
if (locations[i].address.postalCode != undefined) {
catResults2 = catResults2 + " " + locations[i].address.postalCode
}
if (locations[i].address.country != undefined) {
catResults2 = catResults2 + ", " + locations[i].address.country
}
if (locations[i].address.countryCode != undefined) {
catResults2 = catResults2 + " " + locations[i].address.countryCode
};
答案 0 :(得分:0)
如果您使用HERE Maps API for JavaScript(如本例here)对地点的地址进行反向地理编码,则可以使用
获取正确的本地化地址locations[i].address.text