我基于地理位置坐标在开放层地图上绘制了一些点,现在我将在地图上绘制矩形,现在我需要在矩形内得到所有坐标
https://openlayers.org/en/latest/examples/draw-shapes.html
我需要在矩形内绘制我的绘制位置
一种方法是处理ol.interaction.Draw的DRAWEND事件并使用vector.getSource().getFeatures()
检索所有功能。迭代这些特征可以为您提供点几何和矩形几何。使用rectangleGeometry.intersectsCoordinate(pointCoordinate),您可以检查该点是否在矩形内。