no aniation when zoom<=0
ValkA opened this issue · 2 comments
ValkA commented
Type:
- bug
- feature
- enhancement
- question
Environment:
- OS: OSX
- Browser: Chrome Version 75.0.3770.100 (Official Build) (64-bit)
- Library Version: 1.3.0, also on demo page - https://rubenspgcavalcante.github.io/leaflet-ant-path/
I'm going to open a PR:
- yes
- no
Description:
When zooming out to <= 0 the animation freezes.
Zooming back to >0 the animation unfreezes.
Zoom <= 0 is useful especially when using an ImageOverlay map together with CRS.Simple coordinates.
jontay81 commented
Looks like animationDuration becomes negative or results in divide/0 as zoomLevel decreases.
I don't have time for a PR now, but if you wrap zoomLevel like this it should fix:
const zoomLevel = Math.max(4, _map.getZoom());
leaflet-ant-path/src/plugin/components/ant-path.component.js
Lines 110 to 114 in aebf321