Trigger CHANGE event only when required
For example only when layer is both ready and visible.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user