Merge pull request #8910 from fredj/containsXY

Implements containsXY for all geometries
This commit is contained in:
Frédéric Junod
2018-11-14 16:23:26 +01:00
committed by GitHub
5 changed files with 102 additions and 1 deletions

View File

@@ -92,7 +92,8 @@ class Geometry extends BaseObject {
* @return {boolean} Contains (x, y).
*/
containsXY(x, y) {
return false;
const coord = this.getClosestPoint([x, y]);
return coord[0] === x && coord[1] === y;
}
/**