nakarte

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

commit 52bc19e39daeb09f09e4b267055cf3fcceb68553
parent 3b1cd77ac1da068aff602191deac0a011cf2e749
Author: Sergej Orlov <wladimirych@gmail.com>
Date:   Thu, 10 Nov 2016 00:10:50 +0300

partially fix bug with gray spaces around tiles when animating

Diffstat:
Msrc/App.js | 2++
Asrc/lib/leaflet.fixAnimationBug/leaflet.fixAnimationBug.js | 16++++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/App.js b/src/App.js @@ -9,8 +9,10 @@ import './lib/control.coordinates/coordinates'; import './lib/control.layers.hotkeys/control.Layers-hotkeys'; import './lib/hashState/Leaflet.Map'; import './lib/hashState/Leaflet.Control.Layers'; +import fixAnimationBug from 'lib/leaflet.fixAnimationBug/leaflet.fixAnimationBug' function setUp() { + fixAnimationBug(); const map = L.map('map', { zoomControl: false, fadeAnimation: false, diff --git a/src/lib/leaflet.fixAnimationBug/leaflet.fixAnimationBug.js b/src/lib/leaflet.fixAnimationBug/leaflet.fixAnimationBug.js @@ -0,0 +1,15 @@ +import L from 'leaflet'; + +// https://github.com/Leaflet/Leaflet/issues/3575 + +const originalStep = L.PosAnimation.prototype._step + +function _step() { + return originalStep.call(this, true); +} + +export default function fixAnimationBug() { + if (L.PosAnimation.prototype._step !== _step) { + L.PosAnimation.prototype._step = _step; + } +} +\ No newline at end of file