-
Notifications
You must be signed in to change notification settings - Fork 49
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Wrong event counting if IDs equal #26
Comments
Thanks for reporting this, do you have a specific example of this breaking? The project actually started with a simple counter as you suggest. The reason we switched to IDs is mentioned in #1: Leaflet tile layers (for example) will emit As for |
Hm.. sounds to me like the tile layer events of Leaflet are a bit broken. There should be only a single Your idea with using IDs for dataloading as well would solve the issue of course, but it's a lot more effort to implement and not a common thing to do in my opinion. By the way I'm not sure what the best solution here is except fixing leaflet. But I won't put IDs on my events all over the place, in some cases it is quite hard to manage the relationship of two events like that. |
I think it has more to do with the fact that That said, I did not write Leaflet, I just try to maintain this loading indicator plugin for it, so I'm not all that interested in how "broken" you think Leaflet is. Feel free to complain in the appropriate forum. As for fixing the issue at hand, I'm very much open to counter-proposals and pull requests. |
I had a look in the leaflet master (to be 1.0) at tile/GridLayer.js, and Am 07.12.2015 um 15:39 schrieb Eric Brelsford:
|
This control works based on an internal map that stores an event ID according to this code:
This is quite problematic I think. The problem is, when I fire multiple
dataloading
events on the map instance, then these are registered as a single event only since the ID is identical for all of them (it is the map id) and therefore the spinner disappears once the firstdataload
event comes in, even though it should have been waiting for the others if it had counted correctly.Why is this based on IDs anyway? It could be a simple counter, couldn't it? To not break the API and remove all the "loader" management functions (like
addLoader
andremoveLoader
), the plugin could store counts for each loader id instead of justtrue
. Then this would support the case above and be fully backwards compatible.The text was updated successfully, but these errors were encountered: