Add pixelRatio support for DOM vector renderer

Adds the scaling and transforms to support pixelRatio values other than
1.
This commit is contained in:
Andreas Hocevar
2015-01-12 22:14:52 +01:00
parent 5dca3e9b20
commit bbf074b70a
2 changed files with 31 additions and 10 deletions
+3 -2
View File
@@ -224,8 +224,9 @@ ol.renderer.dom.Map.prototype.renderFrame = function(frameState) {
(map.hasListener(ol.render.EventType.PRECOMPOSE) ||
map.hasListener(ol.render.EventType.POSTCOMPOSE))) {
var canvas = this.context_.canvas;
canvas.width = frameState.size[0];
canvas.height = frameState.size[1];
var pixelRatio = frameState.pixelRatio;
canvas.width = frameState.size[0] * pixelRatio;
canvas.height = frameState.size[1] * pixelRatio;
}
this.dispatchComposeEvent_(ol.render.EventType.PRECOMPOSE, frameState);