2011-11-02 105 views
0

我一直在這個網站上工作了大約一個星期。它不是很棒,但是我又不是很棒的網頁設計。任何改進提示將不勝感激。Google map api&tparkin point-in-poly

繼續我在tparkin爲Google Maps api寫的多邊形擴展中的點存在問題。我已經通過閱讀我的其他職位,一切閱讀,但我可以找出爲什麼我不斷收到這個錯誤...

a.lat is not a function 
    [Break On This Error] Ba(I,function(a){return!a?k:this.Z[xb]...{return new Q(this.Z.d,this.aa.d,i)}; 

我想可能使用tparkins擴展的功能錯誤與我同一個問題,但就像我說的我無法弄清楚它。

任何幫助提前非常感謝。

這是帶腳本問題的網站。如果您需要任何其他信息,請告訴我。 my website.

+0

無法重現。我沒有在Google Chrome上看到這個錯誤。 – hsz

回答

0

我想通了我遇到的問題。一探究竟。

function codeAddress() { 
var address = document.getElementById("address").value; 
geocoder.geocode({ 'address': address}, function(results, status) { 
    if (status == google.maps.GeocoderStatus.OK) { 
    map.setCenter(results[0].geometry.location); 
    var marker = new google.maps.Marker({ 
    map: map, 
    position: results[0].geometry.location 
    }); 
    var isWithinPolygon = polygon85.containsLatLng(results[0].geometry.location); 
    alert(isWithinPolygon); 
    } 
    else { 
    alert("Geocode was not successful for the following reason: " + status); 
    } 
}); 

}

所以問題之前,是不是經過座標結果[0] .geometry.location,我經過它只是位置。這是一個簡單的例子,我沒有完全理解我在做什麼。謝謝大家看了看這個,對不起我浪費了你的時間。

--Zac

+0

感謝您分享您的解決方案 - 您應該將其標記爲正確(單擊複選框),這將關閉該問題。 – nrabinowitz