Merge pull request #284 from CartoDB/leaflet-migration

Migrate to leaflet 1.0.3
pull/285/head
Francisco López 8 years ago committed by GitHub
commit f9e6b4f2f9

@ -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;

@ -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);

@ -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",

Loading…
Cancel
Save