Use add/remove events
This commit is contained in:
+22
-22
@@ -237,6 +237,17 @@ ol.webgl.Map = function(target, opt_values) {
|
||||
goog.inherits(ol.webgl.Map, ol.Map);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.webgl.Map.prototype.addLayer = function(layer) {
|
||||
goog.base(this, 'addLayer', layer);
|
||||
if (layer.getVisible()) {
|
||||
this.render();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -394,17 +405,6 @@ ol.webgl.Map.prototype.handleCenterChanged = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.webgl.Map.prototype.handleLayerAdd = function(layer) {
|
||||
goog.base(this, 'handleLayerAdd', layer);
|
||||
if (layer.getVisible()) {
|
||||
this.render();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {goog.events.Event} event Event.
|
||||
* @protected
|
||||
@@ -414,17 +414,6 @@ ol.webgl.Map.prototype.handleLayerRendererChange = function(event) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.webgl.Map.prototype.handleLayerRemove = function(layer) {
|
||||
goog.base(this, 'handleLayerRemove', layer);
|
||||
if (layer.getVisible()) {
|
||||
this.render();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -573,6 +562,17 @@ ol.webgl.Map.prototype.renderInternal = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.webgl.Map.prototype.removeLayer = function(layer) {
|
||||
goog.base(this, 'removeLayer', layer);
|
||||
if (layer.getVisible()) {
|
||||
this.render();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user