Named exports from ol/array module

This commit is contained in:
Marc Jansen
2017-12-19 12:22:46 +01:00
committed by Frederic Junod
parent 767f61ba78
commit 02002082bf
47 changed files with 296 additions and 298 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
/**
* @module ol/geom/flat/interiorpoint
*/
import _ol_array_ from '../../array.js';
import {numberSafeCompareFunction} from '../../array.js';
import _ol_geom_flat_contains_ from '../flat/contains.js';
var _ol_geom_flat_interiorpoint_ = {};
@@ -45,7 +45,7 @@ _ol_geom_flat_interiorpoint_.linearRings = function(flatCoordinates, offset,
// inside the linear ring.
var pointX = NaN;
var maxSegmentLength = -Infinity;
intersections.sort(_ol_array_.numberSafeCompareFunction);
intersections.sort(numberSafeCompareFunction);
x1 = intersections[0];
for (i = 1, ii = intersections.length; i < ii; ++i) {
x2 = intersections[i];
+2 -2
View File
@@ -1,7 +1,7 @@
/**
* @module ol/geom/flat/interpolate
*/
import _ol_array_ from '../../array.js';
import {binarySearch} from '../../array.js';
import _ol_math_ from '../../math.js';
var _ol_geom_flat_interpolate_ = {};
@@ -42,7 +42,7 @@ _ol_geom_flat_interpolate_.lineString = function(flatCoordinates, offset, end, s
y1 = y2;
}
var target = fraction * length;
var index = _ol_array_.binarySearch(cumulativeLengths, target);
var index = binarySearch(cumulativeLengths, target);
if (index < 0) {
var t = (target - cumulativeLengths[-index - 2]) /
(cumulativeLengths[-index - 1] - cumulativeLengths[-index - 2]);