Code Monkey home page Code Monkey logo

leaflet-event-forwarder's Introduction

leaflet-event-forwarder NPM version NPM Downloads

A plugin for leaflet v1^.

Catches unhandled canvas layer events and re-dispatches them to the next layer in the stack.

Example use:

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

License

Apache 2

leaflet-event-forwarder's People

Contributors

danwild avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

leaflet-event-forwarder's Issues

Unable to install the plugin

Hi! Thank you for developing this plugins. This is right what we need. However, I tried to install it by copying the dist folder and it complains about 'define' is not defined (line 21). Perhaps I did not install it properly.

Could you show me how to install it? Thanks in advance!

change the mouse cursor on mouseover

Hi,
I just found this useful plugin and I wonder if there is a way to change the mouse cursor to the pointing finger cursor if I hover over a map element underneath the top canvas layer.
The click event handler works like a charm and the cursor changes on the top layer as expected, but it looks a little odd to see this open hand cursor over an actual map element (e.g. a polygon) on a bottom layer, falsy indicating that the element is not interactive and if I click it, it shows me e.g. a pop-up message.

I've not tested the plugin with Tooltips, but they should also be displayed if I hover over them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.