Handle projection being undefined in getView2DState
This commit is contained in:
+2
-2
@@ -305,12 +305,12 @@ ol.View2D.prototype.getView2D = function() {
|
|||||||
ol.View2D.prototype.getView2DState = function() {
|
ol.View2D.prototype.getView2DState = function() {
|
||||||
goog.asserts.assert(this.isDef());
|
goog.asserts.assert(this.isDef());
|
||||||
var center = /** @type {ol.Coordinate} */ (this.getCenter());
|
var center = /** @type {ol.Coordinate} */ (this.getCenter());
|
||||||
var projection = /** @type {ol.Projection} */ (this.getProjection());
|
var projection = this.getProjection();
|
||||||
var resolution = /** @type {number} */ (this.getResolution());
|
var resolution = /** @type {number} */ (this.getResolution());
|
||||||
var rotation = this.getRotation();
|
var rotation = this.getRotation();
|
||||||
return {
|
return {
|
||||||
center: center.slice(),
|
center: center.slice(),
|
||||||
projection: projection,
|
projection: goog.isDef(projection) ? projection : null,
|
||||||
resolution: resolution,
|
resolution: resolution,
|
||||||
rotation: goog.isDef(rotation) ? rotation : 0
|
rotation: goog.isDef(rotation) ? rotation : 0
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user