谷歌地图api& tparkin point-in-poly

时间:2011-11-02 07:49:21

标签: javascript html google-maps-api-3

我已经在这个网站上工作了大约一个星期了。它并不好,但我再也不是网页设计的好。任何有关改进的提示都将不胜感激。

继续前进我遇到了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.

1 个答案:

答案 0 :(得分: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,而是传递它只是位置。这是一个简单的例子,我没有完全理解我在做什么。感谢所有关注此事的人,对不起,我浪费了你的时间。

- 扎克