ebrelsford / Leaflet.loading

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

Not working with Angular.js? #20

Closed F1LT3R closed 8 years ago

F1LT3R commented 9 years ago

This is a cool addon for Leaflet!

After playing around with it using Angular.js, I could only get it to work with spinner.js using:

      var loadingControl = L.Control.loading({
          spinjs: true
      });
      map.addControl(loadingControl);

But I much prefer the image you use, and not spinner.js. I am wondering if something in Angular is tripping up the normal initialization of this control?

If you have any ideas I would be happy to poke around and create a pull request if I can get it fixed.

ebrelsford commented 9 years ago

@F1LT3R I'm not aware of anything Angular-specific that would stop this from working but I'd appreciate a small example if you have one.

Are you setting the CSS to make the image show up? See the examples for details, specifically these lines.

MarkAPhillips commented 9 years ago

Just to advise I have this working in angularjs with the default icon showing as expected.

ebrelsford commented 9 years ago

Thanks @MarkAPhillips, you didn't have to do anything special did you? If not I think I'll close this, but let me know.

MarkAPhillips commented 9 years ago

Sorry for not coming back to this earlier - I did not do anything different and had the basic functionality working with the default icon as expected. I did though later decide to change to another plugin as this worked better in the angularjs application I was creating but was more down to personal choice and also as I could not get the icon to show correctly all the time for different events.

I decided to use http://makinacorpus.github.io/Leaflet.Spin/ which I found easier to plug in to my application

ebrelsford commented 8 years ago

Closing this as there doesn't seem to be anything to do from this side, please open it back up if I am wrong.