tombatossals/angular-leaflet-directive — pull request #414 by NOtherDev (2014-07-07 11:56:23+00:00)
Title: added floating point numbers rounding to avoid infinite digest cycle when moveend updates center in the URL which then triggers map move in turn

Similar to issue #254, but probably not exactly the same.

I had an infinite digest loop on random map movements and zooms with URL center functionality turned on. The `moveend` map event handler publishes the event to update the URL, which is rounded to 4 decimal points and gets published as new center, which in turn makes map move again and trigger `moveend` event eventually. In bad cases it ended up in Angular detecting infinite cycle.

My change is to ignore the least meaningful decimals when handling map movements the same way they are currently ignored for URL hash. The change solved the issue for me.

I've also tried to reflect the issue in existing unit tests.