Skip to content

Instantly share code, notes, and snippets.

@aliang
Created June 4, 2014 00:00
Show Gist options
  • Save aliang/209642a42e4d443f65db to your computer and use it in GitHub Desktop.
Save aliang/209642a42e4d443f65db to your computer and use it in GitHub Desktop.
Disable all (or almost all!) leaflet map events
// Assumes your L.Map is called "map". Untested!
map.dragging.disable();
map.touchZoom.disable();
map.doubleClickZoom.disable();
map.scrollWheelZoom.disable();
map.boxZoom.disable();
map.keyboard.disable();
if (map.tap) {
map.tap.disable();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment