ebrelsford / Leaflet.loading

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

Enable loading control addition after map initialization #3

Closed nickiaconis closed 11 years ago

nickiaconis commented 11 years ago

In some cases, adding a control via options passed to map create is not an option. Hence, the ability to add the loading control via map.addControl should be available. This achieves that.

Currently, this includes code that doesn't make sense without the changes made as part of Improved Loading State Tracking. However, it would not be difficult to change that if ex post facto control addition is desired without the loading state hash.

nickiaconis commented 11 years ago

I've added the option to remove the control from the map, which makes sense if the option of adding it is available. This also lead me to merge your recent changes and tidy things up a bit.

ebrelsford commented 11 years ago

Merged in 4b9ae836, tweaked a bit in 824457c. Will get to #2 soon. Thanks again!

nickiaconis commented 11 years ago

Hm... it looks like you merged 4ea5165, but a60f866 adds support for removing the control, which makes sense to have given the ability to add the control at any time. Then commit f157735 fixed up a few bugs. I'll put together a new branch to add those things back in and open a new pull request once it's ready. Something weird seems to have happen when I merged with your master branch in the middle of this branch's history.

ebrelsford commented 11 years ago

You're right, I missed those two. I didn't see them so I didn't pull them. I'm in the middle of merging them back in now.

nickiaconis commented 11 years ago

Actually, I've just opened a separate pull request. It might be best to go that route. There's something fishy going on with the commits I merged from your master branch. I would advise keeping this PR where it is and using the new request to merge the changes.

ebrelsford commented 11 years ago

Agreed. Thanks.