Update logos in renderers

This commit is contained in:
Tom Payne
2013-04-05 18:14:25 +02:00
parent cca770097b
commit 5680b89c48
7 changed files with 20 additions and 0 deletions

View File

@@ -115,5 +115,6 @@ ol.renderer.canvas.ImageLayer.prototype.renderFrame =
0); 0);
this.updateAttributions(frameState.attributions, image.getAttributions()); this.updateAttributions(frameState.attributions, image.getAttributions());
this.updateLogos(frameState, imageSource);
} }
}; };

View File

@@ -286,6 +286,7 @@ ol.renderer.canvas.TileLayer.prototype.renderFrame =
this.manageTilePyramid(frameState, tileSource, tileGrid, projection, extent, this.manageTilePyramid(frameState, tileSource, tileGrid, projection, extent,
z, tileLayer.getPreload()); z, tileLayer.getPreload());
this.scheduleExpireCache(frameState, tileSource); this.scheduleExpireCache(frameState, tileSource);
this.updateLogos(frameState, tileSource);
var transform = this.transform_; var transform = this.transform_;
goog.vec.Mat4.makeIdentity(transform); goog.vec.Mat4.makeIdentity(transform);

View File

@@ -109,6 +109,7 @@ ol.renderer.dom.ImageLayer.prototype.renderFrame =
this.setTransform(transform); this.setTransform(transform);
this.updateAttributions(frameState.attributions, image.getAttributions()); this.updateAttributions(frameState.attributions, image.getAttributions());
this.updateLogos(frameState, imageSource);
} }
}; };

View File

@@ -221,6 +221,7 @@ ol.renderer.dom.TileLayer.prototype.renderFrame =
this.manageTilePyramid(frameState, tileSource, tileGrid, projection, extent, this.manageTilePyramid(frameState, tileSource, tileGrid, projection, extent,
z, tileLayer.getPreload()); z, tileLayer.getPreload());
this.scheduleExpireCache(frameState, tileSource); this.scheduleExpireCache(frameState, tileSource);
this.updateLogos(frameState, tileSource);
}; };

View File

@@ -14,6 +14,7 @@ goog.require('ol.TileState');
goog.require('ol.layer.Layer'); goog.require('ol.layer.Layer');
goog.require('ol.layer.LayerProperty'); goog.require('ol.layer.LayerProperty');
goog.require('ol.layer.LayerState'); goog.require('ol.layer.LayerState');
goog.require('ol.source.Source');
goog.require('ol.source.TileSource'); goog.require('ol.source.TileSource');
@@ -220,6 +221,19 @@ ol.renderer.Layer.prototype.updateAttributions =
}; };
/**
* @protected
* @param {ol.FrameState} frameState Frame state.
* @param {ol.source.Source} source Source.
*/
ol.renderer.Layer.prototype.updateLogos = function(frameState, source) {
var logo = source.getLogo();
if (goog.isDef(logo)) {
frameState.logos[logo] = true;
}
};
/** /**
* @protected * @protected
* @param {Object.<string, Object.<string, ol.TileRange>>} usedTiles Used tiles. * @param {Object.<string, Object.<string, ol.TileRange>>} usedTiles Used tiles.

View File

@@ -137,6 +137,7 @@ ol.renderer.webgl.ImageLayer.prototype.renderFrame =
this.texture = texture; this.texture = texture;
this.updateAttributions(frameState.attributions, image.getAttributions()); this.updateAttributions(frameState.attributions, image.getAttributions());
this.updateLogos(frameState, imageSource);
} }
}; };

View File

@@ -282,6 +282,7 @@ ol.renderer.webgl.TileLayer.prototype.renderFrame =
} }
}, this); }, this);
this.scheduleExpireCache(frameState, tileSource); this.scheduleExpireCache(frameState, tileSource);
this.updateLogos(frameState, tileSource);
var texCoordMatrix = this.texCoordMatrix; var texCoordMatrix = this.texCoordMatrix;
goog.vec.Mat4.makeIdentity(texCoordMatrix); goog.vec.Mat4.makeIdentity(texCoordMatrix);