File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,17 @@ - (UIView *)view
97
97
RCT_EXPORT_VIEW_PROPERTY(onMarkerDrag, RCTDirectEventBlock)
98
98
RCT_EXPORT_VIEW_PROPERTY(onMarkerDragEnd, RCTDirectEventBlock)
99
99
RCT_EXPORT_VIEW_PROPERTY(onCalloutPress, RCTDirectEventBlock)
100
- RCT_EXPORT_VIEW_PROPERTY(initialRegion, MKCoordinateRegion)
100
+ RCT_CUSTOM_VIEW_PROPERTY(initialRegion, MKCoordinateRegion, AIRMap)
101
+ {
102
+ if (json == nil ) return ;
103
+
104
+ // don't emit region change events when we are setting the initialRegion
105
+ BOOL originalIgnore = view.ignoreRegionChanges ;
106
+ view.ignoreRegionChanges = YES ;
107
+ [view setInitialRegion: [RCTConvert MKCoordinateRegion: json]];
108
+ view.ignoreRegionChanges = originalIgnore;
109
+ }
110
+
101
111
RCT_EXPORT_VIEW_PROPERTY (minZoomLevel, CGFloat )
102
112
RCT_EXPORT_VIEW_PROPERTY(maxZoomLevel, CGFloat )
103
113
@@ -665,7 +675,7 @@ - (void)mapViewDidFinishRenderingMap:(AIRMap *)mapView fullyRendered:(BOOL)fully
665
675
{
666
676
[mapView finishLoading ];
667
677
[mapView cacheViewIfNeeded ];
668
-
678
+
669
679
mapView.onMapReady (@{});
670
680
}
671
681
You can’t perform that action at this time.
0 commit comments