Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios] Force update from display link when display link is created. (#…
Browse files Browse the repository at this point in the history
…5164)

This forces the call of the map view's display link target when the
display link is created. When a map view is shown the first time
this is not required. However, if the display link was torn down
and then recreated due to the map view being removed / obscured in the
view hierarchy the map view delegate may expect to be informed when
the map view did finish loading the map when it is shown again.

This adds a call to `updateFromDisplayLink` just after a display link
is created which helps trigger a full refresh of the map in the sense
that all delegate methods get exercised including
`mapViewDidFinishLoadingMap`.
  • Loading branch information
boundsj committed May 28, 2016
1 parent 9db75f1 commit 6ec9295
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@ - (void)validateDisplayLink
_displayLink.frameInterval = MGLTargetFrameInterval;
[_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
_needsDisplayRefresh = YES;
[self updateFromDisplayLink];
}
else if ( ! isVisible && _displayLink)
{
Expand Down

0 comments on commit 6ec9295

Please sign in to comment.