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