Tile renderers needn't listen for tile change

This commit is contained in:
Éric Lemoine
2013-03-20 22:58:03 +01:00
parent 7038ac0c81
commit 1d575309da
6 changed files with 22 additions and 39 deletions

View File

@@ -41,12 +41,6 @@ ol.renderer.Layer = function(mapRenderer, layer) {
*/
this.layer_ = layer;
/**
* @protected
* @type {Object.<string, boolean>}
*/
this.observedTileKeys = {};
goog.events.listen(this.layer_,
ol.Object.getChangedEventType(ol.layer.LayerProperty.BRIGHTNESS),
this.handleLayerBrightnessChange, false, this);
@@ -181,22 +175,6 @@ ol.renderer.Layer.prototype.handleTileChange_ = function(event) {
if (tile.getState() === ol.TileState.LOADED) {
this.getMap().requestRenderFrame();
}
delete this.observedTileKeys[tile.getKey()];
};
/**
* Listen once to tileKey, le change event.
* @param {ol.Tile} tile Tile.
* @protected
*/
ol.renderer.Layer.prototype.listenToTileChange = function(tile) {
var tileKey = tile.getKey();
if (!(tileKey in this.observedTileKeys)) {
this.observedTileKeys[tileKey] = true;
goog.events.listenOnce(tile, goog.events.EventType.CHANGE,
this.handleTileChange_, false, this);
}
};