November Perfect Moustache

    leaflet-event-forwarder

    0.0.3 • Public • Published

    leaflet-event-forwarder NPM version NPM Downloads

    A plugin for leaflet v1^.

    Catches unhandled canvas layer events and re-dispatches them to the next pane in a container.

    Example use:

    const map = L.map("map");
    // prepare a container to hold our z stackable layer panes
    const container = map.createPane('stack-container');
     
    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

    License

    Apache 2

    Install

    npm i leaflet-event-forwarder

    DownloadsWeekly Downloads

    87

    Version

    0.0.3

    License

    Apache-2.0

    Unpacked Size

    37.8 kB

    Total Files

    8

    Last publish

    Collaborators

    • danwild