Rename ol.geom.Geometry#containsCoordinate to intersectsCoordinate

This commit is contained in:
Frederic Junod
2016-08-23 14:36:09 +02:00
parent 985dda28eb
commit 9074bd9783
5 changed files with 32 additions and 30 deletions

View File

@@ -149,7 +149,7 @@ ol.geom.Circle.prototype.intersectsExtent = function(extent) {
return true;
}
return ol.extent.forEachCorner(extent, this.containsCoordinate, this);
return ol.extent.forEachCorner(extent, this.intersectsCoordinate, this);
}
return false;

View File

@@ -129,10 +129,12 @@ ol.geom.Geometry.prototype.getClosestPoint = function(point, opt_closestPoint) {
/**
* Returns true if this geometry includes the specified coordinate. If the
* coordinate is on the boundary of the geometry, returns false.
* @param {ol.Coordinate} coordinate Coordinate.
* @return {boolean} Contains coordinate.
*/
ol.geom.Geometry.prototype.containsCoordinate = function(coordinate) {
ol.geom.Geometry.prototype.intersectsCoordinate = function(coordinate) {
return this.containsXY(coordinate[0], coordinate[1]);
};

View File

@@ -452,7 +452,7 @@ ol.source.Vector.prototype.forEachFeatureAtCoordinateDirect = function(coordinat
return this.forEachFeatureInExtent(extent, function(feature) {
var geometry = feature.getGeometry();
goog.DEBUG && console.assert(geometry, 'feature geometry is defined and not null');
if (geometry.containsCoordinate(coordinate)) {
if (geometry.intersectsCoordinate(coordinate)) {
return callback.call(opt_this, feature);
} else {
return undefined;