react-native-google-maps-plus 1.0.2 → 1.0.3-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/README.md +127 -11
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +239 -112
- package/android/src/main/java/com/rngooglemapsplus/MapCircle.kt +29 -0
- package/android/src/main/java/com/rngooglemapsplus/MapMarker.kt +6 -5
- package/android/src/main/java/com/rngooglemapsplus/MapPolygon.kt +3 -1
- package/android/src/main/java/com/rngooglemapsplus/MapPolyline.kt +3 -1
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +115 -88
- package/ios/Color.swift +20 -20
- package/ios/GoogleMapViewImpl.swift +194 -139
- package/ios/MapCircle.swift +43 -0
- package/ios/MapMarker.swift +10 -17
- package/ios/MapPolygon.swift +9 -6
- package/ios/MapPolyline.swift +9 -7
- package/ios/PermissionHandler.swift +1 -1
- package/ios/RNGoogleMapsPlusModule.swift +1 -1
- package/ios/RNGoogleMapsPlusView.swift +148 -105
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +17 -12
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +21 -3
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +173 -69
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +32 -22
- package/nitrogen/generated/android/c++/JRNCircle.hpp +84 -0
- package/nitrogen/generated/android/c++/JRNInitialProps.hpp +66 -0
- package/nitrogen/generated/android/c++/JRNMapType.hpp +68 -0
- package/nitrogen/generated/android/c++/JRNMarker.hpp +4 -4
- package/nitrogen/generated/android/c++/JRNPolygon.hpp +8 -4
- package/nitrogen/generated/android/c++/JRNPolyline.hpp +8 -4
- package/nitrogen/generated/android/c++/views/JHybridRNGoogleMapsPlusViewStateUpdater.cpp +24 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +65 -11
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCircle.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNInitialProps.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapType.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygon.kt +4 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolyline.kt +4 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/views/HybridRNGoogleMapsPlusViewManager.kt +7 -1
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +188 -45
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +85 -37
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +41 -16
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +16 -11
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +296 -45
- package/nitrogen/generated/ios/swift/RNCircle.swift +198 -0
- package/nitrogen/generated/ios/swift/RNInitialProps.swift +107 -0
- package/nitrogen/generated/ios/swift/RNMapType.swift +52 -0
- package/nitrogen/generated/ios/swift/RNMarker.swift +17 -5
- package/nitrogen/generated/ios/swift/RNPolygon.swift +40 -5
- package/nitrogen/generated/ios/swift/RNPolyline.swift +40 -5
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +12 -2
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +45 -26
- package/nitrogen/generated/shared/c++/RNCircle.hpp +98 -0
- package/nitrogen/generated/shared/c++/RNInitialProps.hpp +78 -0
- package/nitrogen/generated/shared/c++/RNMapType.hpp +88 -0
- package/nitrogen/generated/shared/c++/RNMarker.hpp +6 -6
- package/nitrogen/generated/shared/c++/RNPolygon.hpp +10 -6
- package/nitrogen/generated/shared/c++/RNPolyline.hpp +10 -6
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +92 -32
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +21 -13
- package/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +6 -1
- package/package.json +5 -5
- package/src/RNGoogleMapsPlusView.nitro.ts +19 -11
- package/src/types.ts +24 -3
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
#include "JHybridRNGoogleMapsPlusViewSpec.hpp"
|
|
9
9
|
|
|
10
|
+
// Forward declaration of `RNInitialProps` to properly resolve imports.
|
|
11
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNInitialProps; }
|
|
10
12
|
// Forward declaration of `RNCamera` to properly resolve imports.
|
|
11
13
|
namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
|
|
12
14
|
// Forward declaration of `RNLatLng` to properly resolve imports.
|
|
@@ -15,6 +17,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
|
15
17
|
namespace margelo::nitro::rngooglemapsplus { enum class RNUserInterfaceStyle; }
|
|
16
18
|
// Forward declaration of `RNMapPadding` to properly resolve imports.
|
|
17
19
|
namespace margelo::nitro::rngooglemapsplus { struct RNMapPadding; }
|
|
20
|
+
// Forward declaration of `RNMapType` to properly resolve imports.
|
|
21
|
+
namespace margelo::nitro::rngooglemapsplus { enum class RNMapType; }
|
|
18
22
|
// Forward declaration of `RNMarker` to properly resolve imports.
|
|
19
23
|
namespace margelo::nitro::rngooglemapsplus { struct RNMarker; }
|
|
20
24
|
// Forward declaration of `RNPosition` to properly resolve imports.
|
|
@@ -27,6 +31,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNPolyline; }
|
|
|
27
31
|
namespace margelo::nitro::rngooglemapsplus { enum class RNLineCapType; }
|
|
28
32
|
// Forward declaration of `RNLineJoinType` to properly resolve imports.
|
|
29
33
|
namespace margelo::nitro::rngooglemapsplus { enum class RNLineJoinType; }
|
|
34
|
+
// Forward declaration of `RNCircle` to properly resolve imports.
|
|
35
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNCircle; }
|
|
30
36
|
// Forward declaration of `RNMapErrorCode` to properly resolve imports.
|
|
31
37
|
namespace margelo::nitro::rngooglemapsplus { enum class RNMapErrorCode; }
|
|
32
38
|
// Forward declaration of `RNLocation` to properly resolve imports.
|
|
@@ -42,16 +48,20 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNAndroidLocationPermiss
|
|
|
42
48
|
// Forward declaration of `RNIOSPermissionResult` to properly resolve imports.
|
|
43
49
|
namespace margelo::nitro::rngooglemapsplus { enum class RNIOSPermissionResult; }
|
|
44
50
|
|
|
51
|
+
#include "RNInitialProps.hpp"
|
|
52
|
+
#include <optional>
|
|
53
|
+
#include "JRNInitialProps.hpp"
|
|
45
54
|
#include <string>
|
|
46
55
|
#include "RNCamera.hpp"
|
|
47
56
|
#include "JRNCamera.hpp"
|
|
48
57
|
#include "RNLatLng.hpp"
|
|
49
|
-
#include <optional>
|
|
50
58
|
#include "JRNLatLng.hpp"
|
|
51
59
|
#include "RNUserInterfaceStyle.hpp"
|
|
52
60
|
#include "JRNUserInterfaceStyle.hpp"
|
|
53
61
|
#include "RNMapPadding.hpp"
|
|
54
62
|
#include "JRNMapPadding.hpp"
|
|
63
|
+
#include "RNMapType.hpp"
|
|
64
|
+
#include "JRNMapType.hpp"
|
|
55
65
|
#include "RNMarker.hpp"
|
|
56
66
|
#include <vector>
|
|
57
67
|
#include "JRNMarker.hpp"
|
|
@@ -65,6 +75,8 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSPermissionResult; }
|
|
|
65
75
|
#include "JRNLineCapType.hpp"
|
|
66
76
|
#include "RNLineJoinType.hpp"
|
|
67
77
|
#include "JRNLineJoinType.hpp"
|
|
78
|
+
#include "RNCircle.hpp"
|
|
79
|
+
#include "JRNCircle.hpp"
|
|
68
80
|
#include "RNMapErrorCode.hpp"
|
|
69
81
|
#include <functional>
|
|
70
82
|
#include "JFunc_void_RNMapErrorCode.hpp"
|
|
@@ -113,82 +125,91 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
113
125
|
}
|
|
114
126
|
|
|
115
127
|
// Properties
|
|
116
|
-
|
|
117
|
-
static const auto method = javaClassStatic()->getMethod<
|
|
128
|
+
std::optional<RNInitialProps> JHybridRNGoogleMapsPlusViewSpec::getInitialProps() {
|
|
129
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JRNInitialProps>()>("getInitialProps");
|
|
118
130
|
auto __result = method(_javaPart);
|
|
119
|
-
return
|
|
131
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
120
132
|
}
|
|
121
|
-
void JHybridRNGoogleMapsPlusViewSpec::
|
|
122
|
-
static const auto method = javaClassStatic()->getMethod<void(
|
|
123
|
-
method(_javaPart,
|
|
133
|
+
void JHybridRNGoogleMapsPlusViewSpec::setInitialProps(const std::optional<RNInitialProps>& initialProps) {
|
|
134
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JRNInitialProps> /* initialProps */)>("setInitialProps");
|
|
135
|
+
method(_javaPart, initialProps.has_value() ? JRNInitialProps::fromCpp(initialProps.value()) : nullptr);
|
|
124
136
|
}
|
|
125
|
-
bool JHybridRNGoogleMapsPlusViewSpec::
|
|
126
|
-
static const auto method = javaClassStatic()->getMethod<
|
|
137
|
+
std::optional<bool> JHybridRNGoogleMapsPlusViewSpec::getBuildingEnabled() {
|
|
138
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getBuildingEnabled");
|
|
127
139
|
auto __result = method(_javaPart);
|
|
128
|
-
return static_cast<bool>(__result);
|
|
140
|
+
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
129
141
|
}
|
|
130
|
-
void JHybridRNGoogleMapsPlusViewSpec::
|
|
131
|
-
static const auto method = javaClassStatic()->getMethod<void(
|
|
132
|
-
method(_javaPart,
|
|
142
|
+
void JHybridRNGoogleMapsPlusViewSpec::setBuildingEnabled(std::optional<bool> buildingEnabled) {
|
|
143
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* buildingEnabled */)>("setBuildingEnabled");
|
|
144
|
+
method(_javaPart, buildingEnabled.has_value() ? jni::JBoolean::valueOf(buildingEnabled.value()) : nullptr);
|
|
133
145
|
}
|
|
134
|
-
std::
|
|
135
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::
|
|
146
|
+
std::optional<bool> JHybridRNGoogleMapsPlusViewSpec::getTrafficEnabled() {
|
|
147
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JBoolean>()>("getTrafficEnabled");
|
|
136
148
|
auto __result = method(_javaPart);
|
|
137
|
-
return __result->
|
|
149
|
+
return __result != nullptr ? std::make_optional(static_cast<bool>(__result->value())) : std::nullopt;
|
|
138
150
|
}
|
|
139
|
-
void JHybridRNGoogleMapsPlusViewSpec::
|
|
140
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::
|
|
141
|
-
method(_javaPart, jni::
|
|
151
|
+
void JHybridRNGoogleMapsPlusViewSpec::setTrafficEnabled(std::optional<bool> trafficEnabled) {
|
|
152
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JBoolean> /* trafficEnabled */)>("setTrafficEnabled");
|
|
153
|
+
method(_javaPart, trafficEnabled.has_value() ? jni::JBoolean::valueOf(trafficEnabled.value()) : nullptr);
|
|
142
154
|
}
|
|
143
|
-
|
|
144
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<
|
|
155
|
+
std::optional<std::string> JHybridRNGoogleMapsPlusViewSpec::getCustomMapStyle() {
|
|
156
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getCustomMapStyle");
|
|
145
157
|
auto __result = method(_javaPart);
|
|
146
|
-
return __result->
|
|
158
|
+
return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt;
|
|
147
159
|
}
|
|
148
|
-
void JHybridRNGoogleMapsPlusViewSpec::
|
|
149
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<
|
|
150
|
-
method(_javaPart,
|
|
160
|
+
void JHybridRNGoogleMapsPlusViewSpec::setCustomMapStyle(const std::optional<std::string>& customMapStyle) {
|
|
161
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* customMapStyle */)>("setCustomMapStyle");
|
|
162
|
+
method(_javaPart, customMapStyle.has_value() ? jni::make_jstring(customMapStyle.value()) : nullptr);
|
|
151
163
|
}
|
|
152
|
-
RNUserInterfaceStyle JHybridRNGoogleMapsPlusViewSpec::getUserInterfaceStyle() {
|
|
164
|
+
std::optional<RNUserInterfaceStyle> JHybridRNGoogleMapsPlusViewSpec::getUserInterfaceStyle() {
|
|
153
165
|
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JRNUserInterfaceStyle>()>("getUserInterfaceStyle");
|
|
154
166
|
auto __result = method(_javaPart);
|
|
155
|
-
return __result->toCpp();
|
|
167
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
156
168
|
}
|
|
157
|
-
void JHybridRNGoogleMapsPlusViewSpec::setUserInterfaceStyle(RNUserInterfaceStyle userInterfaceStyle) {
|
|
169
|
+
void JHybridRNGoogleMapsPlusViewSpec::setUserInterfaceStyle(std::optional<RNUserInterfaceStyle> userInterfaceStyle) {
|
|
158
170
|
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JRNUserInterfaceStyle> /* userInterfaceStyle */)>("setUserInterfaceStyle");
|
|
159
|
-
method(_javaPart, JRNUserInterfaceStyle::fromCpp(userInterfaceStyle));
|
|
171
|
+
method(_javaPart, userInterfaceStyle.has_value() ? JRNUserInterfaceStyle::fromCpp(userInterfaceStyle.value()) : nullptr);
|
|
160
172
|
}
|
|
161
|
-
double JHybridRNGoogleMapsPlusViewSpec::getMinZoomLevel() {
|
|
162
|
-
static const auto method = javaClassStatic()->getMethod<
|
|
173
|
+
std::optional<double> JHybridRNGoogleMapsPlusViewSpec::getMinZoomLevel() {
|
|
174
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getMinZoomLevel");
|
|
163
175
|
auto __result = method(_javaPart);
|
|
164
|
-
return __result;
|
|
176
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
165
177
|
}
|
|
166
|
-
void JHybridRNGoogleMapsPlusViewSpec::setMinZoomLevel(double minZoomLevel) {
|
|
167
|
-
static const auto method = javaClassStatic()->getMethod<void(
|
|
168
|
-
method(_javaPart, minZoomLevel);
|
|
178
|
+
void JHybridRNGoogleMapsPlusViewSpec::setMinZoomLevel(std::optional<double> minZoomLevel) {
|
|
179
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* minZoomLevel */)>("setMinZoomLevel");
|
|
180
|
+
method(_javaPart, minZoomLevel.has_value() ? jni::JDouble::valueOf(minZoomLevel.value()) : nullptr);
|
|
169
181
|
}
|
|
170
|
-
double JHybridRNGoogleMapsPlusViewSpec::getMaxZoomLevel() {
|
|
171
|
-
static const auto method = javaClassStatic()->getMethod<
|
|
182
|
+
std::optional<double> JHybridRNGoogleMapsPlusViewSpec::getMaxZoomLevel() {
|
|
183
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getMaxZoomLevel");
|
|
172
184
|
auto __result = method(_javaPart);
|
|
173
|
-
return __result;
|
|
185
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
174
186
|
}
|
|
175
|
-
void JHybridRNGoogleMapsPlusViewSpec::setMaxZoomLevel(double maxZoomLevel) {
|
|
176
|
-
static const auto method = javaClassStatic()->getMethod<void(
|
|
177
|
-
method(_javaPart, maxZoomLevel);
|
|
187
|
+
void JHybridRNGoogleMapsPlusViewSpec::setMaxZoomLevel(std::optional<double> maxZoomLevel) {
|
|
188
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* maxZoomLevel */)>("setMaxZoomLevel");
|
|
189
|
+
method(_javaPart, maxZoomLevel.has_value() ? jni::JDouble::valueOf(maxZoomLevel.value()) : nullptr);
|
|
178
190
|
}
|
|
179
|
-
RNMapPadding JHybridRNGoogleMapsPlusViewSpec::getMapPadding() {
|
|
191
|
+
std::optional<RNMapPadding> JHybridRNGoogleMapsPlusViewSpec::getMapPadding() {
|
|
180
192
|
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JRNMapPadding>()>("getMapPadding");
|
|
181
193
|
auto __result = method(_javaPart);
|
|
182
|
-
return __result->toCpp();
|
|
194
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
183
195
|
}
|
|
184
|
-
void JHybridRNGoogleMapsPlusViewSpec::setMapPadding(const RNMapPadding
|
|
196
|
+
void JHybridRNGoogleMapsPlusViewSpec::setMapPadding(const std::optional<RNMapPadding>& mapPadding) {
|
|
185
197
|
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JRNMapPadding> /* mapPadding */)>("setMapPadding");
|
|
186
|
-
method(_javaPart, JRNMapPadding::fromCpp(mapPadding));
|
|
198
|
+
method(_javaPart, mapPadding.has_value() ? JRNMapPadding::fromCpp(mapPadding.value()) : nullptr);
|
|
199
|
+
}
|
|
200
|
+
std::optional<RNMapType> JHybridRNGoogleMapsPlusViewSpec::getMapType() {
|
|
201
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JRNMapType>()>("getMapType");
|
|
202
|
+
auto __result = method(_javaPart);
|
|
203
|
+
return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt;
|
|
187
204
|
}
|
|
188
|
-
std::
|
|
205
|
+
void JHybridRNGoogleMapsPlusViewSpec::setMapType(std::optional<RNMapType> mapType) {
|
|
206
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JRNMapType> /* mapType */)>("setMapType");
|
|
207
|
+
method(_javaPart, mapType.has_value() ? JRNMapType::fromCpp(mapType.value()) : nullptr);
|
|
208
|
+
}
|
|
209
|
+
std::optional<std::vector<RNMarker>> JHybridRNGoogleMapsPlusViewSpec::getMarkers() {
|
|
189
210
|
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JArrayClass<JRNMarker>>()>("getMarkers");
|
|
190
211
|
auto __result = method(_javaPart);
|
|
191
|
-
return [&]() {
|
|
212
|
+
return __result != nullptr ? std::make_optional([&]() {
|
|
192
213
|
size_t __size = __result->size();
|
|
193
214
|
std::vector<RNMarker> __vector;
|
|
194
215
|
__vector.reserve(__size);
|
|
@@ -197,24 +218,24 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
197
218
|
__vector.push_back(__element->toCpp());
|
|
198
219
|
}
|
|
199
220
|
return __vector;
|
|
200
|
-
}();
|
|
221
|
+
}()) : std::nullopt;
|
|
201
222
|
}
|
|
202
|
-
void JHybridRNGoogleMapsPlusViewSpec::setMarkers(const std::vector<RNMarker
|
|
223
|
+
void JHybridRNGoogleMapsPlusViewSpec::setMarkers(const std::optional<std::vector<RNMarker>>& markers) {
|
|
203
224
|
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JArrayClass<JRNMarker>> /* markers */)>("setMarkers");
|
|
204
|
-
method(_javaPart, [&]() {
|
|
205
|
-
size_t __size = markers.size();
|
|
225
|
+
method(_javaPart, markers.has_value() ? [&]() {
|
|
226
|
+
size_t __size = markers.value().size();
|
|
206
227
|
jni::local_ref<jni::JArrayClass<JRNMarker>> __array = jni::JArrayClass<JRNMarker>::newArray(__size);
|
|
207
228
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
208
|
-
const auto& __element = markers[__i];
|
|
229
|
+
const auto& __element = markers.value()[__i];
|
|
209
230
|
__array->setElement(__i, *JRNMarker::fromCpp(__element));
|
|
210
231
|
}
|
|
211
232
|
return __array;
|
|
212
|
-
}());
|
|
233
|
+
}() : nullptr);
|
|
213
234
|
}
|
|
214
|
-
std::vector<RNPolygon
|
|
235
|
+
std::optional<std::vector<RNPolygon>> JHybridRNGoogleMapsPlusViewSpec::getPolygons() {
|
|
215
236
|
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JArrayClass<JRNPolygon>>()>("getPolygons");
|
|
216
237
|
auto __result = method(_javaPart);
|
|
217
|
-
return [&]() {
|
|
238
|
+
return __result != nullptr ? std::make_optional([&]() {
|
|
218
239
|
size_t __size = __result->size();
|
|
219
240
|
std::vector<RNPolygon> __vector;
|
|
220
241
|
__vector.reserve(__size);
|
|
@@ -223,24 +244,24 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
223
244
|
__vector.push_back(__element->toCpp());
|
|
224
245
|
}
|
|
225
246
|
return __vector;
|
|
226
|
-
}();
|
|
247
|
+
}()) : std::nullopt;
|
|
227
248
|
}
|
|
228
|
-
void JHybridRNGoogleMapsPlusViewSpec::setPolygons(const std::vector<RNPolygon
|
|
249
|
+
void JHybridRNGoogleMapsPlusViewSpec::setPolygons(const std::optional<std::vector<RNPolygon>>& polygons) {
|
|
229
250
|
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JArrayClass<JRNPolygon>> /* polygons */)>("setPolygons");
|
|
230
|
-
method(_javaPart, [&]() {
|
|
231
|
-
size_t __size = polygons.size();
|
|
251
|
+
method(_javaPart, polygons.has_value() ? [&]() {
|
|
252
|
+
size_t __size = polygons.value().size();
|
|
232
253
|
jni::local_ref<jni::JArrayClass<JRNPolygon>> __array = jni::JArrayClass<JRNPolygon>::newArray(__size);
|
|
233
254
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
234
|
-
const auto& __element = polygons[__i];
|
|
255
|
+
const auto& __element = polygons.value()[__i];
|
|
235
256
|
__array->setElement(__i, *JRNPolygon::fromCpp(__element));
|
|
236
257
|
}
|
|
237
258
|
return __array;
|
|
238
|
-
}());
|
|
259
|
+
}() : nullptr);
|
|
239
260
|
}
|
|
240
|
-
std::vector<RNPolyline
|
|
261
|
+
std::optional<std::vector<RNPolyline>> JHybridRNGoogleMapsPlusViewSpec::getPolylines() {
|
|
241
262
|
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JArrayClass<JRNPolyline>>()>("getPolylines");
|
|
242
263
|
auto __result = method(_javaPart);
|
|
243
|
-
return [&]() {
|
|
264
|
+
return __result != nullptr ? std::make_optional([&]() {
|
|
244
265
|
size_t __size = __result->size();
|
|
245
266
|
std::vector<RNPolyline> __vector;
|
|
246
267
|
__vector.reserve(__size);
|
|
@@ -249,19 +270,45 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
249
270
|
__vector.push_back(__element->toCpp());
|
|
250
271
|
}
|
|
251
272
|
return __vector;
|
|
252
|
-
}();
|
|
273
|
+
}()) : std::nullopt;
|
|
253
274
|
}
|
|
254
|
-
void JHybridRNGoogleMapsPlusViewSpec::setPolylines(const std::vector<RNPolyline
|
|
275
|
+
void JHybridRNGoogleMapsPlusViewSpec::setPolylines(const std::optional<std::vector<RNPolyline>>& polylines) {
|
|
255
276
|
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JArrayClass<JRNPolyline>> /* polylines */)>("setPolylines");
|
|
256
|
-
method(_javaPart, [&]() {
|
|
257
|
-
size_t __size = polylines.size();
|
|
277
|
+
method(_javaPart, polylines.has_value() ? [&]() {
|
|
278
|
+
size_t __size = polylines.value().size();
|
|
258
279
|
jni::local_ref<jni::JArrayClass<JRNPolyline>> __array = jni::JArrayClass<JRNPolyline>::newArray(__size);
|
|
259
280
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
260
|
-
const auto& __element = polylines[__i];
|
|
281
|
+
const auto& __element = polylines.value()[__i];
|
|
261
282
|
__array->setElement(__i, *JRNPolyline::fromCpp(__element));
|
|
262
283
|
}
|
|
263
284
|
return __array;
|
|
264
|
-
}());
|
|
285
|
+
}() : nullptr);
|
|
286
|
+
}
|
|
287
|
+
std::optional<std::vector<RNCircle>> JHybridRNGoogleMapsPlusViewSpec::getCircles() {
|
|
288
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JArrayClass<JRNCircle>>()>("getCircles");
|
|
289
|
+
auto __result = method(_javaPart);
|
|
290
|
+
return __result != nullptr ? std::make_optional([&]() {
|
|
291
|
+
size_t __size = __result->size();
|
|
292
|
+
std::vector<RNCircle> __vector;
|
|
293
|
+
__vector.reserve(__size);
|
|
294
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
295
|
+
auto __element = __result->getElement(__i);
|
|
296
|
+
__vector.push_back(__element->toCpp());
|
|
297
|
+
}
|
|
298
|
+
return __vector;
|
|
299
|
+
}()) : std::nullopt;
|
|
300
|
+
}
|
|
301
|
+
void JHybridRNGoogleMapsPlusViewSpec::setCircles(const std::optional<std::vector<RNCircle>>& circles) {
|
|
302
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JArrayClass<JRNCircle>> /* circles */)>("setCircles");
|
|
303
|
+
method(_javaPart, circles.has_value() ? [&]() {
|
|
304
|
+
size_t __size = circles.value().size();
|
|
305
|
+
jni::local_ref<jni::JArrayClass<JRNCircle>> __array = jni::JArrayClass<JRNCircle>::newArray(__size);
|
|
306
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
307
|
+
const auto& __element = circles.value()[__i];
|
|
308
|
+
__array->setElement(__i, *JRNCircle::fromCpp(__element));
|
|
309
|
+
}
|
|
310
|
+
return __array;
|
|
311
|
+
}() : nullptr);
|
|
265
312
|
}
|
|
266
313
|
std::optional<std::function<void(RNMapErrorCode /* error */)>> JHybridRNGoogleMapsPlusViewSpec::getOnMapError() {
|
|
267
314
|
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_RNMapErrorCode::javaobject>()>("getOnMapError_cxx");
|
|
@@ -377,6 +424,63 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
377
424
|
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* onMarkerPress */)>("setOnMarkerPress_cxx");
|
|
378
425
|
method(_javaPart, onMarkerPress.has_value() ? JFunc_void_std__string_cxx::fromCpp(onMarkerPress.value()) : nullptr);
|
|
379
426
|
}
|
|
427
|
+
std::optional<std::function<void(const std::string& /* id */)>> JHybridRNGoogleMapsPlusViewSpec::getOnPolylinePress() {
|
|
428
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__string::javaobject>()>("getOnPolylinePress_cxx");
|
|
429
|
+
auto __result = method(_javaPart);
|
|
430
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void(const std::string& /* id */)> {
|
|
431
|
+
if (__result->isInstanceOf(JFunc_void_std__string_cxx::javaClassStatic())) [[likely]] {
|
|
432
|
+
auto downcast = jni::static_ref_cast<JFunc_void_std__string_cxx::javaobject>(__result);
|
|
433
|
+
return downcast->cthis()->getFunction();
|
|
434
|
+
} else {
|
|
435
|
+
auto __resultRef = jni::make_global(__result);
|
|
436
|
+
return [__resultRef](std::string id) -> void {
|
|
437
|
+
return __resultRef->invoke(id);
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
}()) : std::nullopt;
|
|
441
|
+
}
|
|
442
|
+
void JHybridRNGoogleMapsPlusViewSpec::setOnPolylinePress(const std::optional<std::function<void(const std::string& /* id */)>>& onPolylinePress) {
|
|
443
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* onPolylinePress */)>("setOnPolylinePress_cxx");
|
|
444
|
+
method(_javaPart, onPolylinePress.has_value() ? JFunc_void_std__string_cxx::fromCpp(onPolylinePress.value()) : nullptr);
|
|
445
|
+
}
|
|
446
|
+
std::optional<std::function<void(const std::string& /* id */)>> JHybridRNGoogleMapsPlusViewSpec::getOnPolygonPress() {
|
|
447
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__string::javaobject>()>("getOnPolygonPress_cxx");
|
|
448
|
+
auto __result = method(_javaPart);
|
|
449
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void(const std::string& /* id */)> {
|
|
450
|
+
if (__result->isInstanceOf(JFunc_void_std__string_cxx::javaClassStatic())) [[likely]] {
|
|
451
|
+
auto downcast = jni::static_ref_cast<JFunc_void_std__string_cxx::javaobject>(__result);
|
|
452
|
+
return downcast->cthis()->getFunction();
|
|
453
|
+
} else {
|
|
454
|
+
auto __resultRef = jni::make_global(__result);
|
|
455
|
+
return [__resultRef](std::string id) -> void {
|
|
456
|
+
return __resultRef->invoke(id);
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
}()) : std::nullopt;
|
|
460
|
+
}
|
|
461
|
+
void JHybridRNGoogleMapsPlusViewSpec::setOnPolygonPress(const std::optional<std::function<void(const std::string& /* id */)>>& onPolygonPress) {
|
|
462
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* onPolygonPress */)>("setOnPolygonPress_cxx");
|
|
463
|
+
method(_javaPart, onPolygonPress.has_value() ? JFunc_void_std__string_cxx::fromCpp(onPolygonPress.value()) : nullptr);
|
|
464
|
+
}
|
|
465
|
+
std::optional<std::function<void(const std::string& /* id */)>> JHybridRNGoogleMapsPlusViewSpec::getOnCirclePress() {
|
|
466
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__string::javaobject>()>("getOnCirclePress_cxx");
|
|
467
|
+
auto __result = method(_javaPart);
|
|
468
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void(const std::string& /* id */)> {
|
|
469
|
+
if (__result->isInstanceOf(JFunc_void_std__string_cxx::javaClassStatic())) [[likely]] {
|
|
470
|
+
auto downcast = jni::static_ref_cast<JFunc_void_std__string_cxx::javaobject>(__result);
|
|
471
|
+
return downcast->cthis()->getFunction();
|
|
472
|
+
} else {
|
|
473
|
+
auto __resultRef = jni::make_global(__result);
|
|
474
|
+
return [__resultRef](std::string id) -> void {
|
|
475
|
+
return __resultRef->invoke(id);
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
}()) : std::nullopt;
|
|
479
|
+
}
|
|
480
|
+
void JHybridRNGoogleMapsPlusViewSpec::setOnCirclePress(const std::optional<std::function<void(const std::string& /* id */)>>& onCirclePress) {
|
|
481
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__string::javaobject> /* onCirclePress */)>("setOnCirclePress_cxx");
|
|
482
|
+
method(_javaPart, onCirclePress.has_value() ? JFunc_void_std__string_cxx::fromCpp(onCirclePress.value()) : nullptr);
|
|
483
|
+
}
|
|
380
484
|
std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>> JHybridRNGoogleMapsPlusViewSpec::getOnCameraChangeStart() {
|
|
381
485
|
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_RNRegion_RNCamera_bool::javaobject>()>("getOnCameraChangeStart_cxx");
|
|
382
486
|
auto __result = method(_javaPart);
|
|
@@ -49,28 +49,32 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
49
49
|
|
|
50
50
|
public:
|
|
51
51
|
// Properties
|
|
52
|
-
|
|
53
|
-
void
|
|
54
|
-
bool
|
|
55
|
-
void
|
|
56
|
-
std::
|
|
57
|
-
void
|
|
58
|
-
|
|
59
|
-
void
|
|
60
|
-
RNUserInterfaceStyle getUserInterfaceStyle() override;
|
|
61
|
-
void setUserInterfaceStyle(RNUserInterfaceStyle userInterfaceStyle) override;
|
|
62
|
-
double getMinZoomLevel() override;
|
|
63
|
-
void setMinZoomLevel(double minZoomLevel) override;
|
|
64
|
-
double getMaxZoomLevel() override;
|
|
65
|
-
void setMaxZoomLevel(double maxZoomLevel) override;
|
|
66
|
-
RNMapPadding getMapPadding() override;
|
|
67
|
-
void setMapPadding(const RNMapPadding
|
|
68
|
-
std::
|
|
69
|
-
void
|
|
70
|
-
std::vector<
|
|
71
|
-
void
|
|
72
|
-
std::vector<
|
|
73
|
-
void
|
|
52
|
+
std::optional<RNInitialProps> getInitialProps() override;
|
|
53
|
+
void setInitialProps(const std::optional<RNInitialProps>& initialProps) override;
|
|
54
|
+
std::optional<bool> getBuildingEnabled() override;
|
|
55
|
+
void setBuildingEnabled(std::optional<bool> buildingEnabled) override;
|
|
56
|
+
std::optional<bool> getTrafficEnabled() override;
|
|
57
|
+
void setTrafficEnabled(std::optional<bool> trafficEnabled) override;
|
|
58
|
+
std::optional<std::string> getCustomMapStyle() override;
|
|
59
|
+
void setCustomMapStyle(const std::optional<std::string>& customMapStyle) override;
|
|
60
|
+
std::optional<RNUserInterfaceStyle> getUserInterfaceStyle() override;
|
|
61
|
+
void setUserInterfaceStyle(std::optional<RNUserInterfaceStyle> userInterfaceStyle) override;
|
|
62
|
+
std::optional<double> getMinZoomLevel() override;
|
|
63
|
+
void setMinZoomLevel(std::optional<double> minZoomLevel) override;
|
|
64
|
+
std::optional<double> getMaxZoomLevel() override;
|
|
65
|
+
void setMaxZoomLevel(std::optional<double> maxZoomLevel) override;
|
|
66
|
+
std::optional<RNMapPadding> getMapPadding() override;
|
|
67
|
+
void setMapPadding(const std::optional<RNMapPadding>& mapPadding) override;
|
|
68
|
+
std::optional<RNMapType> getMapType() override;
|
|
69
|
+
void setMapType(std::optional<RNMapType> mapType) override;
|
|
70
|
+
std::optional<std::vector<RNMarker>> getMarkers() override;
|
|
71
|
+
void setMarkers(const std::optional<std::vector<RNMarker>>& markers) override;
|
|
72
|
+
std::optional<std::vector<RNPolygon>> getPolygons() override;
|
|
73
|
+
void setPolygons(const std::optional<std::vector<RNPolygon>>& polygons) override;
|
|
74
|
+
std::optional<std::vector<RNPolyline>> getPolylines() override;
|
|
75
|
+
void setPolylines(const std::optional<std::vector<RNPolyline>>& polylines) override;
|
|
76
|
+
std::optional<std::vector<RNCircle>> getCircles() override;
|
|
77
|
+
void setCircles(const std::optional<std::vector<RNCircle>>& circles) override;
|
|
74
78
|
std::optional<std::function<void(RNMapErrorCode /* error */)>> getOnMapError() override;
|
|
75
79
|
void setOnMapError(const std::optional<std::function<void(RNMapErrorCode /* error */)>>& onMapError) override;
|
|
76
80
|
std::optional<std::function<void(bool /* ready */)>> getOnMapReady() override;
|
|
@@ -83,6 +87,12 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
83
87
|
void setOnMapPress(const std::optional<std::function<void(const RNLatLng& /* coordinate */)>>& onMapPress) override;
|
|
84
88
|
std::optional<std::function<void(const std::string& /* id */)>> getOnMarkerPress() override;
|
|
85
89
|
void setOnMarkerPress(const std::optional<std::function<void(const std::string& /* id */)>>& onMarkerPress) override;
|
|
90
|
+
std::optional<std::function<void(const std::string& /* id */)>> getOnPolylinePress() override;
|
|
91
|
+
void setOnPolylinePress(const std::optional<std::function<void(const std::string& /* id */)>>& onPolylinePress) override;
|
|
92
|
+
std::optional<std::function<void(const std::string& /* id */)>> getOnPolygonPress() override;
|
|
93
|
+
void setOnPolygonPress(const std::optional<std::function<void(const std::string& /* id */)>>& onPolygonPress) override;
|
|
94
|
+
std::optional<std::function<void(const std::string& /* id */)>> getOnCirclePress() override;
|
|
95
|
+
void setOnCirclePress(const std::optional<std::function<void(const std::string& /* id */)>>& onCirclePress) override;
|
|
86
96
|
std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>> getOnCameraChangeStart() override;
|
|
87
97
|
void setOnCameraChangeStart(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>& onCameraChangeStart) override;
|
|
88
98
|
std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>> getOnCameraChange() override;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JRNCircle.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 "RNCircle.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JRNLatLng.hpp"
|
|
14
|
+
#include "RNLatLng.hpp"
|
|
15
|
+
#include <optional>
|
|
16
|
+
#include <string>
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The C++ JNI bridge between the C++ struct "RNCircle" and the the Kotlin data class "RNCircle".
|
|
24
|
+
*/
|
|
25
|
+
struct JRNCircle final: public jni::JavaClass<JRNCircle> {
|
|
26
|
+
public:
|
|
27
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/RNCircle;";
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
/**
|
|
31
|
+
* Convert this Java/Kotlin-based struct to the C++ struct RNCircle by copying all values to C++.
|
|
32
|
+
*/
|
|
33
|
+
[[maybe_unused]]
|
|
34
|
+
[[nodiscard]]
|
|
35
|
+
RNCircle toCpp() const {
|
|
36
|
+
static const auto clazz = javaClassStatic();
|
|
37
|
+
static const auto fieldId = clazz->getField<jni::JString>("id");
|
|
38
|
+
jni::local_ref<jni::JString> id = this->getFieldValue(fieldId);
|
|
39
|
+
static const auto fieldPressable = clazz->getField<jni::JBoolean>("pressable");
|
|
40
|
+
jni::local_ref<jni::JBoolean> pressable = this->getFieldValue(fieldPressable);
|
|
41
|
+
static const auto fieldZIndex = clazz->getField<jni::JDouble>("zIndex");
|
|
42
|
+
jni::local_ref<jni::JDouble> zIndex = this->getFieldValue(fieldZIndex);
|
|
43
|
+
static const auto fieldCenter = clazz->getField<JRNLatLng>("center");
|
|
44
|
+
jni::local_ref<JRNLatLng> center = this->getFieldValue(fieldCenter);
|
|
45
|
+
static const auto fieldRadius = clazz->getField<jni::JDouble>("radius");
|
|
46
|
+
jni::local_ref<jni::JDouble> radius = this->getFieldValue(fieldRadius);
|
|
47
|
+
static const auto fieldStrokeWidth = clazz->getField<jni::JDouble>("strokeWidth");
|
|
48
|
+
jni::local_ref<jni::JDouble> strokeWidth = this->getFieldValue(fieldStrokeWidth);
|
|
49
|
+
static const auto fieldStrokeColor = clazz->getField<jni::JString>("strokeColor");
|
|
50
|
+
jni::local_ref<jni::JString> strokeColor = this->getFieldValue(fieldStrokeColor);
|
|
51
|
+
static const auto fieldFillColor = clazz->getField<jni::JString>("fillColor");
|
|
52
|
+
jni::local_ref<jni::JString> fillColor = this->getFieldValue(fieldFillColor);
|
|
53
|
+
return RNCircle(
|
|
54
|
+
id->toStdString(),
|
|
55
|
+
pressable != nullptr ? std::make_optional(static_cast<bool>(pressable->value())) : std::nullopt,
|
|
56
|
+
zIndex != nullptr ? std::make_optional(zIndex->value()) : std::nullopt,
|
|
57
|
+
center->toCpp(),
|
|
58
|
+
radius != nullptr ? std::make_optional(radius->value()) : std::nullopt,
|
|
59
|
+
strokeWidth != nullptr ? std::make_optional(strokeWidth->value()) : std::nullopt,
|
|
60
|
+
strokeColor != nullptr ? std::make_optional(strokeColor->toStdString()) : std::nullopt,
|
|
61
|
+
fillColor != nullptr ? std::make_optional(fillColor->toStdString()) : std::nullopt
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public:
|
|
66
|
+
/**
|
|
67
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
68
|
+
*/
|
|
69
|
+
[[maybe_unused]]
|
|
70
|
+
static jni::local_ref<JRNCircle::javaobject> fromCpp(const RNCircle& value) {
|
|
71
|
+
return newInstance(
|
|
72
|
+
jni::make_jstring(value.id),
|
|
73
|
+
value.pressable.has_value() ? jni::JBoolean::valueOf(value.pressable.value()) : nullptr,
|
|
74
|
+
value.zIndex.has_value() ? jni::JDouble::valueOf(value.zIndex.value()) : nullptr,
|
|
75
|
+
JRNLatLng::fromCpp(value.center),
|
|
76
|
+
value.radius.has_value() ? jni::JDouble::valueOf(value.radius.value()) : nullptr,
|
|
77
|
+
value.strokeWidth.has_value() ? jni::JDouble::valueOf(value.strokeWidth.value()) : nullptr,
|
|
78
|
+
value.strokeColor.has_value() ? jni::make_jstring(value.strokeColor.value()) : nullptr,
|
|
79
|
+
value.fillColor.has_value() ? jni::make_jstring(value.fillColor.value()) : nullptr
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JRNInitialProps.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 "RNInitialProps.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JRNCamera.hpp"
|
|
14
|
+
#include "JRNLatLng.hpp"
|
|
15
|
+
#include "RNCamera.hpp"
|
|
16
|
+
#include "RNLatLng.hpp"
|
|
17
|
+
#include <optional>
|
|
18
|
+
#include <string>
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
21
|
+
|
|
22
|
+
using namespace facebook;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The C++ JNI bridge between the C++ struct "RNInitialProps" and the the Kotlin data class "RNInitialProps".
|
|
26
|
+
*/
|
|
27
|
+
struct JRNInitialProps final: public jni::JavaClass<JRNInitialProps> {
|
|
28
|
+
public:
|
|
29
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/RNInitialProps;";
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
/**
|
|
33
|
+
* Convert this Java/Kotlin-based struct to the C++ struct RNInitialProps by copying all values to C++.
|
|
34
|
+
*/
|
|
35
|
+
[[maybe_unused]]
|
|
36
|
+
[[nodiscard]]
|
|
37
|
+
RNInitialProps toCpp() const {
|
|
38
|
+
static const auto clazz = javaClassStatic();
|
|
39
|
+
static const auto fieldMapId = clazz->getField<jni::JString>("mapId");
|
|
40
|
+
jni::local_ref<jni::JString> mapId = this->getFieldValue(fieldMapId);
|
|
41
|
+
static const auto fieldLiteMode = clazz->getField<jni::JBoolean>("liteMode");
|
|
42
|
+
jni::local_ref<jni::JBoolean> liteMode = this->getFieldValue(fieldLiteMode);
|
|
43
|
+
static const auto fieldInitialCamera = clazz->getField<JRNCamera>("initialCamera");
|
|
44
|
+
jni::local_ref<JRNCamera> initialCamera = this->getFieldValue(fieldInitialCamera);
|
|
45
|
+
return RNInitialProps(
|
|
46
|
+
mapId != nullptr ? std::make_optional(mapId->toStdString()) : std::nullopt,
|
|
47
|
+
liteMode != nullptr ? std::make_optional(static_cast<bool>(liteMode->value())) : std::nullopt,
|
|
48
|
+
initialCamera != nullptr ? std::make_optional(initialCamera->toCpp()) : std::nullopt
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
/**
|
|
54
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
55
|
+
*/
|
|
56
|
+
[[maybe_unused]]
|
|
57
|
+
static jni::local_ref<JRNInitialProps::javaobject> fromCpp(const RNInitialProps& value) {
|
|
58
|
+
return newInstance(
|
|
59
|
+
value.mapId.has_value() ? jni::make_jstring(value.mapId.value()) : nullptr,
|
|
60
|
+
value.liteMode.has_value() ? jni::JBoolean::valueOf(value.liteMode.value()) : nullptr,
|
|
61
|
+
value.initialCamera.has_value() ? JRNCamera::fromCpp(value.initialCamera.value()) : nullptr
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
} // namespace margelo::nitro::rngooglemapsplus
|