react-native-google-maps-plus 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +4 -4
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +5 -5
- package/android/src/main/java/com/rngooglemapsplus/extensions/CameraPositionExtension.kt +2 -3
- package/android/src/main/java/com/rngooglemapsplus/extensions/{RNCameraExtension.kt → RNCameraUpdateExtension.kt} +2 -2
- package/ios/GoogleMapViewImpl.swift +4 -4
- package/ios/RNGoogleMapsPlusView.swift +5 -5
- package/ios/extensions/GMSCameraPosition+Extension.swift +2 -2
- package/ios/extensions/{RNCamera+Extension.swift → RNCameraUpdate+Extension.swift} +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +6 -6
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +3 -3
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.cpp +4 -4
- package/nitrogen/generated/android/c++/{JFunc_void_RNRegion_RNCameraChange.hpp → JFunc_void_RNRegion_RNCamera.hpp} +21 -21
- package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera_bool.hpp +82 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +49 -49
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +9 -9
- package/nitrogen/generated/android/c++/JRNCamera.hpp +15 -16
- package/nitrogen/generated/android/c++/JRNCameraUpdate.hpp +71 -0
- package/nitrogen/generated/android/c++/JRNInitialProps.hpp +6 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_RNRegion_RNCameraChange.kt → Func_void_RNRegion_RNCamera.kt} +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_RNRegion_RNCameraChange_bool.kt → Func_void_RNRegion_RNCamera_bool.kt} +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +13 -13
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCamera.kt +5 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{RNCameraChange.kt → RNCameraUpdate.kt} +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNInitialProps.kt +2 -2
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +8 -8
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +46 -46
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +3 -3
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +15 -15
- package/nitrogen/generated/ios/swift/{Func_void_RNRegion_RNCameraChange.swift → Func_void_RNRegion_RNCamera.swift} +10 -10
- package/nitrogen/generated/ios/swift/{Func_void_RNRegion_RNCameraChange_bool.swift → Func_void_RNRegion_RNCamera_bool.swift} +10 -10
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +5 -5
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +45 -45
- package/nitrogen/generated/ios/swift/RNCamera.swift +14 -62
- package/nitrogen/generated/ios/swift/RNCameraUpdate.swift +116 -0
- package/nitrogen/generated/ios/swift/RNInitialProps.swift +6 -6
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +15 -15
- package/nitrogen/generated/shared/c++/RNCamera.hpp +17 -18
- package/nitrogen/generated/shared/c++/RNCameraUpdate.hpp +89 -0
- package/nitrogen/generated/shared/c++/RNInitialProps.hpp +8 -8
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +8 -8
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +5 -5
- package/package.json +1 -1
- package/src/RNGoogleMapsPlusView.nitro.ts +10 -6
- package/src/types.ts +3 -3
- package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCameraChange_bool.hpp +0 -82
- package/nitrogen/generated/android/c++/JRNCameraChange.hpp +0 -70
- package/nitrogen/generated/ios/swift/RNCameraChange.swift +0 -68
- package/nitrogen/generated/shared/c++/RNCameraChange.hpp +0 -88
|
@@ -619,14 +619,14 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
-
public final var onMapLoaded: bridge.
|
|
622
|
+
public final var onMapLoaded: bridge.std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______ {
|
|
623
623
|
@inline(__always)
|
|
624
624
|
get {
|
|
625
|
-
return { () -> bridge.
|
|
625
|
+
return { () -> bridge.std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______ in
|
|
626
626
|
if let __unwrappedValue = self.__implementation.onMapLoaded {
|
|
627
|
-
return bridge.
|
|
628
|
-
let __closureWrapper =
|
|
629
|
-
return bridge.
|
|
627
|
+
return bridge.create_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______({ () -> bridge.Func_void_RNRegion_RNCamera in
|
|
628
|
+
let __closureWrapper = Func_void_RNRegion_RNCamera(__unwrappedValue)
|
|
629
|
+
return bridge.create_Func_void_RNRegion_RNCamera(__closureWrapper.toUnsafe())
|
|
630
630
|
}())
|
|
631
631
|
} else {
|
|
632
632
|
return .init()
|
|
@@ -635,12 +635,12 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
635
635
|
}
|
|
636
636
|
@inline(__always)
|
|
637
637
|
set {
|
|
638
|
-
self.__implementation.onMapLoaded = { () -> ((_ region: RNRegion, _ camera:
|
|
639
|
-
if bridge.
|
|
640
|
-
let __unwrapped = bridge.
|
|
641
|
-
return { () -> (RNRegion,
|
|
642
|
-
let __wrappedFunction = bridge.
|
|
643
|
-
return { (__region: RNRegion, __camera:
|
|
638
|
+
self.__implementation.onMapLoaded = { () -> ((_ region: RNRegion, _ camera: RNCamera) -> Void)? in
|
|
639
|
+
if bridge.has_value_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______(newValue) {
|
|
640
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______(newValue)
|
|
641
|
+
return { () -> (RNRegion, RNCamera) -> Void in
|
|
642
|
+
let __wrappedFunction = bridge.wrap_Func_void_RNRegion_RNCamera(__unwrapped)
|
|
643
|
+
return { (__region: RNRegion, __camera: RNCamera) -> Void in
|
|
644
644
|
__wrappedFunction.call(__region, __camera)
|
|
645
645
|
}
|
|
646
646
|
}()
|
|
@@ -1259,14 +1259,14 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
1259
1259
|
}
|
|
1260
1260
|
}
|
|
1261
1261
|
|
|
1262
|
-
public final var onCameraChangeStart: bridge.
|
|
1262
|
+
public final var onCameraChangeStart: bridge.std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______ {
|
|
1263
1263
|
@inline(__always)
|
|
1264
1264
|
get {
|
|
1265
|
-
return { () -> bridge.
|
|
1265
|
+
return { () -> bridge.std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______ in
|
|
1266
1266
|
if let __unwrappedValue = self.__implementation.onCameraChangeStart {
|
|
1267
|
-
return bridge.
|
|
1268
|
-
let __closureWrapper =
|
|
1269
|
-
return bridge.
|
|
1267
|
+
return bridge.create_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______({ () -> bridge.Func_void_RNRegion_RNCamera_bool in
|
|
1268
|
+
let __closureWrapper = Func_void_RNRegion_RNCamera_bool(__unwrappedValue)
|
|
1269
|
+
return bridge.create_Func_void_RNRegion_RNCamera_bool(__closureWrapper.toUnsafe())
|
|
1270
1270
|
}())
|
|
1271
1271
|
} else {
|
|
1272
1272
|
return .init()
|
|
@@ -1275,12 +1275,12 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
1275
1275
|
}
|
|
1276
1276
|
@inline(__always)
|
|
1277
1277
|
set {
|
|
1278
|
-
self.__implementation.onCameraChangeStart = { () -> ((_ region: RNRegion, _ camera:
|
|
1279
|
-
if bridge.
|
|
1280
|
-
let __unwrapped = bridge.
|
|
1281
|
-
return { () -> (RNRegion,
|
|
1282
|
-
let __wrappedFunction = bridge.
|
|
1283
|
-
return { (__region: RNRegion, __camera:
|
|
1278
|
+
self.__implementation.onCameraChangeStart = { () -> ((_ region: RNRegion, _ camera: RNCamera, _ isGesture: Bool) -> Void)? in
|
|
1279
|
+
if bridge.has_value_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______(newValue) {
|
|
1280
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______(newValue)
|
|
1281
|
+
return { () -> (RNRegion, RNCamera, Bool) -> Void in
|
|
1282
|
+
let __wrappedFunction = bridge.wrap_Func_void_RNRegion_RNCamera_bool(__unwrapped)
|
|
1283
|
+
return { (__region: RNRegion, __camera: RNCamera, __isGesture: Bool) -> Void in
|
|
1284
1284
|
__wrappedFunction.call(__region, __camera, __isGesture)
|
|
1285
1285
|
}
|
|
1286
1286
|
}()
|
|
@@ -1291,14 +1291,14 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
1293
|
|
|
1294
|
-
public final var onCameraChange: bridge.
|
|
1294
|
+
public final var onCameraChange: bridge.std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______ {
|
|
1295
1295
|
@inline(__always)
|
|
1296
1296
|
get {
|
|
1297
|
-
return { () -> bridge.
|
|
1297
|
+
return { () -> bridge.std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______ in
|
|
1298
1298
|
if let __unwrappedValue = self.__implementation.onCameraChange {
|
|
1299
|
-
return bridge.
|
|
1300
|
-
let __closureWrapper =
|
|
1301
|
-
return bridge.
|
|
1299
|
+
return bridge.create_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______({ () -> bridge.Func_void_RNRegion_RNCamera_bool in
|
|
1300
|
+
let __closureWrapper = Func_void_RNRegion_RNCamera_bool(__unwrappedValue)
|
|
1301
|
+
return bridge.create_Func_void_RNRegion_RNCamera_bool(__closureWrapper.toUnsafe())
|
|
1302
1302
|
}())
|
|
1303
1303
|
} else {
|
|
1304
1304
|
return .init()
|
|
@@ -1307,12 +1307,12 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
1307
1307
|
}
|
|
1308
1308
|
@inline(__always)
|
|
1309
1309
|
set {
|
|
1310
|
-
self.__implementation.onCameraChange = { () -> ((_ region: RNRegion, _ camera:
|
|
1311
|
-
if bridge.
|
|
1312
|
-
let __unwrapped = bridge.
|
|
1313
|
-
return { () -> (RNRegion,
|
|
1314
|
-
let __wrappedFunction = bridge.
|
|
1315
|
-
return { (__region: RNRegion, __camera:
|
|
1310
|
+
self.__implementation.onCameraChange = { () -> ((_ region: RNRegion, _ camera: RNCamera, _ isGesture: Bool) -> Void)? in
|
|
1311
|
+
if bridge.has_value_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______(newValue) {
|
|
1312
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______(newValue)
|
|
1313
|
+
return { () -> (RNRegion, RNCamera, Bool) -> Void in
|
|
1314
|
+
let __wrappedFunction = bridge.wrap_Func_void_RNRegion_RNCamera_bool(__unwrapped)
|
|
1315
|
+
return { (__region: RNRegion, __camera: RNCamera, __isGesture: Bool) -> Void in
|
|
1316
1316
|
__wrappedFunction.call(__region, __camera, __isGesture)
|
|
1317
1317
|
}
|
|
1318
1318
|
}()
|
|
@@ -1323,14 +1323,14 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
1325
|
|
|
1326
|
-
public final var onCameraChangeComplete: bridge.
|
|
1326
|
+
public final var onCameraChangeComplete: bridge.std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______ {
|
|
1327
1327
|
@inline(__always)
|
|
1328
1328
|
get {
|
|
1329
|
-
return { () -> bridge.
|
|
1329
|
+
return { () -> bridge.std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______ in
|
|
1330
1330
|
if let __unwrappedValue = self.__implementation.onCameraChangeComplete {
|
|
1331
|
-
return bridge.
|
|
1332
|
-
let __closureWrapper =
|
|
1333
|
-
return bridge.
|
|
1331
|
+
return bridge.create_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______({ () -> bridge.Func_void_RNRegion_RNCamera_bool in
|
|
1332
|
+
let __closureWrapper = Func_void_RNRegion_RNCamera_bool(__unwrappedValue)
|
|
1333
|
+
return bridge.create_Func_void_RNRegion_RNCamera_bool(__closureWrapper.toUnsafe())
|
|
1334
1334
|
}())
|
|
1335
1335
|
} else {
|
|
1336
1336
|
return .init()
|
|
@@ -1339,12 +1339,12 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
1339
1339
|
}
|
|
1340
1340
|
@inline(__always)
|
|
1341
1341
|
set {
|
|
1342
|
-
self.__implementation.onCameraChangeComplete = { () -> ((_ region: RNRegion, _ camera:
|
|
1343
|
-
if bridge.
|
|
1344
|
-
let __unwrapped = bridge.
|
|
1345
|
-
return { () -> (RNRegion,
|
|
1346
|
-
let __wrappedFunction = bridge.
|
|
1347
|
-
return { (__region: RNRegion, __camera:
|
|
1342
|
+
self.__implementation.onCameraChangeComplete = { () -> ((_ region: RNRegion, _ camera: RNCamera, _ isGesture: Bool) -> Void)? in
|
|
1343
|
+
if bridge.has_value_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______(newValue) {
|
|
1344
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera_____bool____isGesture______(newValue)
|
|
1345
|
+
return { () -> (RNRegion, RNCamera, Bool) -> Void in
|
|
1346
|
+
let __wrappedFunction = bridge.wrap_Func_void_RNRegion_RNCamera_bool(__unwrapped)
|
|
1347
|
+
return { (__region: RNRegion, __camera: RNCamera, __isGesture: Bool) -> Void in
|
|
1348
1348
|
__wrappedFunction.call(__region, __camera, __isGesture)
|
|
1349
1349
|
}
|
|
1350
1350
|
}()
|
|
@@ -1379,7 +1379,7 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
1379
1379
|
}
|
|
1380
1380
|
|
|
1381
1381
|
@inline(__always)
|
|
1382
|
-
public final func setCamera(camera:
|
|
1382
|
+
public final func setCamera(camera: RNCameraUpdate, animated: bridge.std__optional_bool_, durationMs: bridge.std__optional_double_) -> bridge.Result_void_ {
|
|
1383
1383
|
do {
|
|
1384
1384
|
try self.__implementation.setCamera(camera: camera, animated: { () -> Bool? in
|
|
1385
1385
|
if bridge.has_value_std__optional_bool_(animated) {
|
|
@@ -18,99 +18,51 @@ public extension RNCamera {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `RNCamera`.
|
|
20
20
|
*/
|
|
21
|
-
init(center: RNLatLng
|
|
22
|
-
self.init(
|
|
23
|
-
if let __unwrappedValue = center {
|
|
24
|
-
return bridge.create_std__optional_RNLatLng_(__unwrappedValue)
|
|
25
|
-
} else {
|
|
26
|
-
return .init()
|
|
27
|
-
}
|
|
28
|
-
}(), { () -> bridge.std__optional_double_ in
|
|
29
|
-
if let __unwrappedValue = zoom {
|
|
30
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
|
-
} else {
|
|
32
|
-
return .init()
|
|
33
|
-
}
|
|
34
|
-
}(), { () -> bridge.std__optional_double_ in
|
|
35
|
-
if let __unwrappedValue = bearing {
|
|
36
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
37
|
-
} else {
|
|
38
|
-
return .init()
|
|
39
|
-
}
|
|
40
|
-
}(), { () -> bridge.std__optional_double_ in
|
|
41
|
-
if let __unwrappedValue = tilt {
|
|
42
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
43
|
-
} else {
|
|
44
|
-
return .init()
|
|
45
|
-
}
|
|
46
|
-
}())
|
|
21
|
+
init(center: RNLatLng, zoom: Double, bearing: Double, tilt: Double) {
|
|
22
|
+
self.init(center, zoom, bearing, tilt)
|
|
47
23
|
}
|
|
48
24
|
|
|
49
|
-
var center: RNLatLng
|
|
25
|
+
var center: RNLatLng {
|
|
50
26
|
@inline(__always)
|
|
51
27
|
get {
|
|
52
|
-
return self.__center
|
|
28
|
+
return self.__center
|
|
53
29
|
}
|
|
54
30
|
@inline(__always)
|
|
55
31
|
set {
|
|
56
|
-
self.__center =
|
|
57
|
-
if let __unwrappedValue = newValue {
|
|
58
|
-
return bridge.create_std__optional_RNLatLng_(__unwrappedValue)
|
|
59
|
-
} else {
|
|
60
|
-
return .init()
|
|
61
|
-
}
|
|
62
|
-
}()
|
|
32
|
+
self.__center = newValue
|
|
63
33
|
}
|
|
64
34
|
}
|
|
65
35
|
|
|
66
|
-
var zoom: Double
|
|
36
|
+
var zoom: Double {
|
|
67
37
|
@inline(__always)
|
|
68
38
|
get {
|
|
69
|
-
return self.__zoom
|
|
39
|
+
return self.__zoom
|
|
70
40
|
}
|
|
71
41
|
@inline(__always)
|
|
72
42
|
set {
|
|
73
|
-
self.__zoom =
|
|
74
|
-
if let __unwrappedValue = newValue {
|
|
75
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
76
|
-
} else {
|
|
77
|
-
return .init()
|
|
78
|
-
}
|
|
79
|
-
}()
|
|
43
|
+
self.__zoom = newValue
|
|
80
44
|
}
|
|
81
45
|
}
|
|
82
46
|
|
|
83
|
-
var bearing: Double
|
|
47
|
+
var bearing: Double {
|
|
84
48
|
@inline(__always)
|
|
85
49
|
get {
|
|
86
|
-
return self.__bearing
|
|
50
|
+
return self.__bearing
|
|
87
51
|
}
|
|
88
52
|
@inline(__always)
|
|
89
53
|
set {
|
|
90
|
-
self.__bearing =
|
|
91
|
-
if let __unwrappedValue = newValue {
|
|
92
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
93
|
-
} else {
|
|
94
|
-
return .init()
|
|
95
|
-
}
|
|
96
|
-
}()
|
|
54
|
+
self.__bearing = newValue
|
|
97
55
|
}
|
|
98
56
|
}
|
|
99
57
|
|
|
100
|
-
var tilt: Double
|
|
58
|
+
var tilt: Double {
|
|
101
59
|
@inline(__always)
|
|
102
60
|
get {
|
|
103
|
-
return self.__tilt
|
|
61
|
+
return self.__tilt
|
|
104
62
|
}
|
|
105
63
|
@inline(__always)
|
|
106
64
|
set {
|
|
107
|
-
self.__tilt =
|
|
108
|
-
if let __unwrappedValue = newValue {
|
|
109
|
-
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
110
|
-
} else {
|
|
111
|
-
return .init()
|
|
112
|
-
}
|
|
113
|
-
}()
|
|
65
|
+
self.__tilt = newValue
|
|
114
66
|
}
|
|
115
67
|
}
|
|
116
68
|
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNCameraUpdate.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RNCameraUpdate`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNCameraUpdate = margelo.nitro.rngooglemapsplus.RNCameraUpdate
|
|
14
|
+
|
|
15
|
+
public extension RNCameraUpdate {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNCameraUpdate`.
|
|
20
|
+
*/
|
|
21
|
+
init(center: RNLatLng?, zoom: Double?, bearing: Double?, tilt: Double?) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_RNLatLng_ in
|
|
23
|
+
if let __unwrappedValue = center {
|
|
24
|
+
return bridge.create_std__optional_RNLatLng_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
29
|
+
if let __unwrappedValue = zoom {
|
|
30
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
35
|
+
if let __unwrappedValue = bearing {
|
|
36
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
41
|
+
if let __unwrappedValue = tilt {
|
|
42
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}())
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var center: RNLatLng? {
|
|
50
|
+
@inline(__always)
|
|
51
|
+
get {
|
|
52
|
+
return self.__center.value
|
|
53
|
+
}
|
|
54
|
+
@inline(__always)
|
|
55
|
+
set {
|
|
56
|
+
self.__center = { () -> bridge.std__optional_RNLatLng_ in
|
|
57
|
+
if let __unwrappedValue = newValue {
|
|
58
|
+
return bridge.create_std__optional_RNLatLng_(__unwrappedValue)
|
|
59
|
+
} else {
|
|
60
|
+
return .init()
|
|
61
|
+
}
|
|
62
|
+
}()
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var zoom: Double? {
|
|
67
|
+
@inline(__always)
|
|
68
|
+
get {
|
|
69
|
+
return self.__zoom.value
|
|
70
|
+
}
|
|
71
|
+
@inline(__always)
|
|
72
|
+
set {
|
|
73
|
+
self.__zoom = { () -> bridge.std__optional_double_ in
|
|
74
|
+
if let __unwrappedValue = newValue {
|
|
75
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
76
|
+
} else {
|
|
77
|
+
return .init()
|
|
78
|
+
}
|
|
79
|
+
}()
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
var bearing: Double? {
|
|
84
|
+
@inline(__always)
|
|
85
|
+
get {
|
|
86
|
+
return self.__bearing.value
|
|
87
|
+
}
|
|
88
|
+
@inline(__always)
|
|
89
|
+
set {
|
|
90
|
+
self.__bearing = { () -> bridge.std__optional_double_ in
|
|
91
|
+
if let __unwrappedValue = newValue {
|
|
92
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
93
|
+
} else {
|
|
94
|
+
return .init()
|
|
95
|
+
}
|
|
96
|
+
}()
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
var tilt: Double? {
|
|
101
|
+
@inline(__always)
|
|
102
|
+
get {
|
|
103
|
+
return self.__tilt.value
|
|
104
|
+
}
|
|
105
|
+
@inline(__always)
|
|
106
|
+
set {
|
|
107
|
+
self.__tilt = { () -> bridge.std__optional_double_ in
|
|
108
|
+
if let __unwrappedValue = newValue {
|
|
109
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
110
|
+
} else {
|
|
111
|
+
return .init()
|
|
112
|
+
}
|
|
113
|
+
}()
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -18,7 +18,7 @@ public extension RNInitialProps {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `RNInitialProps`.
|
|
20
20
|
*/
|
|
21
|
-
init(mapId: String?, liteMode: Bool?, camera:
|
|
21
|
+
init(mapId: String?, liteMode: Bool?, camera: RNCameraUpdate?, backgroundColor: String?) {
|
|
22
22
|
self.init({ () -> bridge.std__optional_std__string_ in
|
|
23
23
|
if let __unwrappedValue = mapId {
|
|
24
24
|
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
@@ -31,9 +31,9 @@ public extension RNInitialProps {
|
|
|
31
31
|
} else {
|
|
32
32
|
return .init()
|
|
33
33
|
}
|
|
34
|
-
}(), { () -> bridge.
|
|
34
|
+
}(), { () -> bridge.std__optional_RNCameraUpdate_ in
|
|
35
35
|
if let __unwrappedValue = camera {
|
|
36
|
-
return bridge.
|
|
36
|
+
return bridge.create_std__optional_RNCameraUpdate_(__unwrappedValue)
|
|
37
37
|
} else {
|
|
38
38
|
return .init()
|
|
39
39
|
}
|
|
@@ -94,16 +94,16 @@ public extension RNInitialProps {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
var camera:
|
|
97
|
+
var camera: RNCameraUpdate? {
|
|
98
98
|
@inline(__always)
|
|
99
99
|
get {
|
|
100
100
|
return self.__camera.value
|
|
101
101
|
}
|
|
102
102
|
@inline(__always)
|
|
103
103
|
set {
|
|
104
|
-
self.__camera = { () -> bridge.
|
|
104
|
+
self.__camera = { () -> bridge.std__optional_RNCameraUpdate_ in
|
|
105
105
|
if let __unwrappedValue = newValue {
|
|
106
|
-
return bridge.
|
|
106
|
+
return bridge.create_std__optional_RNCameraUpdate_(__unwrappedValue)
|
|
107
107
|
} else {
|
|
108
108
|
return .init()
|
|
109
109
|
}
|
|
@@ -45,8 +45,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLocationConfig; }
|
|
|
45
45
|
namespace margelo::nitro::rngooglemapsplus { enum class RNMapErrorCode; }
|
|
46
46
|
// Forward declaration of `RNRegion` to properly resolve imports.
|
|
47
47
|
namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
|
|
48
|
-
// Forward declaration of `
|
|
49
|
-
namespace margelo::nitro::rngooglemapsplus { struct
|
|
48
|
+
// Forward declaration of `RNCamera` to properly resolve imports.
|
|
49
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
|
|
50
50
|
// Forward declaration of `RNLocation` to properly resolve imports.
|
|
51
51
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocation; }
|
|
52
52
|
// Forward declaration of `RNLocationErrorCode` to properly resolve imports.
|
|
@@ -57,8 +57,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
|
57
57
|
namespace margelo::nitro::rngooglemapsplus { struct RNIndoorBuilding; }
|
|
58
58
|
// Forward declaration of `RNIndoorLevel` to properly resolve imports.
|
|
59
59
|
namespace margelo::nitro::rngooglemapsplus { struct RNIndoorLevel; }
|
|
60
|
-
// Forward declaration of `
|
|
61
|
-
namespace margelo::nitro::rngooglemapsplus { struct
|
|
60
|
+
// Forward declaration of `RNCameraUpdate` to properly resolve imports.
|
|
61
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNCameraUpdate; }
|
|
62
62
|
// Forward declaration of `RNLatLngBounds` to properly resolve imports.
|
|
63
63
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLngBounds; }
|
|
64
64
|
// Forward declaration of `RNSnapshotOptions` to properly resolve imports.
|
|
@@ -86,13 +86,13 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult;
|
|
|
86
86
|
#include "RNMapErrorCode.hpp"
|
|
87
87
|
#include <functional>
|
|
88
88
|
#include "RNRegion.hpp"
|
|
89
|
-
#include "
|
|
89
|
+
#include "RNCamera.hpp"
|
|
90
90
|
#include "RNLocation.hpp"
|
|
91
91
|
#include "RNLocationErrorCode.hpp"
|
|
92
92
|
#include "RNLatLng.hpp"
|
|
93
93
|
#include "RNIndoorBuilding.hpp"
|
|
94
94
|
#include "RNIndoorLevel.hpp"
|
|
95
|
-
#include "
|
|
95
|
+
#include "RNCameraUpdate.hpp"
|
|
96
96
|
#include "RNLatLngBounds.hpp"
|
|
97
97
|
#include <NitroModules/Promise.hpp>
|
|
98
98
|
#include "RNSnapshotOptions.hpp"
|
|
@@ -167,8 +167,8 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
167
167
|
virtual void setOnMapError(const std::optional<std::function<void(RNMapErrorCode /* error */)>>& onMapError) = 0;
|
|
168
168
|
virtual std::optional<std::function<void(bool /* ready */)>> getOnMapReady() = 0;
|
|
169
169
|
virtual void setOnMapReady(const std::optional<std::function<void(bool /* ready */)>>& onMapReady) = 0;
|
|
170
|
-
virtual std::optional<std::function<void(const RNRegion& /* region */, const
|
|
171
|
-
virtual void setOnMapLoaded(const std::optional<std::function<void(const RNRegion& /* region */, const
|
|
170
|
+
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>> getOnMapLoaded() = 0;
|
|
171
|
+
virtual void setOnMapLoaded(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>& onMapLoaded) = 0;
|
|
172
172
|
virtual std::optional<std::function<void(const RNLocation& /* location */)>> getOnLocationUpdate() = 0;
|
|
173
173
|
virtual void setOnLocationUpdate(const std::optional<std::function<void(const RNLocation& /* location */)>>& onLocationUpdate) = 0;
|
|
174
174
|
virtual std::optional<std::function<void(RNLocationErrorCode /* error */)>> getOnLocationError() = 0;
|
|
@@ -207,18 +207,18 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
207
207
|
virtual void setOnMyLocationPress(const std::optional<std::function<void(const RNLocation& /* location */)>>& onMyLocationPress) = 0;
|
|
208
208
|
virtual std::optional<std::function<void(bool /* pressed */)>> getOnMyLocationButtonPress() = 0;
|
|
209
209
|
virtual void setOnMyLocationButtonPress(const std::optional<std::function<void(bool /* pressed */)>>& onMyLocationButtonPress) = 0;
|
|
210
|
-
virtual std::optional<std::function<void(const RNRegion& /* region */, const
|
|
211
|
-
virtual void setOnCameraChangeStart(const std::optional<std::function<void(const RNRegion& /* region */, const
|
|
212
|
-
virtual std::optional<std::function<void(const RNRegion& /* region */, const
|
|
213
|
-
virtual void setOnCameraChange(const std::optional<std::function<void(const RNRegion& /* region */, const
|
|
214
|
-
virtual std::optional<std::function<void(const RNRegion& /* region */, const
|
|
215
|
-
virtual void setOnCameraChangeComplete(const std::optional<std::function<void(const RNRegion& /* region */, const
|
|
210
|
+
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>> getOnCameraChangeStart() = 0;
|
|
211
|
+
virtual void setOnCameraChangeStart(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>& onCameraChangeStart) = 0;
|
|
212
|
+
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>> getOnCameraChange() = 0;
|
|
213
|
+
virtual void setOnCameraChange(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>& onCameraChange) = 0;
|
|
214
|
+
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>> getOnCameraChangeComplete() = 0;
|
|
215
|
+
virtual void setOnCameraChangeComplete(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>& onCameraChangeComplete) = 0;
|
|
216
216
|
|
|
217
217
|
public:
|
|
218
218
|
// Methods
|
|
219
219
|
virtual void showMarkerInfoWindow(const std::string& id) = 0;
|
|
220
220
|
virtual void hideMarkerInfoWindow(const std::string& id) = 0;
|
|
221
|
-
virtual void setCamera(const
|
|
221
|
+
virtual void setCamera(const RNCameraUpdate& camera, std::optional<bool> animated, std::optional<double> durationMs) = 0;
|
|
222
222
|
virtual void setCameraToCoordinates(const std::vector<RNLatLng>& coordinates, const std::optional<RNMapPadding>& padding, std::optional<bool> animated, std::optional<double> durationMs) = 0;
|
|
223
223
|
virtual void setCameraBounds(const std::optional<RNLatLngBounds>& bounds) = 0;
|
|
224
224
|
virtual void animateToBounds(const RNLatLngBounds& bounds, std::optional<double> padding, std::optional<double> durationMs, std::optional<bool> lockBounds) = 0;
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
28
28
|
|
|
29
29
|
#include "RNLatLng.hpp"
|
|
30
|
-
#include <optional>
|
|
31
30
|
|
|
32
31
|
namespace margelo::nitro::rngooglemapsplus {
|
|
33
32
|
|
|
@@ -36,14 +35,14 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
36
35
|
*/
|
|
37
36
|
struct RNCamera {
|
|
38
37
|
public:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
RNLatLng center SWIFT_PRIVATE;
|
|
39
|
+
double zoom SWIFT_PRIVATE;
|
|
40
|
+
double bearing SWIFT_PRIVATE;
|
|
41
|
+
double tilt SWIFT_PRIVATE;
|
|
43
42
|
|
|
44
43
|
public:
|
|
45
44
|
RNCamera() = default;
|
|
46
|
-
explicit RNCamera(
|
|
45
|
+
explicit RNCamera(RNLatLng center, double zoom, double bearing, double tilt): center(center), zoom(zoom), bearing(bearing), tilt(tilt) {}
|
|
47
46
|
};
|
|
48
47
|
|
|
49
48
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -56,18 +55,18 @@ namespace margelo::nitro {
|
|
|
56
55
|
static inline margelo::nitro::rngooglemapsplus::RNCamera fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
57
56
|
jsi::Object obj = arg.asObject(runtime);
|
|
58
57
|
return margelo::nitro::rngooglemapsplus::RNCamera(
|
|
59
|
-
JSIConverter<
|
|
60
|
-
JSIConverter<
|
|
61
|
-
JSIConverter<
|
|
62
|
-
JSIConverter<
|
|
58
|
+
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "center")),
|
|
59
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "zoom")),
|
|
60
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "bearing")),
|
|
61
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "tilt"))
|
|
63
62
|
);
|
|
64
63
|
}
|
|
65
64
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNCamera& arg) {
|
|
66
65
|
jsi::Object obj(runtime);
|
|
67
|
-
obj.setProperty(runtime, "center", JSIConverter<
|
|
68
|
-
obj.setProperty(runtime, "zoom", JSIConverter<
|
|
69
|
-
obj.setProperty(runtime, "bearing", JSIConverter<
|
|
70
|
-
obj.setProperty(runtime, "tilt", JSIConverter<
|
|
66
|
+
obj.setProperty(runtime, "center", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.center));
|
|
67
|
+
obj.setProperty(runtime, "zoom", JSIConverter<double>::toJSI(runtime, arg.zoom));
|
|
68
|
+
obj.setProperty(runtime, "bearing", JSIConverter<double>::toJSI(runtime, arg.bearing));
|
|
69
|
+
obj.setProperty(runtime, "tilt", JSIConverter<double>::toJSI(runtime, arg.tilt));
|
|
71
70
|
return obj;
|
|
72
71
|
}
|
|
73
72
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -78,10 +77,10 @@ namespace margelo::nitro {
|
|
|
78
77
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
79
78
|
return false;
|
|
80
79
|
}
|
|
81
|
-
if (!JSIConverter<
|
|
82
|
-
if (!JSIConverter<
|
|
83
|
-
if (!JSIConverter<
|
|
84
|
-
if (!JSIConverter<
|
|
80
|
+
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "center"))) return false;
|
|
81
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "zoom"))) return false;
|
|
82
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "bearing"))) return false;
|
|
83
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "tilt"))) return false;
|
|
85
84
|
return true;
|
|
86
85
|
}
|
|
87
86
|
};
|