我一直在搜索并尝试使用多边形示例中的选择点示例,但是我并未绘制新的多边形,而是在地图中已经存在一个多边形以用作选择边界。我在地图上也有很多点,但是由于缩放比例,有些点不可见或可能隐藏了,因此即使它们位于选择多边形中,我也希望忽略所有这些点。这可能吗?
// searchArea is populated by click method
function searchPolygon(searchArea) {
var visiblePointsonly = ???;
var poly = searchArea.toJson(); // This is failing saying toJson not a function?
// Calculate all points that are within the polygon area.
var ptsWithin = turf.pointsWithinPolygon(visiblePointsonly,poly);
return ptsWithin;
}
TIA! 里克...