From fab12b10c1652b522ed8a3cb3c175782a5c1f608 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 25 Jun 2013 12:26:35 +0200 Subject: [PATCH] Handle projection being undefined in getView2DState --- src/ol/view2d.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/view2d.js b/src/ol/view2d.js index 7cd28a744d..6ae9e17325 100644 --- a/src/ol/view2d.js +++ b/src/ol/view2d.js @@ -305,12 +305,12 @@ ol.View2D.prototype.getView2D = function() { ol.View2D.prototype.getView2DState = function() { goog.asserts.assert(this.isDef()); 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 rotation = this.getRotation(); return { center: center.slice(), - projection: projection, + projection: goog.isDef(projection) ? projection : null, resolution: resolution, rotation: goog.isDef(rotation) ? rotation : 0 };