From 0a195ba8b9cde0a282bbe55635ec86e1ae7b9f38 Mon Sep 17 00:00:00 2001 From: Ted Mundy Date: Fri, 27 Feb 2026 16:24:41 +0000 Subject: [PATCH 1/2] feat: add focalpoint to ios --- ios/RNMBX/RNMBXMapView.swift | 10 ++++++++++ src/components/MapView.tsx | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/ios/RNMBX/RNMBXMapView.swift b/ios/RNMBX/RNMBXMapView.swift index 975749088..149ba2351 100644 --- a/ios/RNMBX/RNMBXMapView.swift +++ b/ios/RNMBX/RNMBXMapView.swift @@ -579,6 +579,7 @@ open class RNMBXMapView: UIView, RCTInvalidating { var panEnabled: Bool? = nil; var panDecelerationFactor: CGFloat? = nil; var simultaneousRotateAndPinchZoomEnabled: Bool? = nil; + var focalPoint: CGPoint? = nil; } var gestureSettings = GestureSettings() @@ -626,6 +627,12 @@ open class RNMBXMapView: UIView, RCTInvalidating { if let simultaneousRotateAndPinchZoomEnabled = value["simultaneousRotateAndPinchZoomEnabled"] as? NSNumber { options.simultaneousRotateAndPinchZoomEnabled = simultaneousRotateAndPinchZoomEnabled.boolValue } + if let focalPoint = value["focalPoint"] as? NSDictionary { + if let x = focalPoint["x"] as? NSNumber, let y = focalPoint["y"] as? NSNumber { + options.focalPoint = CGPoint(x: x.doubleValue, y: y.doubleValue) + } + } + /* android only if let zoomAnimationAmount = value["zoomAnimationAmount"] as? NSNumber { options.zoomAnimationAmount = zoomAnimationAmount.CGFloat @@ -674,6 +681,9 @@ open class RNMBXMapView: UIView, RCTInvalidating { if let simultaneousRotateAndPinchZoomEnabled = settings.simultaneousRotateAndPinchZoomEnabled as? Bool { options.simultaneousRotateAndPinchZoomEnabled = simultaneousRotateAndPinchZoomEnabled } + if let focalPoint = settings.focalPoint as? CGPoint { + options.focalPoint = focalPoint + } /* android only if let zoomAnimationAmount = value["zoomAnimationAmount"] as? NSNumber { options.zoomAnimationAmount = zoomAnimationAmount.CGFloat diff --git a/src/components/MapView.tsx b/src/components/MapView.tsx index b458c8517..aac8a18d0 100644 --- a/src/components/MapView.tsx +++ b/src/components/MapView.tsx @@ -74,6 +74,12 @@ export type GestureSettings = { * Whether single tapping the map with two touches results in a zoom-out animation. */ doubleTouchToZoomOutEnabled?: boolean; + /** + * By default, gestures rotate and zoom around the center of the gesture. Set + * this property to rotate and zoom around a fixed point instead. + */ + focalPoint?: Point; + /** * Whether pan/scroll is enabled for the pinch gesture. */ From f03cd3b9876de7ab82b6e5d4172402ed793ec86e Mon Sep 17 00:00:00 2001 From: Ted Mundy Date: Fri, 27 Feb 2026 16:36:04 +0000 Subject: [PATCH 2/2] feat(docs): yarn generate --- docs/MapView.md | 2 ++ docs/docs.json | 7 +++++++ src/components/MapView.tsx | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/MapView.md b/docs/MapView.md index d2ad2d0c8..69ec2c9e8 100644 --- a/docs/MapView.md +++ b/docs/MapView.md @@ -289,6 +289,8 @@ Set map's label locale, e.g. `{ "locale": "es" }` will localize labels to Spanis type GestureSettings = { doubleTapToZoomInEnabled: boolean; /* Whether double tapping the map with one touch results in a zoom-in animation. */ doubleTouchToZoomOutEnabled: boolean; /* Whether single tapping the map with two touches results in a zoom-out animation. */ + focalPoint: signature; /* By default, gestures rotate and zoom around the center of the gesture. Set +this property to rotate and zoom around a fixed point instead. */ pinchPanEnabled: boolean; /* Whether pan/scroll is enabled for the pinch gesture. */ pinchZoomEnabled: boolean; /* Whether zoom is enabled for the pinch gesture. */ pinchZoomDecelerationEnabled: boolean; /* Whether a deceleration animation following a pinch-zoom gesture is enabled. True by default. diff --git a/docs/docs.json b/docs/docs.json index d10948f88..52fa80e6a 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -5308,6 +5308,13 @@ "default": "none", "description": "Whether single tapping the map with two touches results in a zoom-out animation." }, + { + "name": "focalPoint", + "required": false, + "type": "signature", + "default": "none", + "description": "By default, gestures rotate and zoom around the center of the gesture. Set\nthis property to rotate and zoom around a fixed point instead." + }, { "name": "pinchPanEnabled", "required": false, diff --git a/src/components/MapView.tsx b/src/components/MapView.tsx index aac8a18d0..a1bcb8ee8 100644 --- a/src/components/MapView.tsx +++ b/src/components/MapView.tsx @@ -77,8 +77,8 @@ export type GestureSettings = { /** * By default, gestures rotate and zoom around the center of the gesture. Set * this property to rotate and zoom around a fixed point instead. - */ - focalPoint?: Point; + */ + focalPoint?: Point; /** * Whether pan/scroll is enabled for the pinch gesture.