Autofix indentation issues (eslint --fix)

This commit is contained in:
Marc Jansen
2017-06-19 11:58:00 +02:00
parent a17db4f45c
commit d0ef05977b
196 changed files with 1574 additions and 1574 deletions
+28 -28
View File
@@ -10,28 +10,28 @@ goog.require('ol.math');
*/
ol.ResolutionConstraint.createSnapToResolutions = function(resolutions) {
return (
/**
/**
* @param {number|undefined} resolution Resolution.
* @param {number} delta Delta.
* @param {number} direction Direction.
* @return {number|undefined} Resolution.
*/
function(resolution, delta, direction) {
if (resolution !== undefined) {
var z =
function(resolution, delta, direction) {
if (resolution !== undefined) {
var z =
ol.array.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) {
var power = resolutions[index] / resolutions[index + 1];
return resolutions[index] / Math.pow(power, z - index);
} else {
return resolutions[index];
}
z = ol.math.clamp(z + delta, 0, resolutions.length - 1);
var index = Math.floor(z);
if (z != index && index < resolutions.length - 1) {
var power = resolutions[index] / resolutions[index + 1];
return resolutions[index] / Math.pow(power, z - index);
} else {
return undefined;
return resolutions[index];
}
});
} else {
return undefined;
}
});
};
@@ -43,24 +43,24 @@ ol.ResolutionConstraint.createSnapToResolutions = function(resolutions) {
*/
ol.ResolutionConstraint.createSnapToPower = function(power, maxResolution, opt_maxLevel) {
return (
/**
/**
* @param {number|undefined} resolution Resolution.
* @param {number} delta Delta.
* @param {number} direction Direction.
* @return {number|undefined} Resolution.
*/
function(resolution, delta, direction) {
if (resolution !== undefined) {
var offset = -direction / 2 + 0.5;
var oldLevel = Math.floor(
Math.log(maxResolution / resolution) / Math.log(power) + offset);
var newLevel = Math.max(oldLevel + delta, 0);
if (opt_maxLevel !== undefined) {
newLevel = Math.min(newLevel, opt_maxLevel);
}
return maxResolution / Math.pow(power, newLevel);
} else {
return undefined;
function(resolution, delta, direction) {
if (resolution !== undefined) {
var offset = -direction / 2 + 0.5;
var oldLevel = Math.floor(
Math.log(maxResolution / resolution) / Math.log(power) + offset);
var newLevel = Math.max(oldLevel + delta, 0);
if (opt_maxLevel !== undefined) {
newLevel = Math.min(newLevel, opt_maxLevel);
}
});
return maxResolution / Math.pow(power, newLevel);
} else {
return undefined;
}
});
};