Linting and fixes for unit tests

This commit is contained in:
Olivier Guyot
2019-01-15 17:45:21 +01:00
parent ef6d17d817
commit 433bccd207
14 changed files with 36 additions and 45 deletions
+2 -2
View File
@@ -2,8 +2,8 @@
* @module ol/resolutionconstraint
*/
import {linearFindNearest} from './array.js';
import {clamp} from './math.js';
import {getHeight, getWidth} from './extent';
import {clamp} from './math';
/**
@@ -123,7 +123,7 @@ export function createSnapToPower(power, maxResolution, opt_minResolution, opt_s
const capped = Math.min(cappedMaxRes, resolution);
const zoomLevel = Math.floor(
Math.log(maxResolution / capped) / Math.log(power) + offset);
let newResolution = maxResolution / Math.pow(power, zoomLevel);
const newResolution = maxResolution / Math.pow(power, zoomLevel);
return clamp(newResolution, minResolution, cappedMaxRes);
} else {
return undefined;