You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@cs09g the demo you linked doesn't include a callback function. That means the code that's trying to invoke the function fails. However, it looks like the linked JSFiddle might be incomplete. Can you check that it is indeed what you intended to post?
The syntax allowing specifying the layer ID is only implemented for on, not for once. It's a little bit unfortunate since the Map object's on method overrides the Evented class' on method, inserting the layerId parameter in the middle. No such override exists for once, which is why it's not listed on the API documentation.
There's an open PR to add this exact functionality if you'd like to give it a review @kkaefer. I worked on it with the author so I can't review it as well. #8875
mapbox-gl-js version:
v1.5.0
browser:
latest chrome
Steps to Trigger Behavior
once
event on the layerLink to Demonstration
https://jsfiddle.net/cs09g/3rdf45ox/
Expected Behavior
the handler should be fired once.
Actual Behavior
error message in console
BTW, is
once
method deprecated? It's missing from API docs.The text was updated successfully, but these errors were encountered: