performs adjustment in the canvas layer instead of the torque layer
This commit is contained in:
parent
9ca2d5e774
commit
147cdbf1b4
@ -85,7 +85,7 @@ L.CanvasLayer = L.Class.extend({
|
||||
}, this);
|
||||
|
||||
map.on({ 'viewreset': this._reset }, this);
|
||||
map.on('move', this.render, this);
|
||||
map.on('move', this.redraw, this);
|
||||
map.on('resize', this._reset, this);
|
||||
|
||||
if (this.options.zoomAnimation) {
|
||||
@ -233,6 +233,10 @@ L.CanvasLayer = L.Class.extend({
|
||||
// use direct: true if you are inside an animation frame call
|
||||
redraw: function(direct) {
|
||||
if (direct) {
|
||||
var domPosition = L.DomUtil.getPosition(this._map.getPanes().mapPane);
|
||||
if (domPosition) {
|
||||
L.DomUtil.setPosition(this._canvas, { x: -domPosition.x, y: -domPosition.y });
|
||||
}
|
||||
this.render();
|
||||
} else {
|
||||
this._render();
|
||||
|
@ -212,10 +212,6 @@ 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];
|
||||
|
Loading…
Reference in New Issue
Block a user