这是我的代码:
var posmark = markerarr["535413"].getPosition();
console.log(posmark);
// **Console.log** ▲
Ya: 41.64272
Za: 41.65764999999999
//
var posshp = poli_arr.s1;
console.log(posshp);
// **Console.log** ▲
Zl: yo
__e3_: Object
__gm_id: 252
b: null
center: P
fillColor: "#FF0000"
fillOpacity: 0.35
gm_accessors_: Object
map: null
radius: 100
strokeColor: "#FF0000"
strokeOpacity: 0.8
strokeWeight: 2
__proto__: c
//
var res = google.maps.geometry.poly.containsLocation(posmark, posshp);
console.log(res);
//**Console.log** ▲
Uncaught TypeError: Cannot call method 'getLength' of undefined
//
问题在哪里?我无法修复它...我想检查标记是否存在于多边形区域中。如果有人知道将标记检查到 poligon 半径的更好方法,请重播我如何才能做得更好。谢谢