Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danwild/leaflet-event-forwarder
Catches unhandled canvas layer events and re-dispatches them to the next layer in the stack
https://github.com/danwild/leaflet-event-forwarder
canvas events leaflet leaflet-plugin
Last synced: 3 months ago
JSON representation
Catches unhandled canvas layer events and re-dispatches them to the next layer in the stack
- Host: GitHub
- URL: https://github.com/danwild/leaflet-event-forwarder
- Owner: danwild
- License: apache-2.0
- Created: 2018-09-13T03:20:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-19T23:10:21.000Z (over 6 years ago)
- Last Synced: 2024-11-06T09:48:28.607Z (3 months ago)
- Topics: canvas, events, leaflet, leaflet-plugin
- Language: JavaScript
- Homepage: https://danwild.github.io/leaflet-event-forwarder/
- Size: 55.7 KB
- Stars: 13
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# leaflet-event-forwarder [![NPM version][npm-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url]
A plugin for leaflet `v1^`.
Catches unhandled canvas layer events and re-dispatches them to the next layer in the stack.
## Example use:
```javascript
const map = L.map("map");
const myEventForwarder = new L.eventForwarder({
// ref to leaflet map
map: map,
// events to forward
events: {
click: true,
mousemove: true
},
// throttle options for mousemove events (same as underscore.js)
throttleMs: 100,
throttleOptions: {
leading: true,
trailing: false
}
});// enable event forwarding
myEventForwarder.enable();// disable event forwarding
myEventForwarder.disable();
```## Shouts outs
- Based largely on [this gist](https://gist.github.com/perliedman/84ce01954a1a43252d1b917ec925b3dd)
by [perliedman](https://gist.github.com/perliedman)## License
Apache 2[npm-image]: https://badge.fury.io/js/leaflet-event-forwarder.svg
[npm-url]: https://www.npmjs.com/package/leaflet-event-forwarder
[npm-downloads-image]: https://img.shields.io/npm/dt/leaflet-event-forwarder.svg