Rename _ol_ResolutionConstraint_ to ResolutionConstraint

This commit is contained in:
Tim Schaub
2018-01-08 09:51:40 -07:00
parent c2a75c9040
commit 073e7dc829
3 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -3,14 +3,14 @@
*/ */
import {linearFindNearest} from './array.js'; import {linearFindNearest} from './array.js';
import {clamp} from './math.js'; import {clamp} from './math.js';
var _ol_ResolutionConstraint_ = {}; var ResolutionConstraint = {};
/** /**
* @param {Array.<number>} resolutions Resolutions. * @param {Array.<number>} resolutions Resolutions.
* @return {ol.ResolutionConstraintType} Zoom function. * @return {ol.ResolutionConstraintType} Zoom function.
*/ */
_ol_ResolutionConstraint_.createSnapToResolutions = function(resolutions) { ResolutionConstraint.createSnapToResolutions = function(resolutions) {
return ( return (
/** /**
* @param {number|undefined} resolution Resolution. * @param {number|undefined} resolution Resolution.
@@ -43,7 +43,7 @@ _ol_ResolutionConstraint_.createSnapToResolutions = function(resolutions) {
* @param {number=} opt_maxLevel Maximum level. * @param {number=} opt_maxLevel Maximum level.
* @return {ol.ResolutionConstraintType} Zoom function. * @return {ol.ResolutionConstraintType} Zoom function.
*/ */
_ol_ResolutionConstraint_.createSnapToPower = function(power, maxResolution, opt_maxLevel) { ResolutionConstraint.createSnapToPower = function(power, maxResolution, opt_maxLevel) {
return ( return (
/** /**
* @param {number|undefined} resolution Resolution. * @param {number|undefined} resolution Resolution.
@@ -66,4 +66,4 @@ _ol_ResolutionConstraint_.createSnapToPower = function(power, maxResolution, opt
} }
}); });
}; };
export default _ol_ResolutionConstraint_; export default ResolutionConstraint;
+3 -3
View File
@@ -5,7 +5,7 @@ import {DEFAULT_TILE_SIZE} from './tilegrid/common.js';
import {inherits, getUid, nullFunction} from './index.js'; import {inherits, getUid, nullFunction} from './index.js';
import CenterConstraint from './CenterConstraint.js'; import CenterConstraint from './CenterConstraint.js';
import _ol_Object_ from './Object.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_RotationConstraint_ from './RotationConstraint.js';
import _ol_ViewHint_ from './ViewHint.js'; import _ol_ViewHint_ from './ViewHint.js';
import _ol_ViewProperty_ from './ViewProperty.js'; import _ol_ViewProperty_ from './ViewProperty.js';
@@ -1125,7 +1125,7 @@ _ol_View_.createResolutionConstraint_ = function(options) {
maxResolution = resolutions[minZoom]; maxResolution = resolutions[minZoom];
minResolution = resolutions[maxZoom] !== undefined ? minResolution = resolutions[maxZoom] !== undefined ?
resolutions[maxZoom] : resolutions[resolutions.length - 1]; resolutions[maxZoom] : resolutions[resolutions.length - 1];
resolutionConstraint = _ol_ResolutionConstraint_.createSnapToResolutions( resolutionConstraint = ResolutionConstraint.createSnapToResolutions(
resolutions); resolutions);
} else { } else {
// calculate the default min and max resolution // calculate the default min and max resolution
@@ -1170,7 +1170,7 @@ _ol_View_.createResolutionConstraint_ = function(options) {
Math.log(maxResolution / minResolution) / Math.log(zoomFactor)); Math.log(maxResolution / minResolution) / Math.log(zoomFactor));
minResolution = maxResolution / Math.pow(zoomFactor, maxZoom - minZoom); minResolution = maxResolution / Math.pow(zoomFactor, maxZoom - minZoom);
resolutionConstraint = _ol_ResolutionConstraint_.createSnapToPower( resolutionConstraint = ResolutionConstraint.createSnapToPower(
zoomFactor, maxResolution, maxZoom - minZoom); zoomFactor, maxResolution, maxZoom - minZoom);
} }
return {constraint: resolutionConstraint, maxResolution: maxResolution, return {constraint: resolutionConstraint, maxResolution: maxResolution,
+5 -5
View File
@@ -1,4 +1,4 @@
import _ol_ResolutionConstraint_ from '../../../src/ol/ResolutionConstraint.js'; import ResolutionConstraint from '../../../src/ol/ResolutionConstraint.js';
describe('ol.ResolutionConstraint', function() { describe('ol.ResolutionConstraint', function() {
@@ -8,7 +8,7 @@ describe('ol.ResolutionConstraint', function() {
var resolutionConstraint; var resolutionConstraint;
beforeEach(function() { beforeEach(function() {
resolutionConstraint = _ol_ResolutionConstraint_.createSnapToResolutions( resolutionConstraint = ResolutionConstraint.createSnapToResolutions(
[1000, 500, 250, 100]); [1000, 500, 250, 100]);
}); });
@@ -46,7 +46,7 @@ describe('ol.ResolutionConstraint', function() {
beforeEach(function() { beforeEach(function() {
resolutionConstraint = resolutionConstraint =
_ol_ResolutionConstraint_.createSnapToResolutions( ResolutionConstraint.createSnapToResolutions(
[1000, 500, 250, 100]); [1000, 500, 250, 100]);
}); });
@@ -96,7 +96,7 @@ describe('ol.ResolutionConstraint', function() {
beforeEach(function() { beforeEach(function() {
resolutionConstraint = resolutionConstraint =
_ol_ResolutionConstraint_.createSnapToPower(2, 1024, 10); ResolutionConstraint.createSnapToPower(2, 1024, 10);
}); });
describe('delta 0', function() { describe('delta 0', function() {
@@ -154,7 +154,7 @@ describe('ol.ResolutionConstraint', function() {
beforeEach(function() { beforeEach(function() {
resolutionConstraint = resolutionConstraint =
_ol_ResolutionConstraint_.createSnapToPower(2, 1024, 10); ResolutionConstraint.createSnapToPower(2, 1024, 10);
}); });
describe('delta 0, direction 0', function() { describe('delta 0, direction 0', function() {