Add ol.geom.MultiPolygon#containsCoordinate
This commit is contained in:
@@ -26,6 +26,26 @@ ol.geom.MultiPolygon = function(coordinates, opt_layout) {
|
|||||||
goog.inherits(ol.geom.MultiPolygon, ol.geom.Geometry);
|
goog.inherits(ol.geom.MultiPolygon, ol.geom.Geometry);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ol.Coordinate} coordinate Coordinate.
|
||||||
|
* @return {boolean} Contains coordinate.
|
||||||
|
*/
|
||||||
|
ol.geom.MultiPolygon.prototype.containsCoordinate = function(coordinate) {
|
||||||
|
return this.containsXY(coordinate[0], coordinate[1]);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {number} x X.
|
||||||
|
* @param {number} y Y.
|
||||||
|
* @return {boolean} Contains (x, y).
|
||||||
|
*/
|
||||||
|
ol.geom.MultiPolygon.prototype.containsXY = function(x, y) {
|
||||||
|
return ol.geom.flatLinearRingssContainsXY(
|
||||||
|
this.flatCoordinates, 0, this.endss_, this.stride, x, y);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {ol.geom.RawMultiPolygon} Coordinates.
|
* @return {ol.geom.RawMultiPolygon} Coordinates.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user