react-native-google-maps-plus 1.8.0 → 1.8.1
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 +4 -4
- package/android/src/main/java/com/rngooglemapsplus/extensions/CameraPositionExtension.kt +3 -2
- package/ios/GoogleMapViewImpl.swift +8 -5
- package/ios/LocationHandler.swift +3 -1
- package/ios/MapHelper.swift +3 -5
- package/ios/MapMarkerBuilder.swift +98 -98
- package/ios/RNGoogleMapsPlusView.swift +28 -25
- package/ios/extensions/GMSCameraPosition+Extension.swift +2 -2
- package/ios/extensions/SVGKImage+Extension.swift +22 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +5 -5
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +6 -0
- 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_RNCamera.hpp → JFunc_void_RNRegion_RNCameraChange.hpp} +21 -22
- package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCameraChange_bool.hpp +82 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +42 -38
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +8 -8
- package/nitrogen/generated/android/c++/JRNCameraChange.hpp +70 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_RNRegion_RNCamera.kt → Func_void_RNRegion_RNCameraChange.kt} +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_RNRegion_RNCamera_bool.kt → Func_void_RNRegion_RNCameraChange_bool.kt} +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +12 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCameraChange.kt +46 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +8 -8
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +39 -36
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +11 -8
- package/nitrogen/generated/ios/swift/{Func_void_RNRegion_RNCamera.swift → Func_void_RNRegion_RNCameraChange.swift} +10 -10
- package/nitrogen/generated/ios/swift/{Func_void_RNRegion_RNCamera_bool.swift → Func_void_RNRegion_RNCameraChange_bool.swift} +10 -10
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +4 -4
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +44 -44
- package/nitrogen/generated/ios/swift/RNCameraChange.swift +68 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +14 -11
- package/nitrogen/generated/shared/c++/RNCameraChange.hpp +88 -0
- 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 +5 -4
- package/src/types.ts +7 -0
- package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera_bool.hpp +0 -83
|
@@ -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_RNCameraChange_____camera______ {
|
|
623
623
|
@inline(__always)
|
|
624
624
|
get {
|
|
625
|
-
return { () -> bridge.
|
|
625
|
+
return { () -> bridge.std__optional_std__function_void_const_RNRegion_____region_____const_RNCameraChange_____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_RNCameraChange_____camera______({ () -> bridge.Func_void_RNRegion_RNCameraChange in
|
|
628
|
+
let __closureWrapper = Func_void_RNRegion_RNCameraChange(__unwrappedValue)
|
|
629
|
+
return bridge.create_Func_void_RNRegion_RNCameraChange(__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: RNCameraChange) -> Void)? in
|
|
639
|
+
if bridge.has_value_std__optional_std__function_void_const_RNRegion_____region_____const_RNCameraChange_____camera______(newValue) {
|
|
640
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_RNRegion_____region_____const_RNCameraChange_____camera______(newValue)
|
|
641
|
+
return { () -> (RNRegion, RNCameraChange) -> Void in
|
|
642
|
+
let __wrappedFunction = bridge.wrap_Func_void_RNRegion_RNCameraChange(__unwrapped)
|
|
643
|
+
return { (__region: RNRegion, __camera: RNCameraChange) -> 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_RNCameraChange_____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_RNCameraChange_____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_RNCameraChange_____camera_____bool____isGesture______({ () -> bridge.Func_void_RNRegion_RNCameraChange_bool in
|
|
1268
|
+
let __closureWrapper = Func_void_RNRegion_RNCameraChange_bool(__unwrappedValue)
|
|
1269
|
+
return bridge.create_Func_void_RNRegion_RNCameraChange_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: RNCameraChange, _ isGesture: Bool) -> Void)? in
|
|
1279
|
+
if bridge.has_value_std__optional_std__function_void_const_RNRegion_____region_____const_RNCameraChange_____camera_____bool____isGesture______(newValue) {
|
|
1280
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_RNRegion_____region_____const_RNCameraChange_____camera_____bool____isGesture______(newValue)
|
|
1281
|
+
return { () -> (RNRegion, RNCameraChange, Bool) -> Void in
|
|
1282
|
+
let __wrappedFunction = bridge.wrap_Func_void_RNRegion_RNCameraChange_bool(__unwrapped)
|
|
1283
|
+
return { (__region: RNRegion, __camera: RNCameraChange, __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_RNCameraChange_____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_RNCameraChange_____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_RNCameraChange_____camera_____bool____isGesture______({ () -> bridge.Func_void_RNRegion_RNCameraChange_bool in
|
|
1300
|
+
let __closureWrapper = Func_void_RNRegion_RNCameraChange_bool(__unwrappedValue)
|
|
1301
|
+
return bridge.create_Func_void_RNRegion_RNCameraChange_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: RNCameraChange, _ isGesture: Bool) -> Void)? in
|
|
1311
|
+
if bridge.has_value_std__optional_std__function_void_const_RNRegion_____region_____const_RNCameraChange_____camera_____bool____isGesture______(newValue) {
|
|
1312
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_RNRegion_____region_____const_RNCameraChange_____camera_____bool____isGesture______(newValue)
|
|
1313
|
+
return { () -> (RNRegion, RNCameraChange, Bool) -> Void in
|
|
1314
|
+
let __wrappedFunction = bridge.wrap_Func_void_RNRegion_RNCameraChange_bool(__unwrapped)
|
|
1315
|
+
return { (__region: RNRegion, __camera: RNCameraChange, __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_RNCameraChange_____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_RNCameraChange_____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_RNCameraChange_____camera_____bool____isGesture______({ () -> bridge.Func_void_RNRegion_RNCameraChange_bool in
|
|
1332
|
+
let __closureWrapper = Func_void_RNRegion_RNCameraChange_bool(__unwrappedValue)
|
|
1333
|
+
return bridge.create_Func_void_RNRegion_RNCameraChange_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: RNCameraChange, _ isGesture: Bool) -> Void)? in
|
|
1343
|
+
if bridge.has_value_std__optional_std__function_void_const_RNRegion_____region_____const_RNCameraChange_____camera_____bool____isGesture______(newValue) {
|
|
1344
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_RNRegion_____region_____const_RNCameraChange_____camera_____bool____isGesture______(newValue)
|
|
1345
|
+
return { () -> (RNRegion, RNCameraChange, Bool) -> Void in
|
|
1346
|
+
let __wrappedFunction = bridge.wrap_Func_void_RNRegion_RNCameraChange_bool(__unwrapped)
|
|
1347
|
+
return { (__region: RNRegion, __camera: RNCameraChange, __isGesture: Bool) -> Void in
|
|
1348
1348
|
__wrappedFunction.call(__region, __camera, __isGesture)
|
|
1349
1349
|
}
|
|
1350
1350
|
}()
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNCameraChange.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 `RNCameraChange`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNCameraChange = margelo.nitro.rngooglemapsplus.RNCameraChange
|
|
14
|
+
|
|
15
|
+
public extension RNCameraChange {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNCameraChange`.
|
|
20
|
+
*/
|
|
21
|
+
init(center: RNLatLng, zoom: Double, bearing: Double, tilt: Double) {
|
|
22
|
+
self.init(center, zoom, bearing, tilt)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var center: RNLatLng {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return self.__center
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__center = newValue
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var zoom: Double {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return self.__zoom
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__zoom = newValue
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var bearing: Double {
|
|
48
|
+
@inline(__always)
|
|
49
|
+
get {
|
|
50
|
+
return self.__bearing
|
|
51
|
+
}
|
|
52
|
+
@inline(__always)
|
|
53
|
+
set {
|
|
54
|
+
self.__bearing = newValue
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var tilt: Double {
|
|
59
|
+
@inline(__always)
|
|
60
|
+
get {
|
|
61
|
+
return self.__tilt
|
|
62
|
+
}
|
|
63
|
+
@inline(__always)
|
|
64
|
+
set {
|
|
65
|
+
self.__tilt = newValue
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -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 `RNCameraChange` to properly resolve imports.
|
|
49
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNCameraChange; }
|
|
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,6 +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 `RNCamera` to properly resolve imports.
|
|
61
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
|
|
60
62
|
// Forward declaration of `RNLatLngBounds` to properly resolve imports.
|
|
61
63
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLngBounds; }
|
|
62
64
|
// Forward declaration of `RNSnapshotOptions` to properly resolve imports.
|
|
@@ -84,12 +86,13 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult;
|
|
|
84
86
|
#include "RNMapErrorCode.hpp"
|
|
85
87
|
#include <functional>
|
|
86
88
|
#include "RNRegion.hpp"
|
|
87
|
-
#include "
|
|
89
|
+
#include "RNCameraChange.hpp"
|
|
88
90
|
#include "RNLocation.hpp"
|
|
89
91
|
#include "RNLocationErrorCode.hpp"
|
|
90
92
|
#include "RNLatLng.hpp"
|
|
91
93
|
#include "RNIndoorBuilding.hpp"
|
|
92
94
|
#include "RNIndoorLevel.hpp"
|
|
95
|
+
#include "RNCamera.hpp"
|
|
93
96
|
#include "RNLatLngBounds.hpp"
|
|
94
97
|
#include <NitroModules/Promise.hpp>
|
|
95
98
|
#include "RNSnapshotOptions.hpp"
|
|
@@ -164,8 +167,8 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
164
167
|
virtual void setOnMapError(const std::optional<std::function<void(RNMapErrorCode /* error */)>>& onMapError) = 0;
|
|
165
168
|
virtual std::optional<std::function<void(bool /* ready */)>> getOnMapReady() = 0;
|
|
166
169
|
virtual void setOnMapReady(const std::optional<std::function<void(bool /* ready */)>>& onMapReady) = 0;
|
|
167
|
-
virtual std::optional<std::function<void(const RNRegion& /* region */, const
|
|
168
|
-
virtual void setOnMapLoaded(const std::optional<std::function<void(const RNRegion& /* region */, const
|
|
170
|
+
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)>> getOnMapLoaded() = 0;
|
|
171
|
+
virtual void setOnMapLoaded(const std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)>>& onMapLoaded) = 0;
|
|
169
172
|
virtual std::optional<std::function<void(const RNLocation& /* location */)>> getOnLocationUpdate() = 0;
|
|
170
173
|
virtual void setOnLocationUpdate(const std::optional<std::function<void(const RNLocation& /* location */)>>& onLocationUpdate) = 0;
|
|
171
174
|
virtual std::optional<std::function<void(RNLocationErrorCode /* error */)>> getOnLocationError() = 0;
|
|
@@ -204,12 +207,12 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
204
207
|
virtual void setOnMyLocationPress(const std::optional<std::function<void(const RNLocation& /* location */)>>& onMyLocationPress) = 0;
|
|
205
208
|
virtual std::optional<std::function<void(bool /* pressed */)>> getOnMyLocationButtonPress() = 0;
|
|
206
209
|
virtual void setOnMyLocationButtonPress(const std::optional<std::function<void(bool /* pressed */)>>& onMyLocationButtonPress) = 0;
|
|
207
|
-
virtual std::optional<std::function<void(const RNRegion& /* region */, const
|
|
208
|
-
virtual void setOnCameraChangeStart(const std::optional<std::function<void(const RNRegion& /* region */, const
|
|
209
|
-
virtual std::optional<std::function<void(const RNRegion& /* region */, const
|
|
210
|
-
virtual void setOnCameraChange(const std::optional<std::function<void(const RNRegion& /* region */, const
|
|
211
|
-
virtual std::optional<std::function<void(const RNRegion& /* region */, const
|
|
212
|
-
virtual void setOnCameraChangeComplete(const std::optional<std::function<void(const RNRegion& /* region */, const
|
|
210
|
+
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>> getOnCameraChangeStart() = 0;
|
|
211
|
+
virtual void setOnCameraChangeStart(const std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>& onCameraChangeStart) = 0;
|
|
212
|
+
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>> getOnCameraChange() = 0;
|
|
213
|
+
virtual void setOnCameraChange(const std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>& onCameraChange) = 0;
|
|
214
|
+
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>> getOnCameraChangeComplete() = 0;
|
|
215
|
+
virtual void setOnCameraChangeComplete(const std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>& onCameraChangeComplete) = 0;
|
|
213
216
|
|
|
214
217
|
public:
|
|
215
218
|
// Methods
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNCameraChange.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `RNLatLng` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
28
|
+
|
|
29
|
+
#include "RNLatLng.hpp"
|
|
30
|
+
|
|
31
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A struct which can be represented as a JavaScript object (RNCameraChange).
|
|
35
|
+
*/
|
|
36
|
+
struct RNCameraChange {
|
|
37
|
+
public:
|
|
38
|
+
RNLatLng center SWIFT_PRIVATE;
|
|
39
|
+
double zoom SWIFT_PRIVATE;
|
|
40
|
+
double bearing SWIFT_PRIVATE;
|
|
41
|
+
double tilt SWIFT_PRIVATE;
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
RNCameraChange() = default;
|
|
45
|
+
explicit RNCameraChange(RNLatLng center, double zoom, double bearing, double tilt): center(center), zoom(zoom), bearing(bearing), tilt(tilt) {}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
49
|
+
|
|
50
|
+
namespace margelo::nitro {
|
|
51
|
+
|
|
52
|
+
// C++ RNCameraChange <> JS RNCameraChange (object)
|
|
53
|
+
template <>
|
|
54
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNCameraChange> final {
|
|
55
|
+
static inline margelo::nitro::rngooglemapsplus::RNCameraChange fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
56
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
57
|
+
return margelo::nitro::rngooglemapsplus::RNCameraChange(
|
|
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"))
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNCameraChange& arg) {
|
|
65
|
+
jsi::Object obj(runtime);
|
|
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));
|
|
70
|
+
return obj;
|
|
71
|
+
}
|
|
72
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
73
|
+
if (!value.isObject()) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
jsi::Object obj = value.getObject(runtime);
|
|
77
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
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;
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
} // namespace margelo::nitro
|
|
@@ -235,12 +235,12 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
235
235
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapReady: ") + exc.what());
|
|
236
236
|
}
|
|
237
237
|
}()),
|
|
238
|
-
onMapLoaded([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
238
|
+
onMapLoaded([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)>>> {
|
|
239
239
|
try {
|
|
240
240
|
const react::RawValue* rawValue = rawProps.at("onMapLoaded", nullptr, nullptr);
|
|
241
241
|
if (rawValue == nullptr) return sourceProps.onMapLoaded;
|
|
242
242
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
243
|
-
return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
243
|
+
return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMapLoaded);
|
|
244
244
|
} catch (const std::exception& exc) {
|
|
245
245
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapLoaded: ") + exc.what());
|
|
246
246
|
}
|
|
@@ -435,32 +435,32 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
435
435
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMyLocationButtonPress: ") + exc.what());
|
|
436
436
|
}
|
|
437
437
|
}()),
|
|
438
|
-
onCameraChangeStart([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
438
|
+
onCameraChangeStart([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> {
|
|
439
439
|
try {
|
|
440
440
|
const react::RawValue* rawValue = rawProps.at("onCameraChangeStart", nullptr, nullptr);
|
|
441
441
|
if (rawValue == nullptr) return sourceProps.onCameraChangeStart;
|
|
442
442
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
443
|
-
return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
443
|
+
return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCameraChangeStart);
|
|
444
444
|
} catch (const std::exception& exc) {
|
|
445
445
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCameraChangeStart: ") + exc.what());
|
|
446
446
|
}
|
|
447
447
|
}()),
|
|
448
|
-
onCameraChange([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
448
|
+
onCameraChange([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> {
|
|
449
449
|
try {
|
|
450
450
|
const react::RawValue* rawValue = rawProps.at("onCameraChange", nullptr, nullptr);
|
|
451
451
|
if (rawValue == nullptr) return sourceProps.onCameraChange;
|
|
452
452
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
453
|
-
return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
453
|
+
return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCameraChange);
|
|
454
454
|
} catch (const std::exception& exc) {
|
|
455
455
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCameraChange: ") + exc.what());
|
|
456
456
|
}
|
|
457
457
|
}()),
|
|
458
|
-
onCameraChangeComplete([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
458
|
+
onCameraChangeComplete([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> {
|
|
459
459
|
try {
|
|
460
460
|
const react::RawValue* rawValue = rawProps.at("onCameraChangeComplete", nullptr, nullptr);
|
|
461
461
|
if (rawValue == nullptr) return sourceProps.onCameraChangeComplete;
|
|
462
462
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
463
|
-
return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
463
|
+
return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCameraChangeComplete);
|
|
464
464
|
} catch (const std::exception& exc) {
|
|
465
465
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCameraChangeComplete: ") + exc.what());
|
|
466
466
|
}
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
#include "RNMapErrorCode.hpp"
|
|
37
37
|
#include <functional>
|
|
38
38
|
#include "RNRegion.hpp"
|
|
39
|
-
#include "
|
|
39
|
+
#include "RNCameraChange.hpp"
|
|
40
40
|
#include "RNLocation.hpp"
|
|
41
41
|
#include "RNLocationErrorCode.hpp"
|
|
42
42
|
#include "RNLatLng.hpp"
|
|
@@ -87,7 +87,7 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
87
87
|
CachedProp<std::optional<RNLocationConfig>> locationConfig;
|
|
88
88
|
CachedProp<std::optional<std::function<void(RNMapErrorCode /* error */)>>> onMapError;
|
|
89
89
|
CachedProp<std::optional<std::function<void(bool /* ready */)>>> onMapReady;
|
|
90
|
-
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
90
|
+
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)>>> onMapLoaded;
|
|
91
91
|
CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>> onLocationUpdate;
|
|
92
92
|
CachedProp<std::optional<std::function<void(RNLocationErrorCode /* error */)>>> onLocationError;
|
|
93
93
|
CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>> onMapPress;
|
|
@@ -107,9 +107,9 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
107
107
|
CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onInfoWindowLongPress;
|
|
108
108
|
CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>> onMyLocationPress;
|
|
109
109
|
CachedProp<std::optional<std::function<void(bool /* pressed */)>>> onMyLocationButtonPress;
|
|
110
|
-
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
111
|
-
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
112
|
-
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const
|
|
110
|
+
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> onCameraChangeStart;
|
|
111
|
+
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> onCameraChange;
|
|
112
|
+
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> onCameraChangeComplete;
|
|
113
113
|
CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridRNGoogleMapsPlusViewSpec>& /* ref */)>>> hybridRef;
|
|
114
114
|
|
|
115
115
|
private:
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
} from 'react-native-nitro-modules';
|
|
6
6
|
import type {
|
|
7
7
|
RNCamera,
|
|
8
|
+
RNCameraChange,
|
|
8
9
|
RNLatLng,
|
|
9
10
|
RNMapPadding,
|
|
10
11
|
RNPolygon,
|
|
@@ -53,7 +54,7 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
|
|
|
53
54
|
locationConfig?: RNLocationConfig;
|
|
54
55
|
onMapError?: (error: RNMapErrorCode) => void;
|
|
55
56
|
onMapReady?: (ready: boolean) => void;
|
|
56
|
-
onMapLoaded?: (region: RNRegion, camera:
|
|
57
|
+
onMapLoaded?: (region: RNRegion, camera: RNCameraChange) => void;
|
|
57
58
|
onLocationUpdate?: (location: RNLocation) => void;
|
|
58
59
|
onLocationError?: (error: RNLocationErrorCode) => void;
|
|
59
60
|
onMapPress?: (coordinate: RNLatLng) => void;
|
|
@@ -75,17 +76,17 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
|
|
|
75
76
|
onMyLocationButtonPress?: (pressed: boolean) => void;
|
|
76
77
|
onCameraChangeStart?: (
|
|
77
78
|
region: RNRegion,
|
|
78
|
-
camera:
|
|
79
|
+
camera: RNCameraChange,
|
|
79
80
|
isGesture: boolean
|
|
80
81
|
) => void;
|
|
81
82
|
onCameraChange?: (
|
|
82
83
|
region: RNRegion,
|
|
83
|
-
camera:
|
|
84
|
+
camera: RNCameraChange,
|
|
84
85
|
isGesture: boolean
|
|
85
86
|
) => void;
|
|
86
87
|
onCameraChangeComplete?: (
|
|
87
88
|
region: RNRegion,
|
|
88
|
-
camera:
|
|
89
|
+
camera: RNCameraChange,
|
|
89
90
|
isGesture: boolean
|
|
90
91
|
) => void;
|
|
91
92
|
}
|
package/src/types.ts
CHANGED
|
@@ -130,6 +130,13 @@ export interface RNMapStyleElement {
|
|
|
130
130
|
stylers: RNMapStyler[];
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
export type RNCameraChange = {
|
|
134
|
+
center: RNLatLng;
|
|
135
|
+
zoom: number;
|
|
136
|
+
bearing: number;
|
|
137
|
+
tilt: number;
|
|
138
|
+
};
|
|
139
|
+
|
|
133
140
|
export type RNCamera = {
|
|
134
141
|
center?: RNLatLng;
|
|
135
142
|
zoom?: number;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JFunc_void_RNRegion_RNCamera_bool.hpp
|
|
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
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <fbjni/fbjni.h>
|
|
11
|
-
#include <functional>
|
|
12
|
-
|
|
13
|
-
#include "RNRegion.hpp"
|
|
14
|
-
#include "RNCamera.hpp"
|
|
15
|
-
#include <functional>
|
|
16
|
-
#include "JRNRegion.hpp"
|
|
17
|
-
#include "RNLatLng.hpp"
|
|
18
|
-
#include "JRNLatLng.hpp"
|
|
19
|
-
#include "RNLatLngBounds.hpp"
|
|
20
|
-
#include "JRNLatLngBounds.hpp"
|
|
21
|
-
#include "JRNCamera.hpp"
|
|
22
|
-
#include <optional>
|
|
23
|
-
|
|
24
|
-
namespace margelo::nitro::rngooglemapsplus {
|
|
25
|
-
|
|
26
|
-
using namespace facebook;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Represents the Java/Kotlin callback `(region: RNRegion, camera: RNCamera, isGesture: Boolean) -> Unit`.
|
|
30
|
-
* This can be passed around between C++ and Java/Kotlin.
|
|
31
|
-
*/
|
|
32
|
-
struct JFunc_void_RNRegion_RNCamera_bool: public jni::JavaClass<JFunc_void_RNRegion_RNCamera_bool> {
|
|
33
|
-
public:
|
|
34
|
-
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_RNRegion_RNCamera_bool;";
|
|
35
|
-
|
|
36
|
-
public:
|
|
37
|
-
/**
|
|
38
|
-
* Invokes the function this `JFunc_void_RNRegion_RNCamera_bool` instance holds through JNI.
|
|
39
|
-
*/
|
|
40
|
-
void invoke(const RNRegion& region, const RNCamera& camera, bool isGesture) const {
|
|
41
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JRNRegion> /* region */, jni::alias_ref<JRNCamera> /* camera */, jboolean /* isGesture */)>("invoke");
|
|
42
|
-
method(self(), JRNRegion::fromCpp(region), JRNCamera::fromCpp(camera), isGesture);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* An implementation of Func_void_RNRegion_RNCamera_bool that is backed by a C++ implementation (using `std::function<...>`)
|
|
48
|
-
*/
|
|
49
|
-
struct JFunc_void_RNRegion_RNCamera_bool_cxx final: public jni::HybridClass<JFunc_void_RNRegion_RNCamera_bool_cxx, JFunc_void_RNRegion_RNCamera_bool> {
|
|
50
|
-
public:
|
|
51
|
-
static jni::local_ref<JFunc_void_RNRegion_RNCamera_bool::javaobject> fromCpp(const std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>& func) {
|
|
52
|
-
return JFunc_void_RNRegion_RNCamera_bool_cxx::newObjectCxxArgs(func);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public:
|
|
56
|
-
/**
|
|
57
|
-
* Invokes the C++ `std::function<...>` this `JFunc_void_RNRegion_RNCamera_bool_cxx` instance holds.
|
|
58
|
-
*/
|
|
59
|
-
void invoke_cxx(jni::alias_ref<JRNRegion> region, jni::alias_ref<JRNCamera> camera, jboolean isGesture) {
|
|
60
|
-
_func(region->toCpp(), camera->toCpp(), static_cast<bool>(isGesture));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
public:
|
|
64
|
-
[[nodiscard]]
|
|
65
|
-
inline const std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>& getFunction() const {
|
|
66
|
-
return _func;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
public:
|
|
70
|
-
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_RNRegion_RNCamera_bool_cxx;";
|
|
71
|
-
static void registerNatives() {
|
|
72
|
-
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_RNRegion_RNCamera_bool_cxx::invoke_cxx)});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
private:
|
|
76
|
-
explicit JFunc_void_RNRegion_RNCamera_bool_cxx(const std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>& func): _func(func) { }
|
|
77
|
-
|
|
78
|
-
private:
|
|
79
|
-
friend HybridBase;
|
|
80
|
-
std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)> _func;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
} // namespace margelo::nitro::rngooglemapsplus
|