ebrelsford / Leaflet.loading

A simple loading control for Leaflet
MIT License
143 stars 49 forks source link

Improved Loading State Tracking #1

Closed nickiaconis closed 11 years ago

nickiaconis commented 11 years ago

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.

ebrelsford commented 11 years ago

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 d052a17c, 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 commented 11 years ago

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.