2010-05-21 28 views

回答

1

getLocations()返回一個包含數組的響應。走陣列,直到找到具有所需細節級別的地標。例如,假設getLocations()的回調函數具有響應參數,請使用以下代碼:

for (var i=0; i<response.Placemark.length; i++) { 
    if (response.Placemark[i].AddressDetails.Accuracy < 4) { 
    alert(response.Placemark[i].address); 
    break; 
    } 
} 
相關問題