Layer loads should be handled by LayerRenderers, not the Map

This commit is contained in:
Tom Payne
2012-07-28 16:25:57 +02:00
parent 7144e7ad0b
commit 90a4fe9625
3 changed files with 18 additions and 11 deletions

View File

@@ -511,15 +511,6 @@ ol.Map.prototype.handleLayerAdd = function(layer) {
}
var layerRenderer = this.createLayerRenderer(layer);
this.setLayerRenderer(layer, layerRenderer);
goog.events.listen(layer, goog.events.EventType.LOAD, this.handleLayerLoad,
false, this);
};
/**
*/
ol.Map.prototype.handleLayerLoad = function() {
this.render();
};
@@ -528,8 +519,6 @@ ol.Map.prototype.handleLayerLoad = function() {
* @protected
*/
ol.Map.prototype.handleLayerRemove = function(layer) {
goog.events.unlisten(layer, goog.events.EventType.LOAD, this.handleLayerLoad,
false, this);
this.removeLayerRenderer(layer);
};