ol/geom/LineString#containsXY
This commit is contained in:
@@ -88,6 +88,16 @@ class LineString extends SimpleGeometry {
|
||||
return new LineString(this.flatCoordinates.slice(), this.layout);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
containsXY(x, y) {
|
||||
const coord = this.getClosestPoint([x, y]);
|
||||
return coord[0] === x && coord[1] === y;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user