Add renderMode option to ol.layer.Vector

This also deprecates ol.source.ImageVector.
This commit is contained in:
Andreas Hocevar
2017-11-22 20:58:27 +01:00
parent 29e3dd39e4
commit dde81d8585
14 changed files with 408 additions and 78 deletions

View File

@@ -70,10 +70,9 @@ ol.renderer.canvas.VectorLayer = function(vectorLayer) {
this.replayGroup_ = null;
/**
* @private
* @type {CanvasRenderingContext2D}
*/
this.context_ = ol.dom.createCanvasContext2D();
this.context = ol.dom.createCanvasContext2D();
ol.events.listen(ol.render.canvas.labelCache, ol.events.EventType.CLEAR, this.handleFontsChanged_, this);
@@ -139,7 +138,7 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame = function(frameState, lay
}
var replayGroup = this.replayGroup_;
if (replayGroup && !replayGroup.isEmpty()) {
var layer = this.getLayer();
var layer = /** @type {ol.layer.Vector} */ (this.getLayer());
var drawOffsetX = 0;
var drawOffsetY = 0;
var replayContext;
@@ -155,9 +154,9 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame = function(frameState, lay
drawWidth = drawHeight = drawSize;
}
// resize and clear
this.context_.canvas.width = drawWidth;
this.context_.canvas.height = drawHeight;
replayContext = this.context_;
this.context.canvas.width = drawWidth;
this.context.canvas.height = drawHeight;
replayContext = this.context;
} else {
replayContext = context;
}