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
|
@@ -13,18 +13,22 @@
|
|
|
13
13
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
14
|
#endif
|
|
15
15
|
|
|
16
|
-
// Forward declaration of `
|
|
17
|
-
namespace margelo::nitro::rngooglemapsplus { struct
|
|
16
|
+
// Forward declaration of `RNInitialProps` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNInitialProps; }
|
|
18
18
|
// Forward declaration of `RNUserInterfaceStyle` to properly resolve imports.
|
|
19
19
|
namespace margelo::nitro::rngooglemapsplus { enum class RNUserInterfaceStyle; }
|
|
20
20
|
// Forward declaration of `RNMapPadding` to properly resolve imports.
|
|
21
21
|
namespace margelo::nitro::rngooglemapsplus { struct RNMapPadding; }
|
|
22
|
+
// Forward declaration of `RNMapType` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::rngooglemapsplus { enum class RNMapType; }
|
|
22
24
|
// Forward declaration of `RNMarker` to properly resolve imports.
|
|
23
25
|
namespace margelo::nitro::rngooglemapsplus { struct RNMarker; }
|
|
24
26
|
// Forward declaration of `RNPolygon` to properly resolve imports.
|
|
25
27
|
namespace margelo::nitro::rngooglemapsplus { struct RNPolygon; }
|
|
26
28
|
// Forward declaration of `RNPolyline` to properly resolve imports.
|
|
27
29
|
namespace margelo::nitro::rngooglemapsplus { struct RNPolyline; }
|
|
30
|
+
// Forward declaration of `RNCircle` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNCircle; }
|
|
28
32
|
// Forward declaration of `RNMapErrorCode` to properly resolve imports.
|
|
29
33
|
namespace margelo::nitro::rngooglemapsplus { enum class RNMapErrorCode; }
|
|
30
34
|
// Forward declaration of `RNLocation` to properly resolve imports.
|
|
@@ -35,24 +39,29 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNLocationErrorCode; }
|
|
|
35
39
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
36
40
|
// Forward declaration of `RNRegion` to properly resolve imports.
|
|
37
41
|
namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
|
|
42
|
+
// Forward declaration of `RNCamera` to properly resolve imports.
|
|
43
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
|
|
38
44
|
// Forward declaration of `RNLocationPermissionResult` to properly resolve imports.
|
|
39
45
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult; }
|
|
40
46
|
|
|
47
|
+
#include "RNInitialProps.hpp"
|
|
48
|
+
#include <optional>
|
|
41
49
|
#include <string>
|
|
42
|
-
#include "RNCamera.hpp"
|
|
43
50
|
#include "RNUserInterfaceStyle.hpp"
|
|
44
51
|
#include "RNMapPadding.hpp"
|
|
52
|
+
#include "RNMapType.hpp"
|
|
45
53
|
#include "RNMarker.hpp"
|
|
46
54
|
#include <vector>
|
|
47
55
|
#include "RNPolygon.hpp"
|
|
48
56
|
#include "RNPolyline.hpp"
|
|
57
|
+
#include "RNCircle.hpp"
|
|
49
58
|
#include "RNMapErrorCode.hpp"
|
|
50
59
|
#include <functional>
|
|
51
|
-
#include <optional>
|
|
52
60
|
#include "RNLocation.hpp"
|
|
53
61
|
#include "RNLocationErrorCode.hpp"
|
|
54
62
|
#include "RNLatLng.hpp"
|
|
55
63
|
#include "RNRegion.hpp"
|
|
64
|
+
#include "RNCamera.hpp"
|
|
56
65
|
#include "RNLocationPermissionResult.hpp"
|
|
57
66
|
#include <NitroModules/Promise.hpp>
|
|
58
67
|
|
|
@@ -83,28 +92,32 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
83
92
|
|
|
84
93
|
public:
|
|
85
94
|
// Properties
|
|
86
|
-
virtual
|
|
87
|
-
virtual void
|
|
88
|
-
virtual bool
|
|
89
|
-
virtual void
|
|
90
|
-
virtual std::
|
|
91
|
-
virtual void
|
|
92
|
-
virtual
|
|
93
|
-
virtual void
|
|
94
|
-
virtual RNUserInterfaceStyle getUserInterfaceStyle() = 0;
|
|
95
|
-
virtual void setUserInterfaceStyle(RNUserInterfaceStyle userInterfaceStyle) = 0;
|
|
96
|
-
virtual double getMinZoomLevel() = 0;
|
|
97
|
-
virtual void setMinZoomLevel(double minZoomLevel) = 0;
|
|
98
|
-
virtual double getMaxZoomLevel() = 0;
|
|
99
|
-
virtual void setMaxZoomLevel(double maxZoomLevel) = 0;
|
|
100
|
-
virtual RNMapPadding getMapPadding() = 0;
|
|
101
|
-
virtual void setMapPadding(const RNMapPadding
|
|
102
|
-
virtual std::
|
|
103
|
-
virtual void
|
|
104
|
-
virtual std::vector<
|
|
105
|
-
virtual void
|
|
106
|
-
virtual std::vector<
|
|
107
|
-
virtual void
|
|
95
|
+
virtual std::optional<RNInitialProps> getInitialProps() = 0;
|
|
96
|
+
virtual void setInitialProps(const std::optional<RNInitialProps>& initialProps) = 0;
|
|
97
|
+
virtual std::optional<bool> getBuildingEnabled() = 0;
|
|
98
|
+
virtual void setBuildingEnabled(std::optional<bool> buildingEnabled) = 0;
|
|
99
|
+
virtual std::optional<bool> getTrafficEnabled() = 0;
|
|
100
|
+
virtual void setTrafficEnabled(std::optional<bool> trafficEnabled) = 0;
|
|
101
|
+
virtual std::optional<std::string> getCustomMapStyle() = 0;
|
|
102
|
+
virtual void setCustomMapStyle(const std::optional<std::string>& customMapStyle) = 0;
|
|
103
|
+
virtual std::optional<RNUserInterfaceStyle> getUserInterfaceStyle() = 0;
|
|
104
|
+
virtual void setUserInterfaceStyle(std::optional<RNUserInterfaceStyle> userInterfaceStyle) = 0;
|
|
105
|
+
virtual std::optional<double> getMinZoomLevel() = 0;
|
|
106
|
+
virtual void setMinZoomLevel(std::optional<double> minZoomLevel) = 0;
|
|
107
|
+
virtual std::optional<double> getMaxZoomLevel() = 0;
|
|
108
|
+
virtual void setMaxZoomLevel(std::optional<double> maxZoomLevel) = 0;
|
|
109
|
+
virtual std::optional<RNMapPadding> getMapPadding() = 0;
|
|
110
|
+
virtual void setMapPadding(const std::optional<RNMapPadding>& mapPadding) = 0;
|
|
111
|
+
virtual std::optional<RNMapType> getMapType() = 0;
|
|
112
|
+
virtual void setMapType(std::optional<RNMapType> mapType) = 0;
|
|
113
|
+
virtual std::optional<std::vector<RNMarker>> getMarkers() = 0;
|
|
114
|
+
virtual void setMarkers(const std::optional<std::vector<RNMarker>>& markers) = 0;
|
|
115
|
+
virtual std::optional<std::vector<RNPolygon>> getPolygons() = 0;
|
|
116
|
+
virtual void setPolygons(const std::optional<std::vector<RNPolygon>>& polygons) = 0;
|
|
117
|
+
virtual std::optional<std::vector<RNPolyline>> getPolylines() = 0;
|
|
118
|
+
virtual void setPolylines(const std::optional<std::vector<RNPolyline>>& polylines) = 0;
|
|
119
|
+
virtual std::optional<std::vector<RNCircle>> getCircles() = 0;
|
|
120
|
+
virtual void setCircles(const std::optional<std::vector<RNCircle>>& circles) = 0;
|
|
108
121
|
virtual std::optional<std::function<void(RNMapErrorCode /* error */)>> getOnMapError() = 0;
|
|
109
122
|
virtual void setOnMapError(const std::optional<std::function<void(RNMapErrorCode /* error */)>>& onMapError) = 0;
|
|
110
123
|
virtual std::optional<std::function<void(bool /* ready */)>> getOnMapReady() = 0;
|
|
@@ -117,6 +130,12 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
117
130
|
virtual void setOnMapPress(const std::optional<std::function<void(const RNLatLng& /* coordinate */)>>& onMapPress) = 0;
|
|
118
131
|
virtual std::optional<std::function<void(const std::string& /* id */)>> getOnMarkerPress() = 0;
|
|
119
132
|
virtual void setOnMarkerPress(const std::optional<std::function<void(const std::string& /* id */)>>& onMarkerPress) = 0;
|
|
133
|
+
virtual std::optional<std::function<void(const std::string& /* id */)>> getOnPolylinePress() = 0;
|
|
134
|
+
virtual void setOnPolylinePress(const std::optional<std::function<void(const std::string& /* id */)>>& onPolylinePress) = 0;
|
|
135
|
+
virtual std::optional<std::function<void(const std::string& /* id */)>> getOnPolygonPress() = 0;
|
|
136
|
+
virtual void setOnPolygonPress(const std::optional<std::function<void(const std::string& /* id */)>>& onPolygonPress) = 0;
|
|
137
|
+
virtual std::optional<std::function<void(const std::string& /* id */)>> getOnCirclePress() = 0;
|
|
138
|
+
virtual void setOnCirclePress(const std::optional<std::function<void(const std::string& /* id */)>>& onCirclePress) = 0;
|
|
120
139
|
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>> getOnCameraChangeStart() = 0;
|
|
121
140
|
virtual void setOnCameraChangeStart(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>& onCameraChangeStart) = 0;
|
|
122
141
|
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>> getOnCameraChange() = 0;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNCircle.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
|
+
|
|
21
|
+
// Forward declaration of `RNLatLng` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
23
|
+
|
|
24
|
+
#include <string>
|
|
25
|
+
#include <optional>
|
|
26
|
+
#include "RNLatLng.hpp"
|
|
27
|
+
|
|
28
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A struct which can be represented as a JavaScript object (RNCircle).
|
|
32
|
+
*/
|
|
33
|
+
struct RNCircle {
|
|
34
|
+
public:
|
|
35
|
+
std::string id SWIFT_PRIVATE;
|
|
36
|
+
std::optional<bool> pressable SWIFT_PRIVATE;
|
|
37
|
+
std::optional<double> zIndex SWIFT_PRIVATE;
|
|
38
|
+
RNLatLng center SWIFT_PRIVATE;
|
|
39
|
+
std::optional<double> radius SWIFT_PRIVATE;
|
|
40
|
+
std::optional<double> strokeWidth SWIFT_PRIVATE;
|
|
41
|
+
std::optional<std::string> strokeColor SWIFT_PRIVATE;
|
|
42
|
+
std::optional<std::string> fillColor SWIFT_PRIVATE;
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
RNCircle() = default;
|
|
46
|
+
explicit RNCircle(std::string id, std::optional<bool> pressable, std::optional<double> zIndex, RNLatLng center, std::optional<double> radius, std::optional<double> strokeWidth, std::optional<std::string> strokeColor, std::optional<std::string> fillColor): id(id), pressable(pressable), zIndex(zIndex), center(center), radius(radius), strokeWidth(strokeWidth), strokeColor(strokeColor), fillColor(fillColor) {}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
50
|
+
|
|
51
|
+
namespace margelo::nitro {
|
|
52
|
+
|
|
53
|
+
// C++ RNCircle <> JS RNCircle (object)
|
|
54
|
+
template <>
|
|
55
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNCircle> final {
|
|
56
|
+
static inline margelo::nitro::rngooglemapsplus::RNCircle fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
57
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
58
|
+
return margelo::nitro::rngooglemapsplus::RNCircle(
|
|
59
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
60
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "pressable")),
|
|
61
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
62
|
+
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "center")),
|
|
63
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "radius")),
|
|
64
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "strokeWidth")),
|
|
65
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "strokeColor")),
|
|
66
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "fillColor"))
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNCircle& arg) {
|
|
70
|
+
jsi::Object obj(runtime);
|
|
71
|
+
obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
72
|
+
obj.setProperty(runtime, "pressable", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.pressable));
|
|
73
|
+
obj.setProperty(runtime, "zIndex", JSIConverter<std::optional<double>>::toJSI(runtime, arg.zIndex));
|
|
74
|
+
obj.setProperty(runtime, "center", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.center));
|
|
75
|
+
obj.setProperty(runtime, "radius", JSIConverter<std::optional<double>>::toJSI(runtime, arg.radius));
|
|
76
|
+
obj.setProperty(runtime, "strokeWidth", JSIConverter<std::optional<double>>::toJSI(runtime, arg.strokeWidth));
|
|
77
|
+
obj.setProperty(runtime, "strokeColor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.strokeColor));
|
|
78
|
+
obj.setProperty(runtime, "fillColor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.fillColor));
|
|
79
|
+
return obj;
|
|
80
|
+
}
|
|
81
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
82
|
+
if (!value.isObject()) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
jsi::Object obj = value.getObject(runtime);
|
|
86
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
87
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "pressable"))) return false;
|
|
88
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
89
|
+
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "center"))) return false;
|
|
90
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "radius"))) return false;
|
|
91
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "strokeWidth"))) return false;
|
|
92
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "strokeColor"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "fillColor"))) return false;
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNInitialProps.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
|
+
|
|
21
|
+
// Forward declaration of `RNCamera` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
|
|
23
|
+
|
|
24
|
+
#include <string>
|
|
25
|
+
#include <optional>
|
|
26
|
+
#include "RNCamera.hpp"
|
|
27
|
+
|
|
28
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A struct which can be represented as a JavaScript object (RNInitialProps).
|
|
32
|
+
*/
|
|
33
|
+
struct RNInitialProps {
|
|
34
|
+
public:
|
|
35
|
+
std::optional<std::string> mapId SWIFT_PRIVATE;
|
|
36
|
+
std::optional<bool> liteMode SWIFT_PRIVATE;
|
|
37
|
+
std::optional<RNCamera> initialCamera SWIFT_PRIVATE;
|
|
38
|
+
|
|
39
|
+
public:
|
|
40
|
+
RNInitialProps() = default;
|
|
41
|
+
explicit RNInitialProps(std::optional<std::string> mapId, std::optional<bool> liteMode, std::optional<RNCamera> initialCamera): mapId(mapId), liteMode(liteMode), initialCamera(initialCamera) {}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
45
|
+
|
|
46
|
+
namespace margelo::nitro {
|
|
47
|
+
|
|
48
|
+
// C++ RNInitialProps <> JS RNInitialProps (object)
|
|
49
|
+
template <>
|
|
50
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNInitialProps> final {
|
|
51
|
+
static inline margelo::nitro::rngooglemapsplus::RNInitialProps fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
52
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
53
|
+
return margelo::nitro::rngooglemapsplus::RNInitialProps(
|
|
54
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "mapId")),
|
|
55
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "liteMode")),
|
|
56
|
+
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNCamera>>::fromJSI(runtime, obj.getProperty(runtime, "initialCamera"))
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNInitialProps& arg) {
|
|
60
|
+
jsi::Object obj(runtime);
|
|
61
|
+
obj.setProperty(runtime, "mapId", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.mapId));
|
|
62
|
+
obj.setProperty(runtime, "liteMode", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.liteMode));
|
|
63
|
+
obj.setProperty(runtime, "initialCamera", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNCamera>>::toJSI(runtime, arg.initialCamera));
|
|
64
|
+
return obj;
|
|
65
|
+
}
|
|
66
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
67
|
+
if (!value.isObject()) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
jsi::Object obj = value.getObject(runtime);
|
|
71
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "mapId"))) return false;
|
|
72
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "liteMode"))) return false;
|
|
73
|
+
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNCamera>>::canConvert(runtime, obj.getProperty(runtime, "initialCamera"))) return false;
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNMapType.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/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (RNMapType).
|
|
30
|
+
*/
|
|
31
|
+
enum class RNMapType {
|
|
32
|
+
NONE SWIFT_NAME(none) = 0,
|
|
33
|
+
NORMAL SWIFT_NAME(normal) = 1,
|
|
34
|
+
HYBRID SWIFT_NAME(hybrid) = 2,
|
|
35
|
+
SATELLITE SWIFT_NAME(satellite) = 3,
|
|
36
|
+
TERRAIN SWIFT_NAME(terrain) = 4,
|
|
37
|
+
} CLOSED_ENUM;
|
|
38
|
+
|
|
39
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
40
|
+
|
|
41
|
+
namespace margelo::nitro {
|
|
42
|
+
|
|
43
|
+
// C++ RNMapType <> JS RNMapType (union)
|
|
44
|
+
template <>
|
|
45
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNMapType> final {
|
|
46
|
+
static inline margelo::nitro::rngooglemapsplus::RNMapType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
47
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
48
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
49
|
+
case hashString("none"): return margelo::nitro::rngooglemapsplus::RNMapType::NONE;
|
|
50
|
+
case hashString("normal"): return margelo::nitro::rngooglemapsplus::RNMapType::NORMAL;
|
|
51
|
+
case hashString("hybrid"): return margelo::nitro::rngooglemapsplus::RNMapType::HYBRID;
|
|
52
|
+
case hashString("satellite"): return margelo::nitro::rngooglemapsplus::RNMapType::SATELLITE;
|
|
53
|
+
case hashString("terrain"): return margelo::nitro::rngooglemapsplus::RNMapType::TERRAIN;
|
|
54
|
+
default: [[unlikely]]
|
|
55
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum RNMapType - invalid value!");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rngooglemapsplus::RNMapType arg) {
|
|
59
|
+
switch (arg) {
|
|
60
|
+
case margelo::nitro::rngooglemapsplus::RNMapType::NONE: return JSIConverter<std::string>::toJSI(runtime, "none");
|
|
61
|
+
case margelo::nitro::rngooglemapsplus::RNMapType::NORMAL: return JSIConverter<std::string>::toJSI(runtime, "normal");
|
|
62
|
+
case margelo::nitro::rngooglemapsplus::RNMapType::HYBRID: return JSIConverter<std::string>::toJSI(runtime, "hybrid");
|
|
63
|
+
case margelo::nitro::rngooglemapsplus::RNMapType::SATELLITE: return JSIConverter<std::string>::toJSI(runtime, "satellite");
|
|
64
|
+
case margelo::nitro::rngooglemapsplus::RNMapType::TERRAIN: return JSIConverter<std::string>::toJSI(runtime, "terrain");
|
|
65
|
+
default: [[unlikely]]
|
|
66
|
+
throw std::invalid_argument("Cannot convert RNMapType to JS - invalid value: "
|
|
67
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
71
|
+
if (!value.isString()) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
75
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
76
|
+
case hashString("none"):
|
|
77
|
+
case hashString("normal"):
|
|
78
|
+
case hashString("hybrid"):
|
|
79
|
+
case hashString("satellite"):
|
|
80
|
+
case hashString("terrain"):
|
|
81
|
+
return true;
|
|
82
|
+
default:
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
} // namespace margelo::nitro
|
|
@@ -24,9 +24,9 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
|
24
24
|
namespace margelo::nitro::rngooglemapsplus { struct RNPosition; }
|
|
25
25
|
|
|
26
26
|
#include <string>
|
|
27
|
+
#include <optional>
|
|
27
28
|
#include "RNLatLng.hpp"
|
|
28
29
|
#include "RNPosition.hpp"
|
|
29
|
-
#include <optional>
|
|
30
30
|
|
|
31
31
|
namespace margelo::nitro::rngooglemapsplus {
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
36
36
|
struct RNMarker {
|
|
37
37
|
public:
|
|
38
38
|
std::string id SWIFT_PRIVATE;
|
|
39
|
-
double zIndex SWIFT_PRIVATE;
|
|
39
|
+
std::optional<double> zIndex SWIFT_PRIVATE;
|
|
40
40
|
RNLatLng coordinate SWIFT_PRIVATE;
|
|
41
41
|
std::optional<RNPosition> anchor SWIFT_PRIVATE;
|
|
42
42
|
double width SWIFT_PRIVATE;
|
|
@@ -45,7 +45,7 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
45
45
|
|
|
46
46
|
public:
|
|
47
47
|
RNMarker() = default;
|
|
48
|
-
explicit RNMarker(std::string id, double zIndex, RNLatLng coordinate, std::optional<RNPosition> anchor, double width, double height, std::string iconSvg): id(id), zIndex(zIndex), coordinate(coordinate), anchor(anchor), width(width), height(height), iconSvg(iconSvg) {}
|
|
48
|
+
explicit RNMarker(std::string id, std::optional<double> zIndex, RNLatLng coordinate, std::optional<RNPosition> anchor, double width, double height, std::string iconSvg): id(id), zIndex(zIndex), coordinate(coordinate), anchor(anchor), width(width), height(height), iconSvg(iconSvg) {}
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -59,7 +59,7 @@ namespace margelo::nitro {
|
|
|
59
59
|
jsi::Object obj = arg.asObject(runtime);
|
|
60
60
|
return margelo::nitro::rngooglemapsplus::RNMarker(
|
|
61
61
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
62
|
-
JSIConverter<double
|
|
62
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
63
63
|
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "coordinate")),
|
|
64
64
|
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
|
|
65
65
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "width")),
|
|
@@ -70,7 +70,7 @@ namespace margelo::nitro {
|
|
|
70
70
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNMarker& arg) {
|
|
71
71
|
jsi::Object obj(runtime);
|
|
72
72
|
obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
73
|
-
obj.setProperty(runtime, "zIndex", JSIConverter<double
|
|
73
|
+
obj.setProperty(runtime, "zIndex", JSIConverter<std::optional<double>>::toJSI(runtime, arg.zIndex));
|
|
74
74
|
obj.setProperty(runtime, "coordinate", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.coordinate));
|
|
75
75
|
obj.setProperty(runtime, "anchor", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::toJSI(runtime, arg.anchor));
|
|
76
76
|
obj.setProperty(runtime, "width", JSIConverter<double>::toJSI(runtime, arg.width));
|
|
@@ -84,7 +84,7 @@ namespace margelo::nitro {
|
|
|
84
84
|
}
|
|
85
85
|
jsi::Object obj = value.getObject(runtime);
|
|
86
86
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
87
|
-
if (!JSIConverter<double
|
|
87
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
88
88
|
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "coordinate"))) return false;
|
|
89
89
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
|
|
90
90
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "width"))) return false;
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
23
23
|
|
|
24
24
|
#include <string>
|
|
25
|
+
#include <optional>
|
|
25
26
|
#include "RNLatLng.hpp"
|
|
26
27
|
#include <vector>
|
|
27
|
-
#include <optional>
|
|
28
28
|
|
|
29
29
|
namespace margelo::nitro::rngooglemapsplus {
|
|
30
30
|
|
|
@@ -34,7 +34,8 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
34
34
|
struct RNPolygon {
|
|
35
35
|
public:
|
|
36
36
|
std::string id SWIFT_PRIVATE;
|
|
37
|
-
double zIndex SWIFT_PRIVATE;
|
|
37
|
+
std::optional<double> zIndex SWIFT_PRIVATE;
|
|
38
|
+
std::optional<bool> pressable SWIFT_PRIVATE;
|
|
38
39
|
std::vector<RNLatLng> coordinates SWIFT_PRIVATE;
|
|
39
40
|
std::optional<std::string> fillColor SWIFT_PRIVATE;
|
|
40
41
|
std::optional<std::string> strokeColor SWIFT_PRIVATE;
|
|
@@ -42,7 +43,7 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
42
43
|
|
|
43
44
|
public:
|
|
44
45
|
RNPolygon() = default;
|
|
45
|
-
explicit RNPolygon(std::string id, double zIndex, std::vector<RNLatLng> coordinates, std::optional<std::string> fillColor, std::optional<std::string> strokeColor, std::optional<double> strokeWidth): id(id), zIndex(zIndex), coordinates(coordinates), fillColor(fillColor), strokeColor(strokeColor), strokeWidth(strokeWidth) {}
|
|
46
|
+
explicit RNPolygon(std::string id, std::optional<double> zIndex, std::optional<bool> pressable, std::vector<RNLatLng> coordinates, std::optional<std::string> fillColor, std::optional<std::string> strokeColor, std::optional<double> strokeWidth): id(id), zIndex(zIndex), pressable(pressable), coordinates(coordinates), fillColor(fillColor), strokeColor(strokeColor), strokeWidth(strokeWidth) {}
|
|
46
47
|
};
|
|
47
48
|
|
|
48
49
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -56,7 +57,8 @@ namespace margelo::nitro {
|
|
|
56
57
|
jsi::Object obj = arg.asObject(runtime);
|
|
57
58
|
return margelo::nitro::rngooglemapsplus::RNPolygon(
|
|
58
59
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
59
|
-
JSIConverter<double
|
|
60
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
61
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "pressable")),
|
|
60
62
|
JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::fromJSI(runtime, obj.getProperty(runtime, "coordinates")),
|
|
61
63
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "fillColor")),
|
|
62
64
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "strokeColor")),
|
|
@@ -66,7 +68,8 @@ namespace margelo::nitro {
|
|
|
66
68
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNPolygon& arg) {
|
|
67
69
|
jsi::Object obj(runtime);
|
|
68
70
|
obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
69
|
-
obj.setProperty(runtime, "zIndex", JSIConverter<double
|
|
71
|
+
obj.setProperty(runtime, "zIndex", JSIConverter<std::optional<double>>::toJSI(runtime, arg.zIndex));
|
|
72
|
+
obj.setProperty(runtime, "pressable", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.pressable));
|
|
70
73
|
obj.setProperty(runtime, "coordinates", JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::toJSI(runtime, arg.coordinates));
|
|
71
74
|
obj.setProperty(runtime, "fillColor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.fillColor));
|
|
72
75
|
obj.setProperty(runtime, "strokeColor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.strokeColor));
|
|
@@ -79,7 +82,8 @@ namespace margelo::nitro {
|
|
|
79
82
|
}
|
|
80
83
|
jsi::Object obj = value.getObject(runtime);
|
|
81
84
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
82
|
-
if (!JSIConverter<double
|
|
85
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
86
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "pressable"))) return false;
|
|
83
87
|
if (!JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::canConvert(runtime, obj.getProperty(runtime, "coordinates"))) return false;
|
|
84
88
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "fillColor"))) return false;
|
|
85
89
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "strokeColor"))) return false;
|
|
@@ -26,10 +26,10 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNLineCapType; }
|
|
|
26
26
|
namespace margelo::nitro::rngooglemapsplus { enum class RNLineJoinType; }
|
|
27
27
|
|
|
28
28
|
#include <string>
|
|
29
|
+
#include <optional>
|
|
29
30
|
#include "RNLatLng.hpp"
|
|
30
31
|
#include <vector>
|
|
31
32
|
#include "RNLineCapType.hpp"
|
|
32
|
-
#include <optional>
|
|
33
33
|
#include "RNLineJoinType.hpp"
|
|
34
34
|
|
|
35
35
|
namespace margelo::nitro::rngooglemapsplus {
|
|
@@ -40,7 +40,8 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
40
40
|
struct RNPolyline {
|
|
41
41
|
public:
|
|
42
42
|
std::string id SWIFT_PRIVATE;
|
|
43
|
-
double zIndex SWIFT_PRIVATE;
|
|
43
|
+
std::optional<double> zIndex SWIFT_PRIVATE;
|
|
44
|
+
std::optional<bool> pressable SWIFT_PRIVATE;
|
|
44
45
|
std::vector<RNLatLng> coordinates SWIFT_PRIVATE;
|
|
45
46
|
std::optional<RNLineCapType> lineCap SWIFT_PRIVATE;
|
|
46
47
|
std::optional<RNLineJoinType> lineJoin SWIFT_PRIVATE;
|
|
@@ -49,7 +50,7 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
49
50
|
|
|
50
51
|
public:
|
|
51
52
|
RNPolyline() = default;
|
|
52
|
-
explicit RNPolyline(std::string id, double zIndex, std::vector<RNLatLng> coordinates, std::optional<RNLineCapType> lineCap, std::optional<RNLineJoinType> lineJoin, std::optional<std::string> color, std::optional<double> width): id(id), zIndex(zIndex), coordinates(coordinates), lineCap(lineCap), lineJoin(lineJoin), color(color), width(width) {}
|
|
53
|
+
explicit RNPolyline(std::string id, std::optional<double> zIndex, std::optional<bool> pressable, std::vector<RNLatLng> coordinates, std::optional<RNLineCapType> lineCap, std::optional<RNLineJoinType> lineJoin, std::optional<std::string> color, std::optional<double> width): id(id), zIndex(zIndex), pressable(pressable), coordinates(coordinates), lineCap(lineCap), lineJoin(lineJoin), color(color), width(width) {}
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -63,7 +64,8 @@ namespace margelo::nitro {
|
|
|
63
64
|
jsi::Object obj = arg.asObject(runtime);
|
|
64
65
|
return margelo::nitro::rngooglemapsplus::RNPolyline(
|
|
65
66
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
66
|
-
JSIConverter<double
|
|
67
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
68
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "pressable")),
|
|
67
69
|
JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::fromJSI(runtime, obj.getProperty(runtime, "coordinates")),
|
|
68
70
|
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineCapType>>::fromJSI(runtime, obj.getProperty(runtime, "lineCap")),
|
|
69
71
|
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineJoinType>>::fromJSI(runtime, obj.getProperty(runtime, "lineJoin")),
|
|
@@ -74,7 +76,8 @@ namespace margelo::nitro {
|
|
|
74
76
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNPolyline& arg) {
|
|
75
77
|
jsi::Object obj(runtime);
|
|
76
78
|
obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
77
|
-
obj.setProperty(runtime, "zIndex", JSIConverter<double
|
|
79
|
+
obj.setProperty(runtime, "zIndex", JSIConverter<std::optional<double>>::toJSI(runtime, arg.zIndex));
|
|
80
|
+
obj.setProperty(runtime, "pressable", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.pressable));
|
|
78
81
|
obj.setProperty(runtime, "coordinates", JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::toJSI(runtime, arg.coordinates));
|
|
79
82
|
obj.setProperty(runtime, "lineCap", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineCapType>>::toJSI(runtime, arg.lineCap));
|
|
80
83
|
obj.setProperty(runtime, "lineJoin", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineJoinType>>::toJSI(runtime, arg.lineJoin));
|
|
@@ -88,7 +91,8 @@ namespace margelo::nitro {
|
|
|
88
91
|
}
|
|
89
92
|
jsi::Object obj = value.getObject(runtime);
|
|
90
93
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
91
|
-
if (!JSIConverter<double
|
|
94
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
95
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "pressable"))) return false;
|
|
92
96
|
if (!JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::canConvert(runtime, obj.getProperty(runtime, "coordinates"))) return false;
|
|
93
97
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineCapType>>::canConvert(runtime, obj.getProperty(runtime, "lineCap"))) return false;
|
|
94
98
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineJoinType>>::canConvert(runtime, obj.getProperty(runtime, "lineJoin"))) return false;
|