-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a "layers" parameter to "Evented#on" #1002
Comments
This may be tricky, because you need to reparse tiles when |
We should do this as soon as #2224 lands |
layer
/layers
parameter for delegated events
Playing with v0.35 and pretty happy about this change. Any plans to support multiple layers to query with |
Seems like a doable enhancement to me -- @jfirebaugh did you encounter any subtleties in implementing this that would make this problematic? |
Looks like a one-line change to me since underlying |
Yeah, should be straightforward. @arthurhammer can you open a new issue so we don't lose track of the request? |
Done in #4578. Thanks! |
Map events should accept an optional second parameter which is the name of a layer or an array of layer names for which to delegate events. Internally, this would bind an event handler that uses
featuresAt
and dispatches the event only when it matches features from the given layer(s). The features themselves would be passed as a member of the event object. For example:This should not require setting
interactive: true
for each layer separately; binding a delegated event should automatically enable interactivity for the specified layers.The text was updated successfully, but these errors were encountered: