diff --git a/lib/torque/leaflet/canvas_layer.js b/lib/torque/leaflet/canvas_layer.js index 64420ab..0985f34 100644 --- a/lib/torque/leaflet/canvas_layer.js +++ b/lib/torque/leaflet/canvas_layer.js @@ -4,7 +4,7 @@ require('./leaflet_tileloader_mixin'); * full canvas layer implementation for Leaflet */ -L.CanvasLayer = L.Class.extend({ +L.CanvasLayer = L.Layer.extend({ includes: [L.Mixin.Events, L.Mixin.TileLoader], @@ -64,7 +64,7 @@ L.CanvasLayer = L.Class.extend({ this._map = map; // add container with the canvas to the tile pane - // the container is moved in the oposite direction of the + // the container is moved in the oposite direction of the // map pane to keep the canvas always in (0, 0) var tilePane = this._map._panes.tilePane; var _container = L.DomUtil.create('div', 'leaflet-layer'); @@ -134,7 +134,7 @@ L.CanvasLayer = L.Class.extend({ var bg = back; var transform = L.DomUtil.TRANSFORM; setTimeout(function() { - bg.style[transform] = L.DomUtil.getTranslateString(origin) + ' scale(' + e.scale + ') '; + bg.style[transform] = 'translate(' + origin.x + 'px, ' + origin.y + 'px) scale(' + e.scale + ') '; }, 0) }, @@ -186,6 +186,8 @@ L.CanvasLayer = L.Class.extend({ }, setZIndex: function(zIndex) { + zIndex = zIndex !== void 0 ? zIndex : 1; + this._container.style.zIndex = zIndex; this._canvas.style.zIndex = zIndex; if (this.options.zoomAnimation) { this._backCanvas.style.zIndex = zIndex; diff --git a/lib/torque/leaflet/leaflet_tileloader_mixin.js b/lib/torque/leaflet/leaflet_tileloader_mixin.js index a42d066..1796c61 100644 --- a/lib/torque/leaflet/leaflet_tileloader_mixin.js +++ b/lib/torque/leaflet/leaflet_tileloader_mixin.js @@ -99,7 +99,7 @@ L.Mixin.TileLoader = { getTilePos: function (tilePoint) { tilePoint = new L.Point(tilePoint.x, tilePoint.y); - var origin = this._map._getNewTopLeftPoint(this._map.getCenter()), + var origin = this._map._getTopLeftPoint(this._map.getCenter()), tileSize = this.options.tileSize; return tilePoint.multiplyBy(tileSize).subtract(origin); diff --git a/package.json b/package.json index 8af8e16..5283e0c 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "devDependencies": { "browserify": "~7.0.0", "canvas": "~1.2.1", - "leaflet": "0.7.3", + "leaflet": "1.0.3", "mapnik": "cartodb/node-mapnik#1.4.15-cdb8", "node-qunit-phantomjs": "1.3.0", "phantomjs-polyfill": "0.0.1",