You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.
I know the way bounds and center was reworked recently. One side effect of this improvement is that after the inital load of my map, the bounds are not set. It is not until I pan or zoom the map that the bounds are set.
I did a little initial investigation and it seems that the listener for the "boundsChanged" event in the bounds directive is not set up in time for the initial broadcast of this event when the center is set in the center directive. The listener is inside a Map.whenReady promise and the map is not ready when the initial center is set.
If I move the code that sets up the listener to just after the getMap promise it seems to work ok. I thought this may be safe because we shouldn't get a boundsChanged event until the map and the centerController are ready anyway. However, I am not familiar enough with the code to know the potential downsides to this. I have applied this patch in my fork and am using it in my project until there is a more permanent fix in this project.
From @jasadams on March 25, 2014 13:22
I know the way bounds and center was reworked recently. One side effect of this improvement is that after the inital load of my map, the bounds are not set. It is not until I pan or zoom the map that the bounds are set.
I did a little initial investigation and it seems that the listener for the "boundsChanged" event in the bounds directive is not set up in time for the initial broadcast of this event when the center is set in the center directive. The listener is inside a Map.whenReady promise and the map is not ready when the initial center is set.
Copied from original issue: tombatossals/angular-leaflet-directive#340
The text was updated successfully, but these errors were encountered: