vue-leaflet/Vue2Leaflet

Missing support for the scrollWheelZoom map option

eriknaslund opened this issue · 4 comments

Steps to Reproduce

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?
mikeu commented

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

Ekik commented

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?

mikeu commented

@eKIK no worries, glad to hear that it's working for you at any rate! I agree, the existing documentation around the options prop is rather lacking. Hopefully the change I've just submitted in #626 does a better job at it. Thanks for the feedback!

Ekik commented

The #626 PR looks great @mikeu - spot on! Thanks for jumping on it so quickly, I did not expect that 👍