Leaflet icon indicating copy to clipboard operation
Leaflet copied to clipboard

More Granular Rotate Events

Open marioatmicello opened this issue 8 years ago • 2 comments

Currently there is one event which fires inside the setBearing function. In the case of the touchRotate feature, this event fires repeatedly making it hard to react to the event with a single decisive response since it is harder to know when the rotation has completed.

This request for feature is:

Have multiple rotate related events including rotateStart, rotateMove, rotateEnd which fire when the map is being rotated as opposed to just the one event which fires at the end of the setBearing function call.

marioatmicello avatar Nov 14 '16 22:11 marioatmicello

That sounds like a nice idea, rotateMove would probably just be "rotate" though. Also, you could use a throttle / debounce function too, depending on what you are trying to achieve

fnicollet avatar Nov 14 '16 22:11 fnicollet

True, a throttle / debounce approach would totally work. It would just be really nice to not have to do that and just let the rotation actions dictate the end. Thanks for considering!

marioatmicello avatar Nov 14 '16 23:11 marioatmicello