From 1777b907743bf855ced0404aefcb3545f1fa7022 Mon Sep 17 00:00:00 2001 From: Samuel Brucksch Date: Thu, 27 Aug 2026 10:44:17 +0200 Subject: [PATCH] feat(ios): forward mapViewImpl prop so RNMBXMapViewFactory is usable on iOS RNMBXMapViewFactory.register is public and RNMBXMapView.createMapView() already prefers a factory-built MapView, but nothing assigned RNMBXMapView.mapViewImpl on iOS, so the hook could never be reached from JS. The prop is declared in the specs and forwarded on Android (RNMBXMapViewManager.setMapViewImpl), so this only brings iOS in line. Assigned before -didSetProps:, which is where createMapView() runs. --- ios/RNMBX/RNMBXMapViewComponentView.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ios/RNMBX/RNMBXMapViewComponentView.mm b/ios/RNMBX/RNMBXMapViewComponentView.mm index 88035f9de..1fae034a3 100644 --- a/ios/RNMBX/RNMBXMapViewComponentView.mm +++ b/ios/RNMBX/RNMBXMapViewComponentView.mm @@ -222,6 +222,12 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & RNMBX_OPTIONAL_PROP_BOOL(deselectAnnotationOnTap); + // Has to be set before -didSetProps: below, which is where the MapView is created. + id mapViewImpl = RNMBXConvertFollyDynamicToId(newViewProps.mapViewImpl); + if (mapViewImpl != nil) { + _view.mapViewImpl = mapViewImpl; + } + id styleURL = RNMBXConvertFollyDynamicToId(newViewProps.styleURL); if (styleURL != nil) { if (_lastStyleURL == nil || ![_lastStyleURL isEqual:styleURL]) {