[英]Google Maps API v3 - changed in the last week or so?
我正在使用以下代碼從用戶輸入獲取lat和lng值。 直到最近,它似乎都運行良好。
if (status == google.maps.GeocoderStatus.OK) {
var lat = parseFloat(results[0].geometry.location.wa).toFixed(3);
var lng = parseFloat(results[0].geometry.location.xa).toFixed(3);
....
現在,如果我console.log results[0].geometry.location
我得到(51.4793388, -2.5933342) { va=51.4793388, wa=-2.5933342}
。
似乎xa
已更改為va
。 引用這些值的正確方法是什么?
最近,我在Google Map API 3.0應用程序中遇到了同樣的問題。 基本上,如果我沒記錯的話,wa和xa變量只是LatLng()變量。 所以您可以這樣稱呼他們:
results[0].geometry.location.lat().toFixed(3);
results[0].geometry.location.lng().toFixed(3);
其中va = lat和wa = lng
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.