Check closest point against extent
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
goog.provide('ol.geom.Polygon');
|
||||
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.geom.Geometry');
|
||||
goog.require('ol.geom.LinearRing');
|
||||
goog.require('ol.geom.closest');
|
||||
@@ -59,6 +60,10 @@ goog.inherits(ol.geom.Polygon, ol.geom.Geometry);
|
||||
*/
|
||||
ol.geom.Polygon.prototype.closestPointXY =
|
||||
function(x, y, closestPoint, minSquaredDistance) {
|
||||
if (minSquaredDistance <
|
||||
ol.extent.closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
||||
return minSquaredDistance;
|
||||
}
|
||||
if (this.maxDeltaRevision_ != this.revision) {
|
||||
this.maxDelta_ = Math.sqrt(ol.geom.closest.getsMaxSquaredDelta(
|
||||
this.flatCoordinates, 0, this.ends_, this.stride, 0));
|
||||
|
||||
Reference in New Issue
Block a user