makinacorpus / Leaflet.Spin

Show a spinner on the map using Spin.js
http://makinacorpus.github.io/Leaflet.Spin/
MIT License
134 stars 49 forks source link

Can we show spinner while zooming? #17

Closed jeevasusej closed 7 years ago

jeevasusej commented 7 years ago

Can we show spinner while zooming?

leplatrem commented 7 years ago

Yes, I think so, if Leaflet triggers the appropriate events :)

SBats commented 7 years ago

Yep, definitely! You can use zoomstart and zoomend events of leaflet like this :

map.on('zoomstart', function () {
    map.spin(true);
} );
map.on('zoomend', function () {
    map.spin(false);
} );