ebrelsford / Leaflet.loading

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

Use `eachLayer` #10

Closed nickiaconis closed 11 years ago

nickiaconis commented 11 years ago

Utilize Leaflet's built-in eachLayer function when iterating through layers.

Additionally, test if a layer's on or off method exists before trying to invoke it.

ebrelsford commented 11 years ago

Good catch! Odd that this function is documented for L.LayerGroup, but not on L.Map.