Named exports from ol/array module
This commit is contained in:
committed by
Frederic Junod
parent
767f61ba78
commit
02002082bf
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user