Disallowed undefined 'minResolution' value
This commit is contained in:
@@ -153,7 +153,7 @@ ol.layer.Base.prototype.getLayerState = function() {
|
||||
visible: visible,
|
||||
extent: extent,
|
||||
maxResolution: maxResolution,
|
||||
minResolution: goog.isDef(minResolution) ? Math.max(minResolution, 0) : 0
|
||||
minResolution: Math.max(minResolution, 0)
|
||||
};
|
||||
};
|
||||
|
||||
@@ -205,12 +205,12 @@ goog.exportProperty(
|
||||
|
||||
|
||||
/**
|
||||
* @return {number|undefined} The minimum resolution of the layer.
|
||||
* @return {number} The minimum resolution of the layer.
|
||||
* @observable
|
||||
* @api stable
|
||||
*/
|
||||
ol.layer.Base.prototype.getMinResolution = function() {
|
||||
return /** @type {number|undefined} */ (
|
||||
return /** @type {number} */ (
|
||||
this.get(ol.layer.LayerProperty.MIN_RESOLUTION));
|
||||
};
|
||||
goog.exportProperty(
|
||||
@@ -363,7 +363,7 @@ goog.exportProperty(
|
||||
|
||||
|
||||
/**
|
||||
* @param {number|undefined} minResolution The minimum resolution of the layer.
|
||||
* @param {number} minResolution The minimum resolution of the layer.
|
||||
* @observable
|
||||
* @api stable
|
||||
*/
|
||||
|
||||
@@ -50,6 +50,10 @@ describe('ol.layer.Layer', function() {
|
||||
expect(layer.getMaxResolution()).to.be(Infinity);
|
||||
});
|
||||
|
||||
it('provides default min resolution', function() {
|
||||
expect(layer.getMinResolution()).to.be(0);
|
||||
});
|
||||
|
||||
it('provides default layerState', function() {
|
||||
expect(layer.getLayerState()).to.eql({
|
||||
layer: layer,
|
||||
|
||||
Reference in New Issue
Block a user