Lift common composite rendering code into ol.Map

This commit is contained in:
Tom Payne
2012-07-18 00:21:20 +02:00
parent 86335211a6
commit 659ef30802
3 changed files with 10 additions and 19 deletions

View File

@@ -199,15 +199,3 @@ ol.dom.Map.prototype.handleResolutionChanged = function() {
ol.dom.Map.prototype.handleSizeChanged = function() {
goog.base(this, 'handleSizeChanged');
};
/**
* @inheritDoc
*/
ol.dom.Map.prototype.redrawInternal = function() {
goog.base(this, 'redrawInternal');
this.forEachVisibleLayer(function(layer, layerRenderer) {
layerRenderer.redraw();
}, this);
return false;
};

View File

@@ -436,7 +436,16 @@ ol.Map.prototype.redraw = function() {
*/
ol.Map.prototype.redrawInternal = function() {
this.dirty_ = false;
return false;
var animate = false;
this.forEachVisibleLayer(function(layer, layerRenderer) {
if (layerRenderer.redraw()) {
animate = true;
}
});
return animate;
};

View File

@@ -413,12 +413,6 @@ ol.webgl.Map.prototype.redrawInternal = function() {
var animate = goog.base(this, 'redrawInternal');
this.forEachVisibleLayer(function(layer, layerRenderer) {
if (layerRenderer.redraw()) {
animate = true;
}
});
var gl = this.getGL();
gl.bindFramebuffer(goog.webgl.FRAMEBUFFER, null);