From 0b36e10f8f940e9213df8efbefb6fa8d160a5d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Sat, 23 Jun 2012 21:27:39 +0200 Subject: [PATCH] [ol.map] option name maxRes changed to maxResolution (discussed in cdd9439) --- src/api/map.js | 10 +++++----- src/ol/Map.js | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/api/map.js b/src/api/map.js index cea317353e..767c8794de 100644 --- a/src/api/map.js +++ b/src/api/map.js @@ -34,7 +34,7 @@ ol.map = function(opt_arg) { /** @type {ol.Bounds|undefined} */ var maxExtent; /** @type {ol.Bounds|undefined} */ - var maxRes; + var maxResolution; /** @type {Array.|undefined} */ var resolutions; /** @type {Element|string|undefined} */ @@ -49,14 +49,14 @@ ol.map = function(opt_arg) { return opt_arg; } else if (goog.isObject(opt_arg)) { - ol.base.checkKeys(opt_arg, ['center', 'zoom', 'numZoomLevels', 'projection', 'userProjection', 'maxExtent', 'maxRes', 'resolutions', 'renderTo', 'layers', 'controls']); + ol.base.checkKeys(opt_arg, ['center', 'zoom', 'numZoomLevels', 'projection', 'userProjection', 'maxExtent', 'maxResolution', 'resolutions', 'renderTo', 'layers', 'controls']); center = opt_arg['center']; zoom = opt_arg['zoom']; numZoomLevels = opt_arg['numZoomLevels']; projection = opt_arg['projection']; userProjection = opt_arg['userProjection']; maxExtent = opt_arg['maxExtent']; - maxRes = opt_arg['maxRes']; + maxResolution = opt_arg['maxResolution']; resolutions = opt_arg['resolutions']; renderTo = opt_arg['renderTo']; layers = opt_arg['layers']; @@ -87,8 +87,8 @@ ol.map = function(opt_arg) { if (goog.isDef(maxExtent)) { map.setMaxExtent(ol.bounds(maxExtent)); } - if (goog.isDef(maxRes)) { - map.setMaxResolution(maxRes); + if (goog.isDef(maxResolution)) { + map.setMaxResolution(maxResolution); } if (goog.isDef(resolutions)) { map.setResolutions(resolutions); diff --git a/src/ol/Map.js b/src/ol/Map.js index 23b00e04ca..613915d1df 100644 --- a/src/ol/Map.js +++ b/src/ol/Map.js @@ -77,7 +77,7 @@ ol.Map = function() { * @private * @type {number|undefined} */ - this.maxRes_ = undefined; + this.maxResolution_ = undefined; /** * @private @@ -235,8 +235,8 @@ ol.Map.prototype.getMaxExtent = function() { * @return {number} the max resolution for the map */ ol.Map.prototype.getMaxResolution = function() { - if (goog.isDefAndNotNull(this.maxRes_)) { - return this.maxRes_; + if (goog.isDefAndNotNull(this.maxResolution_)) { + return this.maxResolution_; } else { var extent = this.getMaxExtent(); var dim = Math.max( @@ -256,8 +256,8 @@ ol.Map.prototype.getResolutionForZoom = function(zoom) { if (goog.isDefAndNotNull(this.resolutions_)) { return this.resolutions_[zoom]; } else { - var maxRes = this.getMaxResolution(); - return maxRes/Math.pow(ol.Map.ZOOM_FACTOR, zoom); + var maxResolution = this.getMaxResolution(); + return maxResolution/Math.pow(ol.Map.ZOOM_FACTOR, zoom); } }; @@ -410,10 +410,10 @@ ol.Map.prototype.setMaxExtent = function(extent) { }; /** - * @param {number} res the max resolution for the map + * @param {number} maxResolution the max resolution for the map */ -ol.Map.prototype.setMaxResolution = function(res) { - this.maxRes_ = res; +ol.Map.prototype.setMaxResolution = function(maxResolution) { + this.maxResolution_ = maxResolution; }; /**