react-native-google-maps-plus 1.3.0 → 1.4.1-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/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +50 -161
- package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +38 -36
- package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +33 -9
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +73 -18
- package/android/src/main/java/com/rngooglemapsplus/MapPolygonBuilder.kt +59 -12
- package/android/src/main/java/com/rngooglemapsplus/MapPolylineBuilder.kt.kt +47 -12
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +12 -9
- package/android/src/main/java/com/rngooglemapsplus/extensions/CameraPositionExtension.kt +12 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/IntExtension.kt +28 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/LatLngBounds.kt +15 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/LatLngExtension.kt +6 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/LocationExtension.kt +59 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNCameraExtension.kt +1 -2
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNLatLngExtension.kt +6 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNMarkerExtension.kt +8 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolygonExtension.kt +2 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolylineExtension.kt +1 -0
- package/ios/GoogleMapViewImpl.swift +39 -180
- package/ios/LocationHandler.swift +5 -13
- package/ios/MapCircleBuilder.swift +30 -18
- package/ios/MapHelper.swift +20 -0
- package/ios/MapMarkerBuilder.swift +105 -86
- package/ios/MapPolygonBuilder.swift +62 -13
- package/ios/MapPolylineBuilder.swift +33 -15
- package/ios/RNGoogleMapsPlusView.swift +15 -9
- package/ios/extensions/CLError+Extension.swift +14 -0
- package/ios/extensions/CLLocation+Extension.swift +27 -0
- package/ios/extensions/CLLocationCoordinate2D+Extension.swift +7 -0
- package/ios/extensions/GMSCameraPosition+Extension.swift +12 -0
- package/ios/extensions/GMSCoordinateBounds+Extension.swift +19 -0
- package/ios/extensions/RNLatLng+Extension.swift +7 -0
- package/ios/extensions/RNMarker+Extension.swift +7 -3
- package/ios/extensions/RNPolygon+Extension.swift.swift +16 -1
- package/ios/extensions/RNPolyline+Extension.swift.swift +1 -0
- package/lib/module/GoogleMapsPlus.js +7 -0
- package/lib/module/GoogleMapsPlus.js.map +1 -0
- package/lib/module/index.js +3 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +44 -0
- package/lib/typescript/src/GoogleMapsPlus.d.ts +5 -0
- package/lib/typescript/src/GoogleMapsPlus.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +33 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_RNLocation.hpp +6 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +12 -0
- package/nitrogen/generated/android/c++/JRNLocation.hpp +32 -2
- package/nitrogen/generated/android/c++/JRNLocationAndroid.hpp +82 -0
- package/nitrogen/generated/android/c++/JRNLocationIOS.hpp +77 -0
- package/nitrogen/generated/android/c++/JRNMarker.hpp +8 -0
- package/nitrogen/generated/android/c++/JRNPolygon.hpp +29 -2
- package/nitrogen/generated/android/c++/JRNPolygonHole.hpp +72 -0
- package/nitrogen/generated/android/c++/JRNPolyline.hpp +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocation.kt +19 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationAndroid.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationIOS.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +6 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygon.kt +7 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygonHole.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolyline.kt +3 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/views/HybridRNGoogleMapsPlusViewManager.kt +8 -3
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +16 -16
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +87 -20
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +12 -3
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +8 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +7 -56
- package/nitrogen/generated/ios/swift/RNCamera.swift +1 -8
- package/nitrogen/generated/ios/swift/RNHeatmap.swift +1 -8
- package/nitrogen/generated/ios/swift/RNHeatmapGradient.swift +11 -15
- package/nitrogen/generated/ios/swift/RNInitialProps.swift +1 -8
- package/nitrogen/generated/ios/swift/RNLocation.swift +92 -2
- package/nitrogen/generated/ios/swift/RNLocationAndroid.swift +215 -0
- package/nitrogen/generated/ios/swift/RNLocationConfig.swift +2 -16
- package/nitrogen/generated/ios/swift/RNLocationIOS.swift +185 -0
- package/nitrogen/generated/ios/swift/RNMarker.swift +47 -15
- package/nitrogen/generated/ios/swift/RNPolygon.swift +66 -1
- package/nitrogen/generated/ios/swift/RNPolygonHole.swift +47 -0
- package/nitrogen/generated/ios/swift/RNPolyline.swift +24 -1
- package/nitrogen/generated/ios/swift/RNSnapshotOptions.swift +1 -8
- package/nitrogen/generated/shared/c++/RNAndroidLocationConfig.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNCamera.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNCircle.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNHeatmap.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNHeatmapGradient.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNHeatmapPoint.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNIOSLocationConfig.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNIndoorBuilding.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNIndoorLevel.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNInitialProps.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNKMLayer.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNLatLng.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNLatLngBounds.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNLocation.hpp +41 -2
- package/nitrogen/generated/shared/c++/RNLocationAndroid.hpp +104 -0
- package/nitrogen/generated/shared/c++/RNLocationConfig.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNLocationIOS.hpp +99 -0
- package/nitrogen/generated/shared/c++/RNLocationPermissionResult.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNMapPadding.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNMapUiSettings.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNMapZoomConfig.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNMarker.hpp +17 -1
- package/nitrogen/generated/shared/c++/RNMarkerSvg.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNPolygon.hpp +21 -2
- package/nitrogen/generated/shared/c++/RNPolygonHole.hpp +77 -0
- package/nitrogen/generated/shared/c++/RNPolyline.hpp +13 -1
- package/nitrogen/generated/shared/c++/RNPosition.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNRegion.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNSize.hpp +8 -0
- package/nitrogen/generated/shared/c++/RNSnapshotOptions.hpp +8 -0
- package/package.json +9 -16
- package/src/GoogleMapsPlus.tsx +20 -0
- package/src/index.tsx +6 -14
- package/src/types.ts +36 -0
- package/lib/module/package.json +0 -1
- package/lib/typescript/package.json +0 -1
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `RNCamera` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
|
|
@@ -68,6 +73,9 @@ namespace margelo::nitro {
|
|
|
68
73
|
return false;
|
|
69
74
|
}
|
|
70
75
|
jsi::Object obj = value.getObject(runtime);
|
|
76
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
71
79
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "mapId"))) return false;
|
|
72
80
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "liteMode"))) return false;
|
|
73
81
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNCamera>>::canConvert(runtime, obj.getProperty(runtime, "camera"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -62,6 +67,9 @@ namespace margelo::nitro {
|
|
|
62
67
|
return false;
|
|
63
68
|
}
|
|
64
69
|
jsi::Object obj = value.getObject(runtime);
|
|
70
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
65
73
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
66
74
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "kmlString"))) return false;
|
|
67
75
|
return true;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -62,6 +67,9 @@ namespace margelo::nitro {
|
|
|
62
67
|
return false;
|
|
63
68
|
}
|
|
64
69
|
jsi::Object obj = value.getObject(runtime);
|
|
70
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
65
73
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "latitude"))) return false;
|
|
66
74
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "longitude"))) return false;
|
|
67
75
|
return true;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `RNLatLng` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
@@ -63,6 +68,9 @@ namespace margelo::nitro {
|
|
|
63
68
|
return false;
|
|
64
69
|
}
|
|
65
70
|
jsi::Object obj = value.getObject(runtime);
|
|
71
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
66
74
|
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "northEast"))) return false;
|
|
67
75
|
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "southWest"))) return false;
|
|
68
76
|
return true;
|
|
@@ -17,11 +17,23 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `RNLatLng` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
28
|
+
// Forward declaration of `RNLocationAndroid` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLocationAndroid; }
|
|
30
|
+
// Forward declaration of `RNLocationIOS` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLocationIOS; }
|
|
23
32
|
|
|
24
33
|
#include "RNLatLng.hpp"
|
|
34
|
+
#include "RNLocationAndroid.hpp"
|
|
35
|
+
#include <optional>
|
|
36
|
+
#include "RNLocationIOS.hpp"
|
|
25
37
|
|
|
26
38
|
namespace margelo::nitro::rngooglemapsplus {
|
|
27
39
|
|
|
@@ -31,11 +43,17 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
31
43
|
struct RNLocation {
|
|
32
44
|
public:
|
|
33
45
|
RNLatLng center SWIFT_PRIVATE;
|
|
46
|
+
double altitude SWIFT_PRIVATE;
|
|
47
|
+
double accuracy SWIFT_PRIVATE;
|
|
34
48
|
double bearing SWIFT_PRIVATE;
|
|
49
|
+
double speed SWIFT_PRIVATE;
|
|
50
|
+
double time SWIFT_PRIVATE;
|
|
51
|
+
std::optional<RNLocationAndroid> android SWIFT_PRIVATE;
|
|
52
|
+
std::optional<RNLocationIOS> ios SWIFT_PRIVATE;
|
|
35
53
|
|
|
36
54
|
public:
|
|
37
55
|
RNLocation() = default;
|
|
38
|
-
explicit RNLocation(RNLatLng center, double bearing): center(center), bearing(bearing) {}
|
|
56
|
+
explicit RNLocation(RNLatLng center, double altitude, double accuracy, double bearing, double speed, double time, std::optional<RNLocationAndroid> android, std::optional<RNLocationIOS> ios): center(center), altitude(altitude), accuracy(accuracy), bearing(bearing), speed(speed), time(time), android(android), ios(ios) {}
|
|
39
57
|
};
|
|
40
58
|
|
|
41
59
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -49,13 +67,25 @@ namespace margelo::nitro {
|
|
|
49
67
|
jsi::Object obj = arg.asObject(runtime);
|
|
50
68
|
return margelo::nitro::rngooglemapsplus::RNLocation(
|
|
51
69
|
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "center")),
|
|
52
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
70
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "altitude")),
|
|
71
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "accuracy")),
|
|
72
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "bearing")),
|
|
73
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "speed")),
|
|
74
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "time")),
|
|
75
|
+
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationAndroid>>::fromJSI(runtime, obj.getProperty(runtime, "android")),
|
|
76
|
+
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationIOS>>::fromJSI(runtime, obj.getProperty(runtime, "ios"))
|
|
53
77
|
);
|
|
54
78
|
}
|
|
55
79
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNLocation& arg) {
|
|
56
80
|
jsi::Object obj(runtime);
|
|
57
81
|
obj.setProperty(runtime, "center", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.center));
|
|
82
|
+
obj.setProperty(runtime, "altitude", JSIConverter<double>::toJSI(runtime, arg.altitude));
|
|
83
|
+
obj.setProperty(runtime, "accuracy", JSIConverter<double>::toJSI(runtime, arg.accuracy));
|
|
58
84
|
obj.setProperty(runtime, "bearing", JSIConverter<double>::toJSI(runtime, arg.bearing));
|
|
85
|
+
obj.setProperty(runtime, "speed", JSIConverter<double>::toJSI(runtime, arg.speed));
|
|
86
|
+
obj.setProperty(runtime, "time", JSIConverter<double>::toJSI(runtime, arg.time));
|
|
87
|
+
obj.setProperty(runtime, "android", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationAndroid>>::toJSI(runtime, arg.android));
|
|
88
|
+
obj.setProperty(runtime, "ios", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationIOS>>::toJSI(runtime, arg.ios));
|
|
59
89
|
return obj;
|
|
60
90
|
}
|
|
61
91
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -63,8 +93,17 @@ namespace margelo::nitro {
|
|
|
63
93
|
return false;
|
|
64
94
|
}
|
|
65
95
|
jsi::Object obj = value.getObject(runtime);
|
|
96
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
66
99
|
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "center"))) return false;
|
|
100
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "altitude"))) return false;
|
|
101
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "accuracy"))) return false;
|
|
67
102
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "bearing"))) return false;
|
|
103
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "speed"))) return false;
|
|
104
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "time"))) return false;
|
|
105
|
+
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationAndroid>>::canConvert(runtime, obj.getProperty(runtime, "android"))) return false;
|
|
106
|
+
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationIOS>>::canConvert(runtime, obj.getProperty(runtime, "ios"))) return false;
|
|
68
107
|
return true;
|
|
69
108
|
}
|
|
70
109
|
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNLocationAndroid.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
|
+
|
|
27
|
+
|
|
28
|
+
#include <string>
|
|
29
|
+
#include <optional>
|
|
30
|
+
|
|
31
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A struct which can be represented as a JavaScript object (RNLocationAndroid).
|
|
35
|
+
*/
|
|
36
|
+
struct RNLocationAndroid {
|
|
37
|
+
public:
|
|
38
|
+
std::optional<std::string> provider SWIFT_PRIVATE;
|
|
39
|
+
std::optional<double> elapsedRealtimeNanos SWIFT_PRIVATE;
|
|
40
|
+
std::optional<double> bearingAccuracyDegrees SWIFT_PRIVATE;
|
|
41
|
+
std::optional<double> speedAccuracyMetersPerSecond SWIFT_PRIVATE;
|
|
42
|
+
std::optional<double> verticalAccuracyMeters SWIFT_PRIVATE;
|
|
43
|
+
std::optional<double> mslAltitudeMeters SWIFT_PRIVATE;
|
|
44
|
+
std::optional<double> mslAltitudeAccuracyMeters SWIFT_PRIVATE;
|
|
45
|
+
std::optional<bool> isMock SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
RNLocationAndroid() = default;
|
|
49
|
+
explicit RNLocationAndroid(std::optional<std::string> provider, std::optional<double> elapsedRealtimeNanos, std::optional<double> bearingAccuracyDegrees, std::optional<double> speedAccuracyMetersPerSecond, std::optional<double> verticalAccuracyMeters, std::optional<double> mslAltitudeMeters, std::optional<double> mslAltitudeAccuracyMeters, std::optional<bool> isMock): provider(provider), elapsedRealtimeNanos(elapsedRealtimeNanos), bearingAccuracyDegrees(bearingAccuracyDegrees), speedAccuracyMetersPerSecond(speedAccuracyMetersPerSecond), verticalAccuracyMeters(verticalAccuracyMeters), mslAltitudeMeters(mslAltitudeMeters), mslAltitudeAccuracyMeters(mslAltitudeAccuracyMeters), isMock(isMock) {}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
53
|
+
|
|
54
|
+
namespace margelo::nitro {
|
|
55
|
+
|
|
56
|
+
// C++ RNLocationAndroid <> JS RNLocationAndroid (object)
|
|
57
|
+
template <>
|
|
58
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNLocationAndroid> final {
|
|
59
|
+
static inline margelo::nitro::rngooglemapsplus::RNLocationAndroid fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
60
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
61
|
+
return margelo::nitro::rngooglemapsplus::RNLocationAndroid(
|
|
62
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "provider")),
|
|
63
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "elapsedRealtimeNanos")),
|
|
64
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "bearingAccuracyDegrees")),
|
|
65
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "speedAccuracyMetersPerSecond")),
|
|
66
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "verticalAccuracyMeters")),
|
|
67
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "mslAltitudeMeters")),
|
|
68
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "mslAltitudeAccuracyMeters")),
|
|
69
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isMock"))
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNLocationAndroid& arg) {
|
|
73
|
+
jsi::Object obj(runtime);
|
|
74
|
+
obj.setProperty(runtime, "provider", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.provider));
|
|
75
|
+
obj.setProperty(runtime, "elapsedRealtimeNanos", JSIConverter<std::optional<double>>::toJSI(runtime, arg.elapsedRealtimeNanos));
|
|
76
|
+
obj.setProperty(runtime, "bearingAccuracyDegrees", JSIConverter<std::optional<double>>::toJSI(runtime, arg.bearingAccuracyDegrees));
|
|
77
|
+
obj.setProperty(runtime, "speedAccuracyMetersPerSecond", JSIConverter<std::optional<double>>::toJSI(runtime, arg.speedAccuracyMetersPerSecond));
|
|
78
|
+
obj.setProperty(runtime, "verticalAccuracyMeters", JSIConverter<std::optional<double>>::toJSI(runtime, arg.verticalAccuracyMeters));
|
|
79
|
+
obj.setProperty(runtime, "mslAltitudeMeters", JSIConverter<std::optional<double>>::toJSI(runtime, arg.mslAltitudeMeters));
|
|
80
|
+
obj.setProperty(runtime, "mslAltitudeAccuracyMeters", JSIConverter<std::optional<double>>::toJSI(runtime, arg.mslAltitudeAccuracyMeters));
|
|
81
|
+
obj.setProperty(runtime, "isMock", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isMock));
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
85
|
+
if (!value.isObject()) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
jsi::Object obj = value.getObject(runtime);
|
|
89
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "provider"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "elapsedRealtimeNanos"))) return false;
|
|
94
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "bearingAccuracyDegrees"))) return false;
|
|
95
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "speedAccuracyMetersPerSecond"))) return false;
|
|
96
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "verticalAccuracyMeters"))) return false;
|
|
97
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "mslAltitudeMeters"))) return false;
|
|
98
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "mslAltitudeAccuracyMeters"))) return false;
|
|
99
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isMock"))) return false;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
} // namespace margelo::nitro
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `RNAndroidLocationConfig` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::rngooglemapsplus { struct RNAndroidLocationConfig; }
|
|
@@ -67,6 +72,9 @@ namespace margelo::nitro {
|
|
|
67
72
|
return false;
|
|
68
73
|
}
|
|
69
74
|
jsi::Object obj = value.getObject(runtime);
|
|
75
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
70
78
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNAndroidLocationConfig>>::canConvert(runtime, obj.getProperty(runtime, "android"))) return false;
|
|
71
79
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNIOSLocationConfig>>::canConvert(runtime, obj.getProperty(runtime, "ios"))) return false;
|
|
72
80
|
return true;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNLocationIOS.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
|
+
|
|
27
|
+
|
|
28
|
+
#include <optional>
|
|
29
|
+
|
|
30
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A struct which can be represented as a JavaScript object (RNLocationIOS).
|
|
34
|
+
*/
|
|
35
|
+
struct RNLocationIOS {
|
|
36
|
+
public:
|
|
37
|
+
std::optional<double> horizontalAccuracy SWIFT_PRIVATE;
|
|
38
|
+
std::optional<double> verticalAccuracy SWIFT_PRIVATE;
|
|
39
|
+
std::optional<double> speedAccuracy SWIFT_PRIVATE;
|
|
40
|
+
std::optional<double> courseAccuracy SWIFT_PRIVATE;
|
|
41
|
+
std::optional<double> floor SWIFT_PRIVATE;
|
|
42
|
+
std::optional<bool> isFromMockProvider SWIFT_PRIVATE;
|
|
43
|
+
std::optional<double> timestamp SWIFT_PRIVATE;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
RNLocationIOS() = default;
|
|
47
|
+
explicit RNLocationIOS(std::optional<double> horizontalAccuracy, std::optional<double> verticalAccuracy, std::optional<double> speedAccuracy, std::optional<double> courseAccuracy, std::optional<double> floor, std::optional<bool> isFromMockProvider, std::optional<double> timestamp): horizontalAccuracy(horizontalAccuracy), verticalAccuracy(verticalAccuracy), speedAccuracy(speedAccuracy), courseAccuracy(courseAccuracy), floor(floor), isFromMockProvider(isFromMockProvider), timestamp(timestamp) {}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
51
|
+
|
|
52
|
+
namespace margelo::nitro {
|
|
53
|
+
|
|
54
|
+
// C++ RNLocationIOS <> JS RNLocationIOS (object)
|
|
55
|
+
template <>
|
|
56
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNLocationIOS> final {
|
|
57
|
+
static inline margelo::nitro::rngooglemapsplus::RNLocationIOS fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
58
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
59
|
+
return margelo::nitro::rngooglemapsplus::RNLocationIOS(
|
|
60
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "horizontalAccuracy")),
|
|
61
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "verticalAccuracy")),
|
|
62
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "speedAccuracy")),
|
|
63
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "courseAccuracy")),
|
|
64
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "floor")),
|
|
65
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isFromMockProvider")),
|
|
66
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "timestamp"))
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNLocationIOS& arg) {
|
|
70
|
+
jsi::Object obj(runtime);
|
|
71
|
+
obj.setProperty(runtime, "horizontalAccuracy", JSIConverter<std::optional<double>>::toJSI(runtime, arg.horizontalAccuracy));
|
|
72
|
+
obj.setProperty(runtime, "verticalAccuracy", JSIConverter<std::optional<double>>::toJSI(runtime, arg.verticalAccuracy));
|
|
73
|
+
obj.setProperty(runtime, "speedAccuracy", JSIConverter<std::optional<double>>::toJSI(runtime, arg.speedAccuracy));
|
|
74
|
+
obj.setProperty(runtime, "courseAccuracy", JSIConverter<std::optional<double>>::toJSI(runtime, arg.courseAccuracy));
|
|
75
|
+
obj.setProperty(runtime, "floor", JSIConverter<std::optional<double>>::toJSI(runtime, arg.floor));
|
|
76
|
+
obj.setProperty(runtime, "isFromMockProvider", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isFromMockProvider));
|
|
77
|
+
obj.setProperty(runtime, "timestamp", JSIConverter<std::optional<double>>::toJSI(runtime, arg.timestamp));
|
|
78
|
+
return obj;
|
|
79
|
+
}
|
|
80
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
81
|
+
if (!value.isObject()) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
jsi::Object obj = value.getObject(runtime);
|
|
85
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "horizontalAccuracy"))) return false;
|
|
89
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "verticalAccuracy"))) return false;
|
|
90
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "speedAccuracy"))) return false;
|
|
91
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "courseAccuracy"))) return false;
|
|
92
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "floor"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isFromMockProvider"))) return false;
|
|
94
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "timestamp"))) return false;
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
} // namespace margelo::nitro
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `RNAndroidLocationPermissionResult` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::rngooglemapsplus { enum class RNAndroidLocationPermissionResult; }
|
|
@@ -67,6 +72,9 @@ namespace margelo::nitro {
|
|
|
67
72
|
return false;
|
|
68
73
|
}
|
|
69
74
|
jsi::Object obj = value.getObject(runtime);
|
|
75
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
70
78
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNAndroidLocationPermissionResult>>::canConvert(runtime, obj.getProperty(runtime, "android"))) return false;
|
|
71
79
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNIOSPermissionResult>>::canConvert(runtime, obj.getProperty(runtime, "ios"))) return false;
|
|
72
80
|
return true;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -68,6 +73,9 @@ namespace margelo::nitro {
|
|
|
68
73
|
return false;
|
|
69
74
|
}
|
|
70
75
|
jsi::Object obj = value.getObject(runtime);
|
|
76
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
71
79
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "top"))) return false;
|
|
72
80
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "left"))) return false;
|
|
73
81
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "bottom"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -89,6 +94,9 @@ namespace margelo::nitro {
|
|
|
89
94
|
return false;
|
|
90
95
|
}
|
|
91
96
|
jsi::Object obj = value.getObject(runtime);
|
|
97
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
92
100
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "allGesturesEnabled"))) return false;
|
|
93
101
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "compassEnabled"))) return false;
|
|
94
102
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "indoorLevelPickerEnabled"))) return false;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -62,6 +67,9 @@ namespace margelo::nitro {
|
|
|
62
67
|
return false;
|
|
63
68
|
}
|
|
64
69
|
jsi::Object obj = value.getObject(runtime);
|
|
70
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
65
73
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "min"))) return false;
|
|
66
74
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "max"))) return false;
|
|
67
75
|
return true;
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
// Forward declaration of `RNLatLng` to properly resolve imports.
|
|
22
27
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
@@ -48,11 +53,13 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
48
53
|
std::optional<double> opacity SWIFT_PRIVATE;
|
|
49
54
|
std::optional<bool> flat SWIFT_PRIVATE;
|
|
50
55
|
std::optional<bool> draggable SWIFT_PRIVATE;
|
|
56
|
+
std::optional<double> rotation SWIFT_PRIVATE;
|
|
57
|
+
std::optional<RNPosition> infoWindowAnchor SWIFT_PRIVATE;
|
|
51
58
|
std::optional<RNMarkerSvg> iconSvg SWIFT_PRIVATE;
|
|
52
59
|
|
|
53
60
|
public:
|
|
54
61
|
RNMarker() = default;
|
|
55
|
-
explicit RNMarker(std::string id, std::optional<double> zIndex, RNLatLng coordinate, std::optional<RNPosition> anchor, std::optional<bool> showInfoWindow, std::optional<std::string> title, std::optional<std::string> snippet, std::optional<double> opacity, std::optional<bool> flat, std::optional<bool> draggable, std::optional<RNMarkerSvg> iconSvg): id(id), zIndex(zIndex), coordinate(coordinate), anchor(anchor), showInfoWindow(showInfoWindow), title(title), snippet(snippet), opacity(opacity), flat(flat), draggable(draggable), iconSvg(iconSvg) {}
|
|
62
|
+
explicit RNMarker(std::string id, std::optional<double> zIndex, RNLatLng coordinate, std::optional<RNPosition> anchor, std::optional<bool> showInfoWindow, std::optional<std::string> title, std::optional<std::string> snippet, std::optional<double> opacity, std::optional<bool> flat, std::optional<bool> draggable, std::optional<double> rotation, std::optional<RNPosition> infoWindowAnchor, std::optional<RNMarkerSvg> iconSvg): id(id), zIndex(zIndex), coordinate(coordinate), anchor(anchor), showInfoWindow(showInfoWindow), title(title), snippet(snippet), opacity(opacity), flat(flat), draggable(draggable), rotation(rotation), infoWindowAnchor(infoWindowAnchor), iconSvg(iconSvg) {}
|
|
56
63
|
};
|
|
57
64
|
|
|
58
65
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -75,6 +82,8 @@ namespace margelo::nitro {
|
|
|
75
82
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "opacity")),
|
|
76
83
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "flat")),
|
|
77
84
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "draggable")),
|
|
85
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "rotation")),
|
|
86
|
+
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::fromJSI(runtime, obj.getProperty(runtime, "infoWindowAnchor")),
|
|
78
87
|
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::fromJSI(runtime, obj.getProperty(runtime, "iconSvg"))
|
|
79
88
|
);
|
|
80
89
|
}
|
|
@@ -90,6 +99,8 @@ namespace margelo::nitro {
|
|
|
90
99
|
obj.setProperty(runtime, "opacity", JSIConverter<std::optional<double>>::toJSI(runtime, arg.opacity));
|
|
91
100
|
obj.setProperty(runtime, "flat", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.flat));
|
|
92
101
|
obj.setProperty(runtime, "draggable", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.draggable));
|
|
102
|
+
obj.setProperty(runtime, "rotation", JSIConverter<std::optional<double>>::toJSI(runtime, arg.rotation));
|
|
103
|
+
obj.setProperty(runtime, "infoWindowAnchor", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::toJSI(runtime, arg.infoWindowAnchor));
|
|
93
104
|
obj.setProperty(runtime, "iconSvg", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::toJSI(runtime, arg.iconSvg));
|
|
94
105
|
return obj;
|
|
95
106
|
}
|
|
@@ -98,6 +109,9 @@ namespace margelo::nitro {
|
|
|
98
109
|
return false;
|
|
99
110
|
}
|
|
100
111
|
jsi::Object obj = value.getObject(runtime);
|
|
112
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
101
115
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
102
116
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
103
117
|
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "coordinate"))) return false;
|
|
@@ -108,6 +122,8 @@ namespace margelo::nitro {
|
|
|
108
122
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "opacity"))) return false;
|
|
109
123
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "flat"))) return false;
|
|
110
124
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "draggable"))) return false;
|
|
125
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "rotation"))) return false;
|
|
126
|
+
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::canConvert(runtime, obj.getProperty(runtime, "infoWindowAnchor"))) return false;
|
|
111
127
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::canConvert(runtime, obj.getProperty(runtime, "iconSvg"))) return false;
|
|
112
128
|
return true;
|
|
113
129
|
}
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
#else
|
|
18
18
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
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
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
|
|
@@ -65,6 +70,9 @@ namespace margelo::nitro {
|
|
|
65
70
|
return false;
|
|
66
71
|
}
|
|
67
72
|
jsi::Object obj = value.getObject(runtime);
|
|
73
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
68
76
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "width"))) return false;
|
|
69
77
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "height"))) return false;
|
|
70
78
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "svgString"))) return false;
|