2011-11-02 103 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