From fe92d590bbe23748c691aa991f5608409a4b5924 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Thu, 26 May 2016 16:34:26 -0700 Subject: [ios] Force update from display link when display link is created. 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`. --- platform/ios/src/MGLMapView.mm | 1 + 1 file changed, 1 insertion(+) (limited to 'platform') diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 359827ae61..57e59be10d 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -913,6 +913,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) _displayLink.frameInterval = MGLTargetFrameInterval; [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; _needsDisplayRefresh = YES; + [self updateFromDisplayLink]; } else if ( ! isVisible && _displayLink) { -- cgit v1.2.1