Skip to content

Commit

Permalink
feat(ios): implement onTilesRendered for MapKit
Browse files Browse the repository at this point in the history
  • Loading branch information
monholm committed May 10, 2023
1 parent 9ce06d5 commit 1f43340
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions ios/Maps/RNMMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ extern const NSInteger RNMMapMaxZoomLevel;
@property (nonatomic, copy) RCTDirectEventBlock onMarkerDragEnd;
@property (nonatomic, copy) RCTDirectEventBlock onCalloutPress;
@property (nonatomic, copy) RCTDirectEventBlock onRegionChange;
@property (nonatomic, copy) RCTBubblingEventBlock onTilesRendered;
@property (nonatomic, copy) RCTBubblingEventBlock onUserLocationChange;

- (void)cacheViewIfNeeded;
Expand Down
6 changes: 5 additions & 1 deletion ios/Maps/RNMMapManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ - (UIView *)view
RCT_EXPORT_VIEW_PROPERTY(onMarkerSelect, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onTilesRendered, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(pitchEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(rotateEnabled, BOOL)
Expand Down Expand Up @@ -551,9 +552,12 @@ - (void)mapViewWillStartRenderingMap:(RNMMap *)mapView
[mapView beginLoading];
}

- (void)mapViewDidFinishRenderingMap:(RNMMap *)mapView fullyRendered:(BOOL)fullyRendered
- (void)mapViewDidFinishRenderingMap:(RNMMap *)mapView fullyRendered:(__unused BOOL)fullyRendered
{
[mapView finishLoading];
if (mapView.onTilesRendered) {
mapView.onTilesRendered(@{});
}
}

#pragma mark Private
Expand Down

0 comments on commit 1f43340

Please sign in to comment.