Move containsCoordinate to ol.geom.Geometry
This commit is contained in:
@@ -5,6 +5,7 @@ goog.provide('ol.geom.Geometry');
|
|||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.events.EventTarget');
|
goog.require('goog.events.EventTarget');
|
||||||
goog.require('goog.events.EventType');
|
goog.require('goog.events.EventType');
|
||||||
|
goog.require('goog.functions');
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
|
|
||||||
|
|
||||||
@@ -81,6 +82,23 @@ ol.geom.Geometry = function() {
|
|||||||
goog.inherits(ol.geom.Geometry, goog.events.EventTarget);
|
goog.inherits(ol.geom.Geometry, goog.events.EventTarget);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ol.Coordinate} coordinate Coordinate.
|
||||||
|
* @return {boolean} Contains coordinate.
|
||||||
|
*/
|
||||||
|
ol.geom.Geometry.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.Geometry.prototype.containsXY = goog.functions.FALSE;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FIXME empty description for jsdoc
|
* FIXME empty description for jsdoc
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -27,18 +27,7 @@ goog.inherits(ol.geom.MultiPolygon, ol.geom.Geometry);
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Coordinate} coordinate Coordinate.
|
* @inheritDoc
|
||||||
* @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) {
|
ol.geom.MultiPolygon.prototype.containsXY = function(x, y) {
|
||||||
return ol.geom.flatLinearRingssContainsXY(
|
return ol.geom.flatLinearRingssContainsXY(
|
||||||
|
|||||||
+1
-12
@@ -27,18 +27,7 @@ goog.inherits(ol.geom.Polygon, ol.geom.Geometry);
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Coordinate} coordinate Coordinate.
|
* @inheritDoc
|
||||||
* @return {boolean} Contains coordinate.
|
|
||||||
*/
|
|
||||||
ol.geom.Polygon.prototype.containsCoordinate = function(coordinate) {
|
|
||||||
return this.containsXY(coordinate[0], coordinate[1]);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {number} x X.
|
|
||||||
* @param {number} y Y.
|
|
||||||
* @return {boolean} Contains.
|
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.containsXY = function(x, y) {
|
ol.geom.Polygon.prototype.containsXY = function(x, y) {
|
||||||
return ol.geom.flatLinearRingsContainsXY(
|
return ol.geom.flatLinearRingsContainsXY(
|
||||||
|
|||||||
Reference in New Issue
Block a user