Factor out ol.geom.flat.closest

This commit is contained in:
Tom Payne
2014-03-12 11:17:39 +01:00
parent b565092d62
commit 2b6845244c
8 changed files with 96 additions and 95 deletions

View File

@@ -5,8 +5,8 @@ goog.require('goog.asserts');
goog.require('ol.extent');
goog.require('ol.geom.GeometryType');
goog.require('ol.geom.SimpleGeometry');
goog.require('ol.geom.closest');
goog.require('ol.geom.flat');
goog.require('ol.geom.flat.closest');
goog.require('ol.geom.simplify');
@@ -86,11 +86,11 @@ ol.geom.LineString.prototype.closestPointXY =
return minSquaredDistance;
}
if (this.maxDeltaRevision_ != this.getRevision()) {
this.maxDelta_ = Math.sqrt(ol.geom.closest.getMaxSquaredDelta(
this.maxDelta_ = Math.sqrt(ol.geom.flat.closest.getMaxSquaredDelta(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0));
this.maxDeltaRevision_ = this.getRevision();
}
return ol.geom.closest.getClosestPoint(
return ol.geom.flat.closest.getClosestPoint(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride,
this.maxDelta_, false, x, y, closestPoint, minSquaredDistance);
};