sets the correct position of the canvas on each render

This commit is contained in:
Francisco Dans 2015-05-05 16:56:55 +02:00
parent 52b3521557
commit 3eef183945

View File

@ -212,6 +212,10 @@ L.TorqueLayer = L.CanvasLayer.extend({
var canvas = this.getCanvas();
this.renderer.clearCanvas();
var ctx = canvas.getContext('2d');
var domPosition = L.DomUtil.getPosition(this._map.getPanes().mapPane);
if (domPosition) {
L.DomUtil.setPosition(this._canvas, { x: -domPosition.x, y: -domPosition.y });
}
for(t in this._tiles) {
tile = this._tiles[t];