ol/geom/LineString#containsXY

This commit is contained in:
timkeane
2018-10-25 18:53:33 -04:00
committed by Frederic Junod
parent 58b474225c
commit c1963ba369
2 changed files with 43 additions and 0 deletions

View File

@@ -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
*/