[ol.map] option name maxRes changed to maxResolution (discussed in cdd9439)

This commit is contained in:
Éric Lemoine
2012-06-23 21:27:39 +02:00
parent c7e799ebf4
commit 0b36e10f8f
2 changed files with 13 additions and 13 deletions

View File

@@ -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.<number>|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);

View File

@@ -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;
};
/**