Answer the question
In order to leave comments, you need to log in
How in leaflet.js to remove the response to the map when scrolling the page?
Hello, I have a map made with leaflet.js. The problem is that when scrolling the page with the mouse wheel, when you get to the map, it stops on it and changes the scale. How to make sure that when scrolling the page there is no reaction to the map?
Answer the question
In order to leave comments, you need to log in
zoomControl: false Removes the zoom completely.
scrollWheelZoom: false - disables the wheel itself.
Can be enabled on focus or click.
map.on('click', function() {
if (!map.scrollWheelZoom.enabled()) {
map.scrollWheelZoom.enable();
}
});
map.on('mouseout', function() {
map.scrollWheelZoom.disable();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question