Closed t-denis closed 4 years ago
Hi, and thanks for taking the time to open a bug report in Leaflet.
However, in this repository we only handle bugs in "vanilla" Leaflet. This means that we do not handle bugs which are specific to frameworks such as:
Please understand that we only have the time and energy to test Leaflet in plain web browsers.
Please try to either reproduce the bug without using any frameworks, or submit a bug to the appropriate repo.
This rather looks like a bug in whatever minification tool you're using.
@t-denis I tried to modify the falseFn
function of the Util.js
file directly from the node_modules
but the animation is still broken. What am I doing wrong?
@Ploppy3 Try to modify files in dist
folder, not src
.
Also note, that changes in node_modules
can be lost after adding/removing/reinstalling packages.
@t-denis Yeah thanks. Ended up forking leaflet modifying the files adding it to my project.
@Ploppy3 Try to modify files in
dist
folder, notsrc
. Also note, that changes innode_modules
can be lost after adding/removing/reinstalling packages.
With patch-package you can make the changes in node_modules persistent.
npm install --save-dev patch-package
in package.json
scripts add
"scripts": {
"postinstall": "patch-package && ngcc"
}
Modify node_modules/leaflet/dist/leaflet-src.js
and node_modules/leaflet/dist/leaflet-src.esm.js
as suggested
function falseFn() {
if (arguments.length < 0) {
console.log(arguments.length);
}
return false;
}
Run npx patch-package leaflet
Now everytime somebody does an install, patch-package will take care to apply the falseFn patch
@danmana Quite interesting, I didn't know about this. Thank you very much.
In Angular production build zoom animation is broken (unfocused double image, hard to explain) if using mouse scroll.
Looks like modern minification tools consider this call as a pure function with an unused result, and decide to remove these lines: https://github.com/Leaflet/Leaflet/blob/984fedda1c48d141f018ca45ae06738872d7f5dd/src/layer/tile/GridLayer.js#L393-L394
Can be fixed by adding some side-effects to
offsetWidth
orUtil.falseFn
. For example: