Merge pull request #1047 from twpayne/remove-load-events
Remove source load events
This commit is contained in:
@@ -31,23 +31,10 @@ ol.layer.Layer = function(options) {
|
|||||||
goog.events.listen(this.source_, goog.events.EventType.CHANGE,
|
goog.events.listen(this.source_, goog.events.EventType.CHANGE,
|
||||||
this.handleSourceChange_, false, this);
|
this.handleSourceChange_, false, this);
|
||||||
|
|
||||||
if (!this.source_.isReady()) {
|
|
||||||
goog.events.listenOnce(this.source_, goog.events.EventType.LOAD,
|
|
||||||
this.handleSourceLoad_, false, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.layer.Layer, ol.layer.Base);
|
goog.inherits(ol.layer.Layer, ol.layer.Base);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
ol.layer.Layer.prototype.dispatchLoadEvent_ = function() {
|
|
||||||
this.dispatchEvent(goog.events.EventType.LOAD);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
@@ -89,14 +76,6 @@ ol.layer.Layer.prototype.handleSourceChange_ = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
ol.layer.Layer.prototype.handleSourceLoad_ = function() {
|
|
||||||
this.dispatchLoadEvent_();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -78,8 +78,7 @@ ol.layer.Base = function(options) {
|
|||||||
ol.Object.getChangeEventType(ol.layer.LayerProperty.OPACITY),
|
ol.Object.getChangeEventType(ol.layer.LayerProperty.OPACITY),
|
||||||
ol.Object.getChangeEventType(ol.layer.LayerProperty.SATURATION),
|
ol.Object.getChangeEventType(ol.layer.LayerProperty.SATURATION),
|
||||||
ol.Object.getChangeEventType(ol.layer.LayerProperty.MAX_RESOLUTION),
|
ol.Object.getChangeEventType(ol.layer.LayerProperty.MAX_RESOLUTION),
|
||||||
ol.Object.getChangeEventType(ol.layer.LayerProperty.MIN_RESOLUTION),
|
ol.Object.getChangeEventType(ol.layer.LayerProperty.MIN_RESOLUTION)
|
||||||
goog.events.EventType.LOAD
|
|
||||||
],
|
],
|
||||||
this.handleLayerChange, false, this);
|
this.handleLayerChange, false, this);
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse =
|
|||||||
|
|
||||||
this.ready_ = true;
|
this.ready_ = true;
|
||||||
|
|
||||||
this.dispatchLoadEvent();
|
this.dispatchChangeEvent();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -64,15 +64,6 @@ ol.source.Source.prototype.dispatchChangeEvent = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @protected
|
|
||||||
*/
|
|
||||||
ol.source.Source.prototype.dispatchLoadEvent = function() {
|
|
||||||
++this.revision_;
|
|
||||||
this.dispatchEvent(goog.events.EventType.LOAD);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<ol.Attribution>} Attributions.
|
* @return {Array.<ol.Attribution>} Attributions.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function() {
|
|||||||
|
|
||||||
this.ready_ = true;
|
this.ready_ = true;
|
||||||
|
|
||||||
this.dispatchLoadEvent();
|
this.dispatchChangeEvent();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user