I can set the zoomDelta with map.zoomDelta
.
My problem is that I need to set it depending on the current zoomLevel.
How can I achieve that? Basically I’d like a callback function for zoomDelta, like zoomDelta(curZoomLevel,newZoomLevel)
– I guess, I’m looking for a workaround here.
Also, the scrollZoom does not seem to respect the zoomDelta.
See here:
https://leafletjs.com/examples/zoom-levels/example-delta.html
When I press ‘+’ the delta of .25
is respected, using the wheel I get a delta of 0.644...
(touchpad).
How can I force the zoomDelta to be applied to scrollZoom?
I know there is a wheelPxPerZoomLevel
option – it’s based on L.DomEvent.getWheelDelta
, but:
map.on('zoomstart',(e)=>{console.log('zoomstart',e,L.DomEvent.getWheelDelta(e))
map.on('zoom',(e)=>{console.log('zoom',e,L.DomEvent.getWheelDelta(e))})
is always 0
for my scrollzoom 🙁
Can’t I just define: scrollDown equals zoomOut()
?