emilhe / dash-leaflet

MIT License
204 stars 33 forks source link

Expose `loading` event in TileLayer and WMSTileLayer #208

Open prl900 opened 9 months ago

prl900 commented 9 months ago

The TileLayer and WMSTileLayer expose the n_loads prop that fires when the loading has been completed. However, there seems to be no way of firing a callback when the loading process starts.

This is useful for creating spinners that notify users that loading is in progress.

The Leaflet library documents the loading event, which is used to notify when the layer loading process starts. See example here

I wonder if there is a way in dash-leaflet to fire a callback when a TileLayer or WMSTileLayer starts loading. I have tried the alternative of using the map bounds property but sometimes, small pannings do not request new tiles.

Any ideas to get this working would be greatly appreciated.