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

View File

@@ -1,7 +1,7 @@
/**
* @module ol/ResolutionConstraint
*/
import _ol_array_ from './array.js';
import {linearFindNearest} from './array.js';
import _ol_math_ from './math.js';
var _ol_ResolutionConstraint_ = {};
@@ -20,8 +20,7 @@ _ol_ResolutionConstraint_.createSnapToResolutions = function(resolutions) {
*/
function(resolution, delta, direction) {
if (resolution !== undefined) {
var z =
_ol_array_.linearFindNearest(resolutions, resolution, direction);
var z = linearFindNearest(resolutions, resolution, direction);
z = _ol_math_.clamp(z + delta, 0, resolutions.length - 1);
var index = Math.floor(z);
if (z != index && index < resolutions.length - 1) {