* @zh 查找包含点的多边形 * @en Find polygon containing point
(x: number, y: number)
| 263 | * @en Find polygon containing point |
| 264 | */ |
| 265 | findPolygonAt(x: number, y: number): INavPolygon | null { |
| 266 | for (const polygon of this.polygons.values()) { |
| 267 | if (this.isPointInPolygon(x, y, polygon.vertices)) { |
| 268 | return polygon; |
| 269 | } |
| 270 | } |
| 271 | return null; |
| 272 | } |
| 273 | |
| 274 | /** |
| 275 | * @zh 检查点是否在多边形内 |
no test coverage detected