angular-ui / ui-leaflet

AngularJS directive to embed an interact with maps managed by Leaflet library
http://angular-ui.github.io/ui-leaflet
Other
314 stars 134 forks source link

leaflet event indicating markers are loaded #330

Open vvavepacket opened 7 years ago

vvavepacket commented 7 years ago

Let's say we have hundreds of markers rendering on the screen. Is there any ui-leaflet event fired which indicates all markers has been rendered/loaded or we can say, the map is ready?

BAByrne commented 7 years ago

ui-leaflet doesn't really make it's own events, afaik. It just relays some of the ones that are sent by leaflet itself. With that being the case, the only event ui-leaflet could tie into is the individual marker-add event. You could keep tabs on the markers that should be loaded with an array and remove them from the array as they fire the marker-add event. When your array is empty, you'll know they're all added.