map renderer should not render if map is not defined

This commit is contained in:
Éric Lemoine
2012-08-21 06:54:42 +02:00
parent a17a4a2581
commit 0fd6629459

View File

@@ -96,6 +96,10 @@ ol.dom.MapRenderer.prototype.createLayerRenderer = function(layer) {
*/
ol.dom.MapRenderer.prototype.handleCenterChanged = function() {
goog.base(this, 'handleCenterChanged');
var map = this.getMap();
if (!map.isDef()) {
return;
}
// FIXME: shiftLayersPane_ and resetLayersPane_ should be called
// elsewhere as we may be frozen here
if (goog.isDef(this.renderedCenter_)) {
@@ -112,6 +116,10 @@ ol.dom.MapRenderer.prototype.handleCenterChanged = function() {
*/
ol.dom.MapRenderer.prototype.handleResolutionChanged = function() {
goog.base(this, 'handleResolutionChanged');
var map = this.getMap();
if (!map.isDef()) {
return;
}
// FIXME: resetLayersPane_ should be called
// elsewhere as we may be frozen here
this.resetLayersPane_();