Missing support for the scrollWheelZoom map option
eriknaslund opened this issue · 4 comments
Steps to Reproduce
- Try to make use of the
scrollWheelZoom
property to disable scroll wheel zooming (https://leafletjs.com/reference-1.7.1.html)
Expected Results
- It should be possible, and easy, to disabled scroll wheel zooming.
Actual Results
- I would have to use
$refs
, get the map object and modify it manually? Apart from that option I don't think it's doable right now?
Hi @eKIK , thanks for the report. Is your issue that the option is not reactive to changes made after creating the map, or is setting its value in the map options not working for you when you create the map?
If the latter, would you be able to provide a codesandbox or jsfiddle demonstrating the problem? Here is a demonstration where it does work as expected as a starting point, if that helps: https://codesandbox.io/s/v2l-disable-scrollwheel-2ch5e?file=/src/App.vue
Hi there @mikeu!
Don't I feel silly right now...
I completely missed that fact that I could set options
on the map component and that those would be passed through to the underlying leaflet map. I've switched to the method you suggested and it's working like a charm!
I'll withdraw my PR, since the already supported way is a much nicer way of dealing with my use case.
What's your take on extending the documentation a bit for the options
object?
I think what's tripped me up is that I tried searching the docs, but all I could find was this:
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
options | object | - | {} |
I realise now that I should have dug a bit deeper into the code there and then, to figure out what this options
object really was.
To help others avoid the same mistake I did, what do you think about documenting it with a brief explanation like "Options which will be passed through to the underlying leaflet map.", or perhaps even putting it in the FAQ since that's a common place to look when you can't figure out how to do things.
What do you think?