I am trying to use Leaflet.Spin in R Shiny to show the spinner when adding layers to the map. I've done this by setting up events as suggested here and shown below.
I'm having trouble because this.spin(true) increments this._spinning while this.spin(false) decrements it. If I remove more layers than I add then this._spinning remains above zero and the spinner doesn't switch off. How would I fix this? Thanks!
I am trying to use Leaflet.Spin in R Shiny to show the spinner when adding layers to the map. I've done this by setting up events as suggested here and shown below.
I'm having trouble because this.spin(true) increments this._spinning while this.spin(false) decrements it. If I remove more layers than I add then this._spinning remains above zero and the spinner doesn't switch off. How would I fix this? Thanks!