leaflet-interact-intent

Interact with a map when a user intends it.

UNLICENSE License

Downloads
7
Stars
8

Interact intent: a plugin for Leaflet.

This plugin attempts to enable map interaction when a user wants to interacts with a map. Page scrolling should work without unintentionaly zooming when a map is reached on a page.

Want to see it in action? Check out the demo

Usage

<link href='leaflet-interact-intent.css' rel='stylesheet' />
<script src='leaflet-interact-intent.js'></script>

<script>
  var map = L.map('map');
  new leafletInteractIntent().addTo(map)
</script>

Options

You can also pass an option to trigger interaction on click.

var map = L.map('map');
new leafletInteractIntent({
    clicktoplay: true
}).addTo(map)

Building

npm install && make

ProTip You may want to install watch so you can run watch make without needing to execute make on every change.