1
這是我的JS代碼來獲取地址的lon和lat。GoogleMaps geocoder錯誤:ZERO_RESULTS
在它的工作原理確定99%的時間......但有時我得到ZERO_RESULTS狀態...
if (geocoder) {
geocoder.geocode({'address': address, 'language':'it'}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
$('#frm_company_lat').val(results[0].geometry.location.lat());
$('#frm_company_lon').val(results[0].geometry.location.lng());
can_submit = true;
$('#company_frm').trigger("submit");
} else{
top.console.debug(address);
top.console.debug(status);
alert("Cannot get lon in lat: "+ address);
//can_submit = true;
//$('#company_frm').trigger("submit");
}
});
}
的地址是沒有什麼特別的,如果我看它在谷歌直接映射,它顯示...
如果我嘗試直接獲取JSON(通過直接url),我會得到相同的結果!
請告知