react-native-google-maps-plus 1.7.0-dev.9 → 1.8.0-dev.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/build.gradle +1 -1
- package/android/gradle.properties +2 -1
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +124 -128
- package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +2 -3
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +83 -53
- package/android/src/main/java/com/rngooglemapsplus/MapPolygonBuilder.kt +6 -23
- package/android/src/main/java/com/rngooglemapsplus/MapPolylineBuilder.kt.kt +12 -39
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +34 -16
- package/android/src/main/java/com/rngooglemapsplus/extensions/BitmapExtension.kt +35 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/CameraPositionExtension.kt +3 -2
- package/android/src/main/java/com/rngooglemapsplus/extensions/LatLngBoundsExtension.kt +31 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/MapObjectTagExtensions.kt +84 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNLineCapTypeExtension.kt +14 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNLineJoinTypeExtension.kt +12 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNMapCircleExtension.kt +7 -1
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNMarkerExtension.kt +54 -17
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolygonExtension.kt +31 -1
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolylineExtension.kt +6 -1
- package/ios/GoogleMapViewImpl.swift +89 -69
- package/ios/LocationHandler.swift +3 -1
- package/ios/MapCircleBuilder.swift +2 -3
- package/ios/MapHelper.swift +3 -5
- package/ios/MapMarkerBuilder.swift +147 -91
- package/ios/MapPolygonBuilder.swift +6 -41
- package/ios/MapPolylineBuilder.swift +2 -10
- package/ios/RNGoogleMapsPlusView.swift +49 -33
- package/ios/extensions/GMSCameraPosition+Extension.swift +2 -2
- package/ios/extensions/MapObjectTag+Extension.swift +93 -0
- package/ios/extensions/RNCircle+Extension.swift +14 -5
- package/ios/extensions/RNLatLng+Extension.swift +11 -0
- package/ios/extensions/RNLineCapType+Extension.swift +10 -0
- package/ios/extensions/RNLineJoinType+Extension.swift +11 -0
- package/ios/extensions/RNMarker+Extension.swift +43 -12
- package/ios/extensions/RNPolygon+Extension.swift.swift +50 -21
- package/ios/extensions/RNPolyline+Extension.swift.swift +15 -26
- package/ios/extensions/SVGKImage+Extension.swift +22 -0
- package/ios/extensions/UIImage+Extension.swift +45 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +17 -15
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +8 -1
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.cpp +8 -8
- 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++/JFunc_void_std__string.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string_RNLatLng.hpp +77 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +142 -130
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +30 -28
- package/nitrogen/generated/android/c++/JRNCameraChange.hpp +70 -0
- package/nitrogen/generated/android/c++/JRNInitialProps.hpp +7 -3
- package/nitrogen/generated/android/c++/JRNMarker.hpp +7 -7
- 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/{Func_void_std__optional_std__string_.kt → Func_void_std__string.kt} +12 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_std__optional_std__string__RNLatLng.kt → Func_void_std__string_RNLatLng.kt} +12 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +50 -42
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCameraChange.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNInitialProps.kt +6 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +6 -6
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +24 -16
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +97 -72
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +43 -28
- 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/Func_void_std__optional_std__string_.swift +6 -6
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string_RNLatLng.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +16 -14
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +186 -224
- package/nitrogen/generated/ios/swift/RNCameraChange.swift +68 -0
- package/nitrogen/generated/ios/swift/RNInitialProps.swift +31 -1
- package/nitrogen/generated/ios/swift/RNMarker.swift +24 -31
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +36 -31
- package/nitrogen/generated/shared/c++/RNCameraChange.hpp +88 -0
- package/nitrogen/generated/shared/c++/RNInitialProps.hpp +6 -2
- package/nitrogen/generated/shared/c++/RNMarker.hpp +6 -6
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +28 -28
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +15 -15
- package/package.json +1 -1
- package/src/RNGoogleMapsPlusView.nitro.ts +19 -14
- package/src/types.ts +9 -1
- package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera_bool.hpp +0 -83
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string_.hpp +0 -76
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string__RNLatLng.hpp +0 -78
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string__RNLatLng.swift +0 -54
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// JFunc_void_RNRegion_RNCameraChange.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -11,73 +11,72 @@
|
|
|
11
11
|
#include <functional>
|
|
12
12
|
|
|
13
13
|
#include "RNRegion.hpp"
|
|
14
|
-
#include "
|
|
14
|
+
#include "RNCameraChange.hpp"
|
|
15
15
|
#include <functional>
|
|
16
16
|
#include "JRNRegion.hpp"
|
|
17
17
|
#include "RNLatLng.hpp"
|
|
18
18
|
#include "JRNLatLng.hpp"
|
|
19
19
|
#include "RNLatLngBounds.hpp"
|
|
20
20
|
#include "JRNLatLngBounds.hpp"
|
|
21
|
-
#include "
|
|
22
|
-
#include <optional>
|
|
21
|
+
#include "JRNCameraChange.hpp"
|
|
23
22
|
|
|
24
23
|
namespace margelo::nitro::rngooglemapsplus {
|
|
25
24
|
|
|
26
25
|
using namespace facebook;
|
|
27
26
|
|
|
28
27
|
/**
|
|
29
|
-
* Represents the Java/Kotlin callback `(region: RNRegion, camera:
|
|
28
|
+
* Represents the Java/Kotlin callback `(region: RNRegion, camera: RNCameraChange) -> Unit`.
|
|
30
29
|
* This can be passed around between C++ and Java/Kotlin.
|
|
31
30
|
*/
|
|
32
|
-
struct
|
|
31
|
+
struct JFunc_void_RNRegion_RNCameraChange: public jni::JavaClass<JFunc_void_RNRegion_RNCameraChange> {
|
|
33
32
|
public:
|
|
34
|
-
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/
|
|
33
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_RNRegion_RNCameraChange;";
|
|
35
34
|
|
|
36
35
|
public:
|
|
37
36
|
/**
|
|
38
|
-
* Invokes the function this `
|
|
37
|
+
* Invokes the function this `JFunc_void_RNRegion_RNCameraChange` instance holds through JNI.
|
|
39
38
|
*/
|
|
40
|
-
void invoke(const RNRegion& region, const
|
|
41
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JRNRegion> /* region */, jni::alias_ref<
|
|
42
|
-
method(self(), JRNRegion::fromCpp(region),
|
|
39
|
+
void invoke(const RNRegion& region, const RNCameraChange& camera) const {
|
|
40
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JRNRegion> /* region */, jni::alias_ref<JRNCameraChange> /* camera */)>("invoke");
|
|
41
|
+
method(self(), JRNRegion::fromCpp(region), JRNCameraChange::fromCpp(camera));
|
|
43
42
|
}
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
/**
|
|
47
|
-
* An implementation of
|
|
46
|
+
* An implementation of Func_void_RNRegion_RNCameraChange that is backed by a C++ implementation (using `std::function<...>`)
|
|
48
47
|
*/
|
|
49
|
-
struct
|
|
48
|
+
struct JFunc_void_RNRegion_RNCameraChange_cxx final: public jni::HybridClass<JFunc_void_RNRegion_RNCameraChange_cxx, JFunc_void_RNRegion_RNCameraChange> {
|
|
50
49
|
public:
|
|
51
|
-
static jni::local_ref<
|
|
52
|
-
return
|
|
50
|
+
static jni::local_ref<JFunc_void_RNRegion_RNCameraChange::javaobject> fromCpp(const std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)>& func) {
|
|
51
|
+
return JFunc_void_RNRegion_RNCameraChange_cxx::newObjectCxxArgs(func);
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
public:
|
|
56
55
|
/**
|
|
57
|
-
* Invokes the C++ `std::function<...>` this `
|
|
56
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_RNRegion_RNCameraChange_cxx` instance holds.
|
|
58
57
|
*/
|
|
59
|
-
void invoke_cxx(jni::alias_ref<JRNRegion> region, jni::alias_ref<
|
|
58
|
+
void invoke_cxx(jni::alias_ref<JRNRegion> region, jni::alias_ref<JRNCameraChange> camera) {
|
|
60
59
|
_func(region->toCpp(), camera->toCpp());
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
public:
|
|
64
63
|
[[nodiscard]]
|
|
65
|
-
inline const std::function<void(const RNRegion& /* region */, const
|
|
64
|
+
inline const std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)>& getFunction() const {
|
|
66
65
|
return _func;
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
public:
|
|
70
|
-
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/
|
|
69
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_RNRegion_RNCameraChange_cxx;";
|
|
71
70
|
static void registerNatives() {
|
|
72
|
-
registerHybrid({makeNativeMethod("invoke_cxx",
|
|
71
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_RNRegion_RNCameraChange_cxx::invoke_cxx)});
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
private:
|
|
76
|
-
explicit
|
|
75
|
+
explicit JFunc_void_RNRegion_RNCameraChange_cxx(const std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)>& func): _func(func) { }
|
|
77
76
|
|
|
78
77
|
private:
|
|
79
78
|
friend HybridBase;
|
|
80
|
-
std::function<void(const RNRegion& /* region */, const
|
|
79
|
+
std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)> _func;
|
|
81
80
|
};
|
|
82
81
|
|
|
83
82
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_RNRegion_RNCameraChange_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 "RNCameraChange.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 "JRNCameraChange.hpp"
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
24
|
+
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Represents the Java/Kotlin callback `(region: RNRegion, camera: RNCameraChange, isGesture: Boolean) -> Unit`.
|
|
29
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
30
|
+
*/
|
|
31
|
+
struct JFunc_void_RNRegion_RNCameraChange_bool: public jni::JavaClass<JFunc_void_RNRegion_RNCameraChange_bool> {
|
|
32
|
+
public:
|
|
33
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_RNRegion_RNCameraChange_bool;";
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
/**
|
|
37
|
+
* Invokes the function this `JFunc_void_RNRegion_RNCameraChange_bool` instance holds through JNI.
|
|
38
|
+
*/
|
|
39
|
+
void invoke(const RNRegion& region, const RNCameraChange& camera, bool isGesture) const {
|
|
40
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JRNRegion> /* region */, jni::alias_ref<JRNCameraChange> /* camera */, jboolean /* isGesture */)>("invoke");
|
|
41
|
+
method(self(), JRNRegion::fromCpp(region), JRNCameraChange::fromCpp(camera), isGesture);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* An implementation of Func_void_RNRegion_RNCameraChange_bool that is backed by a C++ implementation (using `std::function<...>`)
|
|
47
|
+
*/
|
|
48
|
+
struct JFunc_void_RNRegion_RNCameraChange_bool_cxx final: public jni::HybridClass<JFunc_void_RNRegion_RNCameraChange_bool_cxx, JFunc_void_RNRegion_RNCameraChange_bool> {
|
|
49
|
+
public:
|
|
50
|
+
static jni::local_ref<JFunc_void_RNRegion_RNCameraChange_bool::javaobject> fromCpp(const std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>& func) {
|
|
51
|
+
return JFunc_void_RNRegion_RNCameraChange_bool_cxx::newObjectCxxArgs(func);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
/**
|
|
56
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_RNRegion_RNCameraChange_bool_cxx` instance holds.
|
|
57
|
+
*/
|
|
58
|
+
void invoke_cxx(jni::alias_ref<JRNRegion> region, jni::alias_ref<JRNCameraChange> camera, jboolean isGesture) {
|
|
59
|
+
_func(region->toCpp(), camera->toCpp(), static_cast<bool>(isGesture));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
[[nodiscard]]
|
|
64
|
+
inline const std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>& getFunction() const {
|
|
65
|
+
return _func;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public:
|
|
69
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_RNRegion_RNCameraChange_bool_cxx;";
|
|
70
|
+
static void registerNatives() {
|
|
71
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_RNRegion_RNCameraChange_bool_cxx::invoke_cxx)});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private:
|
|
75
|
+
explicit JFunc_void_RNRegion_RNCameraChange_bool_cxx(const std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>& func): _func(func) { }
|
|
76
|
+
|
|
77
|
+
private:
|
|
78
|
+
friend HybridBase;
|
|
79
|
+
std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)> _func;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_std__string.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 <string>
|
|
14
|
+
#include <functional>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Represents the Java/Kotlin callback `(id: String) -> Unit`.
|
|
22
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
23
|
+
*/
|
|
24
|
+
struct JFunc_void_std__string: public jni::JavaClass<JFunc_void_std__string> {
|
|
25
|
+
public:
|
|
26
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_std__string;";
|
|
27
|
+
|
|
28
|
+
public:
|
|
29
|
+
/**
|
|
30
|
+
* Invokes the function this `JFunc_void_std__string` instance holds through JNI.
|
|
31
|
+
*/
|
|
32
|
+
void invoke(const std::string& id) const {
|
|
33
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* id */)>("invoke");
|
|
34
|
+
method(self(), jni::make_jstring(id));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* An implementation of Func_void_std__string that is backed by a C++ implementation (using `std::function<...>`)
|
|
40
|
+
*/
|
|
41
|
+
struct JFunc_void_std__string_cxx final: public jni::HybridClass<JFunc_void_std__string_cxx, JFunc_void_std__string> {
|
|
42
|
+
public:
|
|
43
|
+
static jni::local_ref<JFunc_void_std__string::javaobject> fromCpp(const std::function<void(const std::string& /* id */)>& func) {
|
|
44
|
+
return JFunc_void_std__string_cxx::newObjectCxxArgs(func);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
/**
|
|
49
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_std__string_cxx` instance holds.
|
|
50
|
+
*/
|
|
51
|
+
void invoke_cxx(jni::alias_ref<jni::JString> id) {
|
|
52
|
+
_func(id->toStdString());
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
[[nodiscard]]
|
|
57
|
+
inline const std::function<void(const std::string& /* id */)>& getFunction() const {
|
|
58
|
+
return _func;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public:
|
|
62
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_std__string_cxx;";
|
|
63
|
+
static void registerNatives() {
|
|
64
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__string_cxx::invoke_cxx)});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private:
|
|
68
|
+
explicit JFunc_void_std__string_cxx(const std::function<void(const std::string& /* id */)>& func): _func(func) { }
|
|
69
|
+
|
|
70
|
+
private:
|
|
71
|
+
friend HybridBase;
|
|
72
|
+
std::function<void(const std::string& /* id */)> _func;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_std__string_RNLatLng.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 <string>
|
|
14
|
+
#include "RNLatLng.hpp"
|
|
15
|
+
#include <functional>
|
|
16
|
+
#include "JRNLatLng.hpp"
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents the Java/Kotlin callback `(id: String, location: RNLatLng) -> Unit`.
|
|
24
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
25
|
+
*/
|
|
26
|
+
struct JFunc_void_std__string_RNLatLng: public jni::JavaClass<JFunc_void_std__string_RNLatLng> {
|
|
27
|
+
public:
|
|
28
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_std__string_RNLatLng;";
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
/**
|
|
32
|
+
* Invokes the function this `JFunc_void_std__string_RNLatLng` instance holds through JNI.
|
|
33
|
+
*/
|
|
34
|
+
void invoke(const std::string& id, const RNLatLng& location) const {
|
|
35
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* id */, jni::alias_ref<JRNLatLng> /* location */)>("invoke");
|
|
36
|
+
method(self(), jni::make_jstring(id), JRNLatLng::fromCpp(location));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* An implementation of Func_void_std__string_RNLatLng that is backed by a C++ implementation (using `std::function<...>`)
|
|
42
|
+
*/
|
|
43
|
+
struct JFunc_void_std__string_RNLatLng_cxx final: public jni::HybridClass<JFunc_void_std__string_RNLatLng_cxx, JFunc_void_std__string_RNLatLng> {
|
|
44
|
+
public:
|
|
45
|
+
static jni::local_ref<JFunc_void_std__string_RNLatLng::javaobject> fromCpp(const std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>& func) {
|
|
46
|
+
return JFunc_void_std__string_RNLatLng_cxx::newObjectCxxArgs(func);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
/**
|
|
51
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_std__string_RNLatLng_cxx` instance holds.
|
|
52
|
+
*/
|
|
53
|
+
void invoke_cxx(jni::alias_ref<jni::JString> id, jni::alias_ref<JRNLatLng> location) {
|
|
54
|
+
_func(id->toStdString(), location->toCpp());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
[[nodiscard]]
|
|
59
|
+
inline const std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>& getFunction() const {
|
|
60
|
+
return _func;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_std__string_RNLatLng_cxx;";
|
|
65
|
+
static void registerNatives() {
|
|
66
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__string_RNLatLng_cxx::invoke_cxx)});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
explicit JFunc_void_std__string_RNLatLng_cxx(const std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>& func): _func(func) { }
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
friend HybridBase;
|
|
74
|
+
std::function<void(const std::string& /* id */, const RNLatLng& /* location */)> _func;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro::rngooglemapsplus
|