From 073e7dc8296380bd9d3d459ac20f184481eb1dd3 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 8 Jan 2018 09:51:40 -0700 Subject: [PATCH] Rename _ol_ResolutionConstraint_ to ResolutionConstraint --- src/ol/ResolutionConstraint.js | 8 ++++---- src/ol/View.js | 6 +++--- test/spec/ol/resolutionconstraint.test.js | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ol/ResolutionConstraint.js b/src/ol/ResolutionConstraint.js index 52922070b0..567d60a643 100644 --- a/src/ol/ResolutionConstraint.js +++ b/src/ol/ResolutionConstraint.js @@ -3,14 +3,14 @@ */ import {linearFindNearest} from './array.js'; import {clamp} from './math.js'; -var _ol_ResolutionConstraint_ = {}; +var ResolutionConstraint = {}; /** * @param {Array.} resolutions Resolutions. * @return {ol.ResolutionConstraintType} Zoom function. */ -_ol_ResolutionConstraint_.createSnapToResolutions = function(resolutions) { +ResolutionConstraint.createSnapToResolutions = function(resolutions) { return ( /** * @param {number|undefined} resolution Resolution. @@ -43,7 +43,7 @@ _ol_ResolutionConstraint_.createSnapToResolutions = function(resolutions) { * @param {number=} opt_maxLevel Maximum level. * @return {ol.ResolutionConstraintType} Zoom function. */ -_ol_ResolutionConstraint_.createSnapToPower = function(power, maxResolution, opt_maxLevel) { +ResolutionConstraint.createSnapToPower = function(power, maxResolution, opt_maxLevel) { return ( /** * @param {number|undefined} resolution Resolution. @@ -66,4 +66,4 @@ _ol_ResolutionConstraint_.createSnapToPower = function(power, maxResolution, opt } }); }; -export default _ol_ResolutionConstraint_; +export default ResolutionConstraint; diff --git a/src/ol/View.js b/src/ol/View.js index 4a654d519b..c0d88ca266 100644 --- a/src/ol/View.js +++ b/src/ol/View.js @@ -5,7 +5,7 @@ import {DEFAULT_TILE_SIZE} from './tilegrid/common.js'; import {inherits, getUid, nullFunction} from './index.js'; import CenterConstraint from './CenterConstraint.js'; import _ol_Object_ from './Object.js'; -import _ol_ResolutionConstraint_ from './ResolutionConstraint.js'; +import ResolutionConstraint from './ResolutionConstraint.js'; import _ol_RotationConstraint_ from './RotationConstraint.js'; import _ol_ViewHint_ from './ViewHint.js'; import _ol_ViewProperty_ from './ViewProperty.js'; @@ -1125,7 +1125,7 @@ _ol_View_.createResolutionConstraint_ = function(options) { maxResolution = resolutions[minZoom]; minResolution = resolutions[maxZoom] !== undefined ? resolutions[maxZoom] : resolutions[resolutions.length - 1]; - resolutionConstraint = _ol_ResolutionConstraint_.createSnapToResolutions( + resolutionConstraint = ResolutionConstraint.createSnapToResolutions( resolutions); } else { // calculate the default min and max resolution @@ -1170,7 +1170,7 @@ _ol_View_.createResolutionConstraint_ = function(options) { Math.log(maxResolution / minResolution) / Math.log(zoomFactor)); minResolution = maxResolution / Math.pow(zoomFactor, maxZoom - minZoom); - resolutionConstraint = _ol_ResolutionConstraint_.createSnapToPower( + resolutionConstraint = ResolutionConstraint.createSnapToPower( zoomFactor, maxResolution, maxZoom - minZoom); } return {constraint: resolutionConstraint, maxResolution: maxResolution, diff --git a/test/spec/ol/resolutionconstraint.test.js b/test/spec/ol/resolutionconstraint.test.js index 139f754e22..97e5a4daf9 100644 --- a/test/spec/ol/resolutionconstraint.test.js +++ b/test/spec/ol/resolutionconstraint.test.js @@ -1,4 +1,4 @@ -import _ol_ResolutionConstraint_ from '../../../src/ol/ResolutionConstraint.js'; +import ResolutionConstraint from '../../../src/ol/ResolutionConstraint.js'; describe('ol.ResolutionConstraint', function() { @@ -8,7 +8,7 @@ describe('ol.ResolutionConstraint', function() { var resolutionConstraint; beforeEach(function() { - resolutionConstraint = _ol_ResolutionConstraint_.createSnapToResolutions( + resolutionConstraint = ResolutionConstraint.createSnapToResolutions( [1000, 500, 250, 100]); }); @@ -46,7 +46,7 @@ describe('ol.ResolutionConstraint', function() { beforeEach(function() { resolutionConstraint = - _ol_ResolutionConstraint_.createSnapToResolutions( + ResolutionConstraint.createSnapToResolutions( [1000, 500, 250, 100]); }); @@ -96,7 +96,7 @@ describe('ol.ResolutionConstraint', function() { beforeEach(function() { resolutionConstraint = - _ol_ResolutionConstraint_.createSnapToPower(2, 1024, 10); + ResolutionConstraint.createSnapToPower(2, 1024, 10); }); describe('delta 0', function() { @@ -154,7 +154,7 @@ describe('ol.ResolutionConstraint', function() { beforeEach(function() { resolutionConstraint = - _ol_ResolutionConstraint_.createSnapToPower(2, 1024, 10); + ResolutionConstraint.createSnapToPower(2, 1024, 10); }); describe('delta 0, direction 0', function() {