Saturday 9 April 2016

Disable double click zoom event in Leaflet for R


Is there a way to disable the double click zoom in Leaflet for R?


I've created a Shiny app that changes polygon styles when a country's region is clicked on/off. If you select and immediately deselect the same polygon, the map zooms in. I want to disable this feature so that there's no wonky zooming!


According to leaflet.js documentation, you can disable this feature in JavaScript. Leaflet for R refers to this documentation when I try to search for the solution within R, which is completely unhelpful.



Answer



There is the option doubleClickZoom = FALSE :


leaflet(data,options = leafletOptions(doubleClickZoom= FALSE)) %>% ...


Other options can be found here : Disable leaflet interaction temporary


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...