From 0d3b1d7f3aee2cb6e6b3fe3e0eaaa950cc7f59dc Mon Sep 17 00:00:00 2001 From: Alex Cristici Date: Fri, 17 May 2024 19:53:03 +0300 Subject: [PATCH] Style switching delay fix when annotations are visible (#2395) --- platform/ios/src/MLNMapView.mm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/ios/src/MLNMapView.mm b/platform/ios/src/MLNMapView.mm index 01f41e79d..a1eb98c00 100644 --- a/platform/ios/src/MLNMapView.mm +++ b/platform/ios/src/MLNMapView.mm @@ -6955,6 +6955,13 @@ static void *windowScreenContext = &windowScreenContext; if (annotationView) { + // Reset the center to zero in order to force the annotation view to redraw even when is not moving. + // This will force somehow the map view to display the rendered drawable for older devices. + // This is a fix for the following issues: + // https://github.com/maplibre/maplibre-native/issues/2337 + // https://github.com/maplibre/maplibre-native/issues/2380 + annotationView.center = CGPointZero; + annotationView.center = MLNPointRounded([self convertCoordinate:annotationContext.annotation.coordinate toPointToView:self]); haveVisibleAnnotationViews = true; }