From d208ce8c3b6157f916f5aa4421f2959c6c1ef2cb Mon Sep 17 00:00:00 2001 From: javi Date: Tue, 20 Aug 2013 17:38:52 +0200 Subject: [PATCH] wrap tiles --- lib/torque/leaflet/torque.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/torque/leaflet/torque.js b/lib/torque/leaflet/torque.js index 9a1377b..00b6088 100644 --- a/lib/torque/leaflet/torque.js +++ b/lib/torque/leaflet/torque.js @@ -132,7 +132,11 @@ L.TiledTorqueLayer = L.TileLayer.Canvas.extend({ _loadTile: function(tile, tilePoint) { var self = this; L.TileLayer.Canvas.prototype._loadTile.apply(this, arguments); - this.provider.getTileData(tilePoint, this._map.getZoom(), function(tileData) { + + // get the data from adjusted point but render in the right canvas + var adjusted = tilePoint.clone() + this._adjustTilePoint(adjusted); + this.provider.getTileData(adjusted, this._map.getZoom(), function(tileData) { self._tileLoaded(tile, tilePoint, tileData); L.DomUtil.addClass(tile, 'leaflet-tile-loaded'); });