diff options
Diffstat (limited to 'platform/macos')
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 14 | ||||
-rw-r--r-- | platform/macos/src/MGLMapViewDelegate.h | 13 | ||||
-rw-r--r-- | platform/macos/test/MGLMapViewDelegateIntegrationTests.swift | 2 |
3 files changed, 29 insertions, 0 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 2f379ab406..eb877216d2 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -934,6 +934,16 @@ public: } } +- (void)mapViewDidEnterIdle { + if (!_mbglMap) { + return; + } + + if ([self.delegate respondsToSelector:@selector(mapViewDidEnterIdle)]) { + [self.delegate mapViewDidEnterIdle:self]; + } +} + - (void)mapViewDidFinishLoadingStyle { if (!_mbglMap) { return; @@ -3050,6 +3060,10 @@ public: bool fullyRendered = mode == mbgl::MapObserver::RenderMode::Full; [nativeView mapViewDidFinishRenderingMapFullyRendered:fullyRendered]; } + + void onDidEnterIdle() override { + [nativeView mapViewDidEnterIdle]; + } void onDidFinishLoadingStyle() override { [nativeView mapViewDidFinishLoadingStyle]; diff --git a/platform/macos/src/MGLMapViewDelegate.h b/platform/macos/src/MGLMapViewDelegate.h index 2a8b28c1b4..ad59f5bd39 100644 --- a/platform/macos/src/MGLMapViewDelegate.h +++ b/platform/macos/src/MGLMapViewDelegate.h @@ -152,6 +152,19 @@ NS_ASSUME_NONNULL_BEGIN - (void)mapViewDidFinishRenderingFrame:(MGLMapView *)mapView fullyRendered:(BOOL)fullyRendered; /** + Tells the delegate that the map view is entering an idle state, and no more + drawing will be necessary until new data is loaded or there is some interaction + with the map. + + - No camera transitions are in progress + - All currently requested tiles have loaded + - All fade/transition animations have completed + + @param mapView The map view that has just entered the idle state. + */ +- (void)mapViewDidEnterIdle:(MGLMapView *)mapView; + +/** Tells the delegate that the map has just finished loading a style. This method is called during the initialization of the map view and after any diff --git a/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift b/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift index 00635d97eb..109c279a09 100644 --- a/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift +++ b/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift @@ -24,6 +24,8 @@ extension MGLMapViewDelegateIntegrationTests: MGLMapViewDelegate { func mapViewDidFinishRenderingFrame(_ mapView: MGLMapView, fullyRendered: Bool) {} func mapViewDidFinishRenderingMap(_ mapView: MGLMapView, fullyRendered: Bool) {} + + func mapViewDidEnterIdle(_ mapView: MGLMapView) {} func mapViewDidFailLoadingMap(_ mapView: MGLMapView, withError error: Error) {} |