fnicollet / Leaflet

:leaves: JavaScript library for mobile-friendly interactive maps
http://leafletjs.com
BSD 2-Clause "Simplified" License
48 stars 20 forks source link

More Granular Rotate Events #14

Open marioatmicello opened 8 years ago

marioatmicello commented 8 years ago

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.

fnicollet commented 8 years ago

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

marioatmicello commented 8 years ago

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!