From 90a6131b809c44810fafc130b750a5f1f67f65a6 Mon Sep 17 00:00:00 2001 From: Christian Hansen Date: Tue, 28 Jan 2025 22:31:09 +0100 Subject: [PATCH] Add iOS trigger repaint method (#3182) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- platform/ios/src/MLNMapView.h | 6 ++++++ platform/ios/src/MLNMapView.mm | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/platform/ios/src/MLNMapView.h b/platform/ios/src/MLNMapView.h index 7e8423c68..395c58efb 100644 --- a/platform/ios/src/MLNMapView.h +++ b/platform/ios/src/MLNMapView.h @@ -2121,6 +2121,12 @@ vertically on the map. @property (nonatomic) MLNMapDebugMaskOptions debugMask; - (MLNBackendResource *)backendResource; + +/** + Triggers a repaint of the map. +*/ +- (void)triggerRepaint; + @end NS_ASSUME_NONNULL_END diff --git a/platform/ios/src/MLNMapView.mm b/platform/ios/src/MLNMapView.mm index 24dd6128b..d1ec013a2 100644 --- a/platform/ios/src/MLNMapView.mm +++ b/platform/ios/src/MLNMapView.mm @@ -7361,7 +7361,12 @@ static void *windowScreenContext = &windowScreenContext; return _annotationViewReuseQueueByIdentifier[identifier]; } -- (MLNBackendResource*)backendResource { +- (void)triggerRepaint +{ + _mbglMap->triggerRepaint(); +} + +- (MLNBackendResource *)backendResource { return _mbglView->getObject(); } @@ -7526,4 +7531,6 @@ static void *windowScreenContext = &windowScreenContext; self.showsUserHeadingIndicator = showsHeading; } + + @end