Trigger CHANGE event only when required

For example only when layer is both ready and visible.
This commit is contained in:
Bruno Binet
2013-08-12 11:51:42 +02:00
parent 8b435059f7
commit 88da6da3a7
2 changed files with 35 additions and 2 deletions
+18
View File
@@ -66,6 +66,24 @@ ol.layer.LayerGroup = function(opt_options) {
goog.inherits(ol.layer.LayerGroup, ol.layer.LayerBase);
/**
* @inheritDoc
*/
ol.layer.LayerGroup.prototype.handleLayerChange = function() {
if (this.getVisible()) {
this.dispatchChangeEvent();
}
};
/**
* @inheritDoc
*/
ol.layer.LayerGroup.prototype.handleLayerVisibleChange = function() {
this.dispatchChangeEvent();
};
/**
* @param {goog.events.Event} event Event.
* @private