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