[ol.map] option name maxRes changed to maxResolution (discussed in cdd9439)
This commit is contained in:
+5
-5
@@ -34,7 +34,7 @@ ol.map = function(opt_arg) {
|
|||||||
/** @type {ol.Bounds|undefined} */
|
/** @type {ol.Bounds|undefined} */
|
||||||
var maxExtent;
|
var maxExtent;
|
||||||
/** @type {ol.Bounds|undefined} */
|
/** @type {ol.Bounds|undefined} */
|
||||||
var maxRes;
|
var maxResolution;
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array.<number>|undefined} */
|
||||||
var resolutions;
|
var resolutions;
|
||||||
/** @type {Element|string|undefined} */
|
/** @type {Element|string|undefined} */
|
||||||
@@ -49,14 +49,14 @@ ol.map = function(opt_arg) {
|
|||||||
return opt_arg;
|
return opt_arg;
|
||||||
}
|
}
|
||||||
else if (goog.isObject(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'];
|
center = opt_arg['center'];
|
||||||
zoom = opt_arg['zoom'];
|
zoom = opt_arg['zoom'];
|
||||||
numZoomLevels = opt_arg['numZoomLevels'];
|
numZoomLevels = opt_arg['numZoomLevels'];
|
||||||
projection = opt_arg['projection'];
|
projection = opt_arg['projection'];
|
||||||
userProjection = opt_arg['userProjection'];
|
userProjection = opt_arg['userProjection'];
|
||||||
maxExtent = opt_arg['maxExtent'];
|
maxExtent = opt_arg['maxExtent'];
|
||||||
maxRes = opt_arg['maxRes'];
|
maxResolution = opt_arg['maxResolution'];
|
||||||
resolutions = opt_arg['resolutions'];
|
resolutions = opt_arg['resolutions'];
|
||||||
renderTo = opt_arg['renderTo'];
|
renderTo = opt_arg['renderTo'];
|
||||||
layers = opt_arg['layers'];
|
layers = opt_arg['layers'];
|
||||||
@@ -87,8 +87,8 @@ ol.map = function(opt_arg) {
|
|||||||
if (goog.isDef(maxExtent)) {
|
if (goog.isDef(maxExtent)) {
|
||||||
map.setMaxExtent(ol.bounds(maxExtent));
|
map.setMaxExtent(ol.bounds(maxExtent));
|
||||||
}
|
}
|
||||||
if (goog.isDef(maxRes)) {
|
if (goog.isDef(maxResolution)) {
|
||||||
map.setMaxResolution(maxRes);
|
map.setMaxResolution(maxResolution);
|
||||||
}
|
}
|
||||||
if (goog.isDef(resolutions)) {
|
if (goog.isDef(resolutions)) {
|
||||||
map.setResolutions(resolutions);
|
map.setResolutions(resolutions);
|
||||||
|
|||||||
+8
-8
@@ -77,7 +77,7 @@ ol.Map = function() {
|
|||||||
* @private
|
* @private
|
||||||
* @type {number|undefined}
|
* @type {number|undefined}
|
||||||
*/
|
*/
|
||||||
this.maxRes_ = undefined;
|
this.maxResolution_ = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -235,8 +235,8 @@ ol.Map.prototype.getMaxExtent = function() {
|
|||||||
* @return {number} the max resolution for the map
|
* @return {number} the max resolution for the map
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getMaxResolution = function() {
|
ol.Map.prototype.getMaxResolution = function() {
|
||||||
if (goog.isDefAndNotNull(this.maxRes_)) {
|
if (goog.isDefAndNotNull(this.maxResolution_)) {
|
||||||
return this.maxRes_;
|
return this.maxResolution_;
|
||||||
} else {
|
} else {
|
||||||
var extent = this.getMaxExtent();
|
var extent = this.getMaxExtent();
|
||||||
var dim = Math.max(
|
var dim = Math.max(
|
||||||
@@ -256,8 +256,8 @@ ol.Map.prototype.getResolutionForZoom = function(zoom) {
|
|||||||
if (goog.isDefAndNotNull(this.resolutions_)) {
|
if (goog.isDefAndNotNull(this.resolutions_)) {
|
||||||
return this.resolutions_[zoom];
|
return this.resolutions_[zoom];
|
||||||
} else {
|
} else {
|
||||||
var maxRes = this.getMaxResolution();
|
var maxResolution = this.getMaxResolution();
|
||||||
return maxRes/Math.pow(ol.Map.ZOOM_FACTOR, zoom);
|
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) {
|
ol.Map.prototype.setMaxResolution = function(maxResolution) {
|
||||||
this.maxRes_ = res;
|
this.maxResolution_ = maxResolution;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user