From d0cbac6f0971cafac0010ea724f9b66589fbafbb Mon Sep 17 00:00:00 2001 From: Harry Lachenmayer Date: Wed, 28 Mar 2018 15:00:35 +0200 Subject: [PATCH] Fix initialRegion when using RN 0.54 (#2131) * Fix initialRegion being zoomed out as described in https://github.com/react-community/react-native-maps/issues/2100 * Start ignoring setInitialRegion calls once the map view is in the window rather than when the map is ready --- lib/ios/AirGoogleMaps/AIRGoogleMap.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ios/AirGoogleMaps/AIRGoogleMap.m b/lib/ios/AirGoogleMaps/AIRGoogleMap.m index dd8b4e344..521143a54 100644 --- a/lib/ios/AirGoogleMaps/AIRGoogleMap.m +++ b/lib/ios/AirGoogleMaps/AIRGoogleMap.m @@ -199,7 +199,7 @@ - (void)didMoveToWindow { - (void)setInitialRegion:(MKCoordinateRegion)initialRegion { if (_initialRegionSetOnLoad) return; _initialRegion = initialRegion; - _initialRegionSetOnLoad = true; + _initialRegionSetOnLoad = _didMoveToWindow; self.camera = [AIRGoogleMap makeGMSCameraPositionFromMap:self andMKCoordinateRegion:initialRegion]; }