Disallowed undefined rotation value

This commit is contained in:
Frederic Junod
2015-01-27 09:22:18 +01:00
parent 5c9b17a3b2
commit 829a0ca224
2 changed files with 22 additions and 4 deletions

View File

@@ -351,12 +351,12 @@ ol.View.prototype.getResolutionForValueFunction = function(opt_power) {
/**
* @return {number|undefined} The rotation of the view.
* @return {number} The rotation of the view.
* @observable
* @api stable
*/
ol.View.prototype.getRotation = function() {
return /** @type {number|undefined} */ (this.get(ol.ViewProperty.ROTATION));
return /** @type {number} */ (this.get(ol.ViewProperty.ROTATION));
};
goog.exportProperty(
ol.View.prototype,
@@ -402,7 +402,7 @@ ol.View.prototype.getState = function() {
center: center.slice(),
projection: goog.isDef(projection) ? projection : null,
resolution: resolution,
rotation: goog.isDef(rotation) ? rotation : 0
rotation: rotation
});
};
@@ -626,7 +626,7 @@ goog.exportProperty(
/**
* Set the rotation for this view.
* @param {number|undefined} rotation The rotation of the view.
* @param {number} rotation The rotation of the view.
* @observable
* @api stable
*/