Skip to content
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

Improved Loading State Tracking #1

Merged
merged 3 commits into from
Jun 27, 2013
Merged

Conversation

nickiaconis
Copy link
Contributor

Instead of using a tally of items that are loading, store a hash of id:boolean pairs, each pair representing the loading state of one item. This is particularly useful when a layer does not finish loading all tiles before dispatching a new loading event.

Instead of using a tally of items that are loading, store a hash of
id:boolean pairs, each pair representing the loading state of one item.
Change to use more efficient loop structure.
I understand Leaflet Events better now. This removes some silliness I
added due to my lack of knowledge.
@ebrelsford
Copy link
Owner

This is great, @codefox421! I changed the code a bit to make it IE 7/8 compatible (as Leaflet is or tries to be) in d052a17, but I think it's a little clearer, too. Will get at the other two PRs soon.

Please use four spaces instead of hard tabs for consistency. I'm going to document that for other contributors. Otherwise, thanks a ton!

@nickiaconis
Copy link
Contributor Author

Thank you for the compatibility fix! I was considering removing Object.keys myself, but I didn't find it necessary mostly because I didn't know about the lack of support in IE 7/8. Anyhow, your new method of checking the loading state and updating the indicator is much more elegant.

Duly noted about the spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants