nakarte

Source code of https://map.sikmir.ru (fork)
git clone git://git.sikmir.ru/nakarte
Log | Files | Refs | LICENSE

commit 33e36b7e2cff91cdf577138cff52d0becee6b33a
parent 32bdc3dfdeb5a64cd6590a2f78b68ca9d97b777a
Author: Sergej Orlov <wladimirych@gmail.com>
Date:   Sat, 18 Feb 2017 01:55:50 +0300

[canvas markers] draw tiles in requestAnimFrame; disable updateWhenZooming on mobile

makes pinxh zoom smoother on mobile

Diffstat:
Msrc/lib/leaflet.layer.canvasMarkers/index.js | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/leaflet.layer.canvasMarkers/index.js b/src/lib/leaflet.layer.canvasMarkers/index.js @@ -36,7 +36,8 @@ L.Layer.CanvasMarkers = L.GridLayer.extend({ labelFontName: 'Verdana, Arial, sans-serif', labelFontSize: 10, iconScale: 1, - pane: 'rasterMarker' + pane: 'rasterMarker', + updateWhenZooming: !L.Browser.mobile }, initialize: function(markers, options) { @@ -150,7 +151,7 @@ L.Layer.CanvasMarkers = L.GridLayer.extend({ const canvas = L.DomUtil.create('canvas', 'leaflet-tile'); canvas.width = this.options.tileSize; canvas.height = this.options.tileSize; - this.drawTile(canvas, coords); + L.Util.requestAnimFrame(() => this.drawTile(canvas, coords)); return canvas; },