Autofix indentation issues (eslint --fix)
This commit is contained in:
+27
-27
@@ -125,7 +125,7 @@ ol.View.prototype.applyOptions_ = function(options) {
|
||||
*/
|
||||
var properties = {};
|
||||
properties[ol.ViewProperty.CENTER] = options.center !== undefined ?
|
||||
options.center : null;
|
||||
options.center : null;
|
||||
|
||||
var resolutionConstraintInfo = ol.View.createResolutionConstraint_(
|
||||
options);
|
||||
@@ -285,7 +285,7 @@ ol.View.prototype.animate = function(var_args) {
|
||||
if (options.zoom !== undefined) {
|
||||
animation.sourceResolution = resolution;
|
||||
animation.targetResolution = this.constrainResolution(
|
||||
this.maxResolution_, options.zoom - this.minZoom_, 0);
|
||||
this.maxResolution_, options.zoom - this.minZoom_, 0);
|
||||
resolution = animation.targetResolution;
|
||||
} else if (options.resolution) {
|
||||
animation.sourceResolution = resolution;
|
||||
@@ -385,8 +385,8 @@ ol.View.prototype.updateAnimations_ = function() {
|
||||
}
|
||||
if (animation.sourceResolution && animation.targetResolution) {
|
||||
var resolution = progress === 1 ?
|
||||
animation.targetResolution :
|
||||
animation.sourceResolution + progress * (animation.targetResolution - animation.sourceResolution);
|
||||
animation.targetResolution :
|
||||
animation.sourceResolution + progress * (animation.targetResolution - animation.sourceResolution);
|
||||
if (animation.anchor) {
|
||||
this.set(ol.ViewProperty.CENTER,
|
||||
this.calculateCenterZoom(resolution, animation.anchor));
|
||||
@@ -395,8 +395,8 @@ ol.View.prototype.updateAnimations_ = function() {
|
||||
}
|
||||
if (animation.sourceRotation !== undefined && animation.targetRotation !== undefined) {
|
||||
var rotation = progress === 1 ?
|
||||
animation.targetRotation :
|
||||
animation.sourceRotation + progress * (animation.targetRotation - animation.sourceRotation);
|
||||
animation.targetRotation :
|
||||
animation.sourceRotation + progress * (animation.targetRotation - animation.sourceRotation);
|
||||
if (animation.anchor) {
|
||||
this.set(ol.ViewProperty.CENTER,
|
||||
this.calculateCenterRotate(rotation, animation.anchor));
|
||||
@@ -526,7 +526,7 @@ ol.View.prototype.constrainRotation = function(rotation, opt_delta) {
|
||||
*/
|
||||
ol.View.prototype.getCenter = function() {
|
||||
return /** @type {ol.Coordinate|undefined} */ (
|
||||
this.get(ol.ViewProperty.CENTER));
|
||||
this.get(ol.ViewProperty.CENTER));
|
||||
};
|
||||
|
||||
|
||||
@@ -654,7 +654,7 @@ ol.View.prototype.getProjection = function() {
|
||||
*/
|
||||
ol.View.prototype.getResolution = function() {
|
||||
return /** @type {number|undefined} */ (
|
||||
this.get(ol.ViewProperty.RESOLUTION));
|
||||
this.get(ol.ViewProperty.RESOLUTION));
|
||||
};
|
||||
|
||||
|
||||
@@ -697,14 +697,14 @@ ol.View.prototype.getResolutionForValueFunction = function(opt_power) {
|
||||
var minResolution = this.minResolution_;
|
||||
var max = Math.log(maxResolution / minResolution) / Math.log(power);
|
||||
return (
|
||||
/**
|
||||
/**
|
||||
* @param {number} value Value.
|
||||
* @return {number} Resolution.
|
||||
*/
|
||||
function(value) {
|
||||
var resolution = maxResolution / Math.pow(power, value * max);
|
||||
return resolution;
|
||||
});
|
||||
function(value) {
|
||||
var resolution = maxResolution / Math.pow(power, value * max);
|
||||
return resolution;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -731,15 +731,15 @@ ol.View.prototype.getValueForResolutionFunction = function(opt_power) {
|
||||
var minResolution = this.minResolution_;
|
||||
var max = Math.log(maxResolution / minResolution) / Math.log(power);
|
||||
return (
|
||||
/**
|
||||
/**
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {number} Value.
|
||||
*/
|
||||
function(resolution) {
|
||||
var value =
|
||||
function(resolution) {
|
||||
var value =
|
||||
(Math.log(maxResolution / resolution) / Math.log(power)) / max;
|
||||
return value;
|
||||
});
|
||||
return value;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -839,7 +839,7 @@ ol.View.prototype.fit = function(geometryOrExtent, opt_options) {
|
||||
|
||||
var padding = options.padding !== undefined ? options.padding : [0, 0, 0, 0];
|
||||
var constrainResolution = options.constrainResolution !== undefined ?
|
||||
options.constrainResolution : true;
|
||||
options.constrainResolution : true;
|
||||
var nearest = options.nearest !== undefined ? options.nearest : false;
|
||||
var minResolution;
|
||||
if (options.minResolution !== undefined) {
|
||||
@@ -875,7 +875,7 @@ ol.View.prototype.fit = function(geometryOrExtent, opt_options) {
|
||||
[minRotX, minRotY, maxRotX, maxRotY],
|
||||
[size[0] - padding[1] - padding[3], size[1] - padding[0] - padding[2]]);
|
||||
resolution = isNaN(resolution) ? minResolution :
|
||||
Math.max(resolution, minResolution);
|
||||
Math.max(resolution, minResolution);
|
||||
if (constrainResolution) {
|
||||
var constrainedResolution = this.constrainResolution(resolution, 0, 0);
|
||||
if (!nearest && constrainedResolution < resolution) {
|
||||
@@ -1058,13 +1058,13 @@ ol.View.createResolutionConstraint_ = function(options) {
|
||||
var defaultZoomFactor = 2;
|
||||
|
||||
var minZoom = options.minZoom !== undefined ?
|
||||
options.minZoom : ol.DEFAULT_MIN_ZOOM;
|
||||
options.minZoom : ol.DEFAULT_MIN_ZOOM;
|
||||
|
||||
var maxZoom = options.maxZoom !== undefined ?
|
||||
options.maxZoom : defaultMaxZoom;
|
||||
options.maxZoom : defaultMaxZoom;
|
||||
|
||||
var zoomFactor = options.zoomFactor !== undefined ?
|
||||
options.zoomFactor : defaultZoomFactor;
|
||||
options.zoomFactor : defaultZoomFactor;
|
||||
|
||||
if (options.resolutions !== undefined) {
|
||||
var resolutions = options.resolutions;
|
||||
@@ -1077,10 +1077,10 @@ ol.View.createResolutionConstraint_ = function(options) {
|
||||
var projection = ol.proj.createProjection(options.projection, 'EPSG:3857');
|
||||
var extent = projection.getExtent();
|
||||
var size = !extent ?
|
||||
// use an extent that can fit the whole world if need be
|
||||
360 * ol.proj.METERS_PER_UNIT[ol.proj.Units.DEGREES] /
|
||||
// use an extent that can fit the whole world if need be
|
||||
360 * ol.proj.METERS_PER_UNIT[ol.proj.Units.DEGREES] /
|
||||
projection.getMetersPerUnit() :
|
||||
Math.max(ol.extent.getWidth(extent), ol.extent.getHeight(extent));
|
||||
Math.max(ol.extent.getWidth(extent), ol.extent.getHeight(extent));
|
||||
|
||||
var defaultMaxResolution = size / ol.DEFAULT_TILE_SIZE / Math.pow(
|
||||
defaultZoomFactor, ol.DEFAULT_MIN_ZOOM);
|
||||
@@ -1130,7 +1130,7 @@ ol.View.createResolutionConstraint_ = function(options) {
|
||||
*/
|
||||
ol.View.createRotationConstraint_ = function(options) {
|
||||
var enableRotation = options.enableRotation !== undefined ?
|
||||
options.enableRotation : true;
|
||||
options.enableRotation : true;
|
||||
if (enableRotation) {
|
||||
var constrainRotation = options.constrainRotation;
|
||||
if (constrainRotation === undefined || constrainRotation === true) {
|
||||
|
||||
Reference in New Issue
Block a user