v-leaflet - can we disable scroll to zoom on Lmap ?

HI

We want to disable scroll to zoom on Lmap component. we just want to use +/- buttons on top left to scroll map.

Please suggest.

Thanks,
Venkat

Hi,

That haven’t passed my mind as a feature. Do you happen to know if this easily possible with plain Leaflet? If it its, it should be easy to implement. An other option would be to hack the Leaflet JS itself.

cheers,
matti

Hi Matti,

Could you please tell me where should I change the javascript and how can we integrate it with the vaadin add-on.

We need to disable zoom on scroll only when we add Lmap component as part of page., if we add the same Lmap in full screen we need to re-enable the zoom on scroll. ( if you scroll the page in tablet , it is actually zooming the component so we want to disable zoom on scroll continue scrolling the page… when we display the same component on fullscreen by clicking on name , we need to re-enable it)

Please suggest.

Thanks,
Venkat

16007.js (122 KB)

Hi,

There is a GWT resourcebundle that loads the script into the host page. But do you really need to change the leaflet script itself? Did you go through the API docs of LeafletJS? I’d bet that is somehow possible with Leaflets flexible APIs. We’d just need to add GWT wrappers for that API and crete server side hooks to access them from Vaadin code.

cheers,
matti