-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TileLayer loading event fired before layeradd event #2967
Comments
|
+1 to asking the question but not having a clear solution. I'm using the plugin Leaflet.Loading which also suffers from this issue (ebrelsford/Leaflet.loading#28) I also considered using Leaflet.Spin plugin which looks like it would have the same issue. The hack fix is to peek at _loading when the listener receives the layeradd event. Could this kind of fix be put into _layerAdd? Or would it be feasible to have layeradd fire before loading is called? |
From what I gather, you want to add a |
Like @perliedman described, the listener can be added in the initHook:
|
Fiddle of the issue http://jsfiddle.net/ventralnet/rnp2f769/
Notice that the 'loading' event is not logged to the console. This is because the loading event fires before the layeradd event is fired
I came across this issue when trying to incorporate a loading indicator to display when layers are loading. Do you think this is a valid issue?
The text was updated successfully, but these errors were encountered: