react-native-google-maps-plus 1.0.2 → 1.1.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -11
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +359 -139
- package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +44 -44
- package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +19 -0
- package/android/src/main/java/com/rngooglemapsplus/{MapMarker.kt → MapMarkerBuilder.kt} +7 -6
- package/android/src/main/java/com/rngooglemapsplus/{MapPolygon.kt → MapPolygonBuilder.kt} +4 -18
- package/android/src/main/java/com/rngooglemapsplus/{MapPolyline.kt → MapPolylineBuilder.kt.kt} +4 -19
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +145 -129
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNCameraExtension.kt +19 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNLocationPriorityExtension.kt +12 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNMapCircleExtension.kt +14 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolygonExtension.kt +20 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolylineExtension.kt +21 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNUserInterfaceExtension.kt +12 -0
- package/android/src/main/java/com/rngooglemapsplus/{Color.kt → extensions/StringExtension.kt} +1 -1
- package/android/src/main/java/com/rngooglemapsplus/extensions/ThrowableExtension.kt +38 -0
- package/ios/GoogleMapViewImpl.swift +348 -150
- package/ios/LocationHandler.swift +29 -69
- package/ios/MapCircleBuilder.swift +20 -0
- package/ios/{MapMarker.swift → MapMarkerBuilder.swift} +11 -42
- package/ios/MapPolygonBuilder.swift +20 -0
- package/ios/MapPolylineBuilder.swift +24 -0
- package/ios/PermissionHandler.swift +1 -1
- package/ios/RNGoogleMapsPlusModule.swift +1 -1
- package/ios/RNGoogleMapsPlusView.swift +159 -168
- package/ios/extensions/RNCamera+Extension.swift +22 -0
- package/ios/extensions/RNCircle+Extension.swift +24 -0
- package/ios/extensions/RNIOSLocationAccuracy+Extensions.swift +19 -0
- package/ios/extensions/RNMarker+Extension.swift +24 -0
- package/ios/{MapPolygon.swift → extensions/RNPolygon+Extension.swift.swift} +7 -23
- package/ios/extensions/RNPolyline+Extension.swift.swift +62 -0
- package/ios/extensions/RNUserInterface+Extension.swift +16 -0
- package/ios/{Color.swift → extensions/String+Extensions.swift} +20 -20
- package/lib/module/types.js +14 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +21 -12
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +59 -3
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +233 -69
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +40 -22
- package/nitrogen/generated/android/c++/JRNAndroidLocationConfig.hpp +63 -0
- package/nitrogen/generated/android/c++/JRNAndroidLocationPriority.hpp +65 -0
- package/nitrogen/generated/android/c++/JRNCircle.hpp +84 -0
- package/nitrogen/generated/android/c++/JRNIOSLocationAccuracy.hpp +65 -0
- package/nitrogen/generated/android/c++/JRNIOSLocationConfig.hpp +59 -0
- package/nitrogen/generated/android/c++/JRNInitialProps.hpp +66 -0
- package/nitrogen/generated/android/c++/JRNLocationConfig.hpp +65 -0
- package/nitrogen/generated/android/c++/JRNMapType.hpp +68 -0
- package/nitrogen/generated/android/c++/JRNMapUiSettings.hpp +93 -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 +40 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +89 -11
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNAndroidLocationConfig.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNAndroidLocationPriority.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCircle.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNIOSLocationAccuracy.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNIOSLocationConfig.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNInitialProps.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationConfig.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapType.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapUiSettings.kt +59 -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 +296 -45
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +27 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +131 -37
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +61 -16
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +20 -11
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +378 -45
- package/nitrogen/generated/ios/swift/RNAndroidLocationConfig.swift +93 -0
- package/nitrogen/generated/ios/swift/RNAndroidLocationPriority.swift +48 -0
- package/nitrogen/generated/ios/swift/RNCircle.swift +198 -0
- package/nitrogen/generated/ios/swift/RNIOSLocationAccuracy.swift +48 -0
- package/nitrogen/generated/ios/swift/RNIOSLocationConfig.swift +70 -0
- package/nitrogen/generated/ios/swift/RNInitialProps.swift +107 -0
- package/nitrogen/generated/ios/swift/RNLocationConfig.swift +84 -0
- package/nitrogen/generated/ios/swift/RNMapType.swift +52 -0
- package/nitrogen/generated/ios/swift/RNMapUiSettings.swift +277 -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 +20 -2
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +59 -26
- package/nitrogen/generated/shared/c++/RNAndroidLocationConfig.hpp +77 -0
- package/nitrogen/generated/shared/c++/RNAndroidLocationPriority.hpp +64 -0
- package/nitrogen/generated/shared/c++/RNCircle.hpp +98 -0
- package/nitrogen/generated/shared/c++/RNIOSLocationAccuracy.hpp +64 -0
- package/nitrogen/generated/shared/c++/RNIOSLocationConfig.hpp +73 -0
- package/nitrogen/generated/shared/c++/RNInitialProps.hpp +78 -0
- package/nitrogen/generated/shared/c++/RNLocationConfig.hpp +76 -0
- package/nitrogen/generated/shared/c++/RNMapType.hpp +88 -0
- package/nitrogen/generated/shared/c++/RNMapUiSettings.hpp +107 -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 +138 -30
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +27 -13
- package/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +10 -1
- package/package.json +5 -5
- package/src/RNGoogleMapsPlusView.nitro.ts +25 -11
- package/src/types.ts +67 -3
- package/ios/MapPolyline.swift +0 -83
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNMapUiSettings.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
|
+
|
|
22
|
+
|
|
23
|
+
#include <optional>
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (RNMapUiSettings).
|
|
29
|
+
*/
|
|
30
|
+
struct RNMapUiSettings {
|
|
31
|
+
public:
|
|
32
|
+
std::optional<bool> allGesturesEnabled SWIFT_PRIVATE;
|
|
33
|
+
std::optional<bool> compassEnabled SWIFT_PRIVATE;
|
|
34
|
+
std::optional<bool> indoorLevelPickerEnabled SWIFT_PRIVATE;
|
|
35
|
+
std::optional<bool> mapToolbarEnabled SWIFT_PRIVATE;
|
|
36
|
+
std::optional<bool> myLocationButtonEnabled SWIFT_PRIVATE;
|
|
37
|
+
std::optional<bool> rotateEnabled SWIFT_PRIVATE;
|
|
38
|
+
std::optional<bool> scrollEnabled SWIFT_PRIVATE;
|
|
39
|
+
std::optional<bool> scrollDuringRotateOrZoomEnabled SWIFT_PRIVATE;
|
|
40
|
+
std::optional<bool> tiltEnabled SWIFT_PRIVATE;
|
|
41
|
+
std::optional<bool> zoomControlsEnabled SWIFT_PRIVATE;
|
|
42
|
+
std::optional<bool> zoomGesturesEnabled SWIFT_PRIVATE;
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
RNMapUiSettings() = default;
|
|
46
|
+
explicit RNMapUiSettings(std::optional<bool> allGesturesEnabled, std::optional<bool> compassEnabled, std::optional<bool> indoorLevelPickerEnabled, std::optional<bool> mapToolbarEnabled, std::optional<bool> myLocationButtonEnabled, std::optional<bool> rotateEnabled, std::optional<bool> scrollEnabled, std::optional<bool> scrollDuringRotateOrZoomEnabled, std::optional<bool> tiltEnabled, std::optional<bool> zoomControlsEnabled, std::optional<bool> zoomGesturesEnabled): allGesturesEnabled(allGesturesEnabled), compassEnabled(compassEnabled), indoorLevelPickerEnabled(indoorLevelPickerEnabled), mapToolbarEnabled(mapToolbarEnabled), myLocationButtonEnabled(myLocationButtonEnabled), rotateEnabled(rotateEnabled), scrollEnabled(scrollEnabled), scrollDuringRotateOrZoomEnabled(scrollDuringRotateOrZoomEnabled), tiltEnabled(tiltEnabled), zoomControlsEnabled(zoomControlsEnabled), zoomGesturesEnabled(zoomGesturesEnabled) {}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
50
|
+
|
|
51
|
+
namespace margelo::nitro {
|
|
52
|
+
|
|
53
|
+
// C++ RNMapUiSettings <> JS RNMapUiSettings (object)
|
|
54
|
+
template <>
|
|
55
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNMapUiSettings> final {
|
|
56
|
+
static inline margelo::nitro::rngooglemapsplus::RNMapUiSettings fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
57
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
58
|
+
return margelo::nitro::rngooglemapsplus::RNMapUiSettings(
|
|
59
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "allGesturesEnabled")),
|
|
60
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "compassEnabled")),
|
|
61
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "indoorLevelPickerEnabled")),
|
|
62
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "mapToolbarEnabled")),
|
|
63
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "myLocationButtonEnabled")),
|
|
64
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "rotateEnabled")),
|
|
65
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "scrollEnabled")),
|
|
66
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "scrollDuringRotateOrZoomEnabled")),
|
|
67
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "tiltEnabled")),
|
|
68
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "zoomControlsEnabled")),
|
|
69
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "zoomGesturesEnabled"))
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNMapUiSettings& arg) {
|
|
73
|
+
jsi::Object obj(runtime);
|
|
74
|
+
obj.setProperty(runtime, "allGesturesEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.allGesturesEnabled));
|
|
75
|
+
obj.setProperty(runtime, "compassEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.compassEnabled));
|
|
76
|
+
obj.setProperty(runtime, "indoorLevelPickerEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.indoorLevelPickerEnabled));
|
|
77
|
+
obj.setProperty(runtime, "mapToolbarEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.mapToolbarEnabled));
|
|
78
|
+
obj.setProperty(runtime, "myLocationButtonEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.myLocationButtonEnabled));
|
|
79
|
+
obj.setProperty(runtime, "rotateEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.rotateEnabled));
|
|
80
|
+
obj.setProperty(runtime, "scrollEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.scrollEnabled));
|
|
81
|
+
obj.setProperty(runtime, "scrollDuringRotateOrZoomEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.scrollDuringRotateOrZoomEnabled));
|
|
82
|
+
obj.setProperty(runtime, "tiltEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.tiltEnabled));
|
|
83
|
+
obj.setProperty(runtime, "zoomControlsEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.zoomControlsEnabled));
|
|
84
|
+
obj.setProperty(runtime, "zoomGesturesEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.zoomGesturesEnabled));
|
|
85
|
+
return obj;
|
|
86
|
+
}
|
|
87
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
88
|
+
if (!value.isObject()) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
jsi::Object obj = value.getObject(runtime);
|
|
92
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "allGesturesEnabled"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "compassEnabled"))) return false;
|
|
94
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "indoorLevelPickerEnabled"))) return false;
|
|
95
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "mapToolbarEnabled"))) return false;
|
|
96
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "myLocationButtonEnabled"))) return false;
|
|
97
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "rotateEnabled"))) return false;
|
|
98
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "scrollEnabled"))) return false;
|
|
99
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "scrollDuringRotateOrZoomEnabled"))) return false;
|
|
100
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "tiltEnabled"))) return false;
|
|
101
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "zoomControlsEnabled"))) return false;
|
|
102
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "zoomGesturesEnabled"))) return false;
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
} // 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;
|
|
@@ -25,116 +25,176 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
25
25
|
const HybridRNGoogleMapsPlusViewProps& sourceProps,
|
|
26
26
|
const react::RawProps& rawProps):
|
|
27
27
|
react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
|
|
28
|
-
|
|
28
|
+
initialProps([&]() -> CachedProp<std::optional<RNInitialProps>> {
|
|
29
|
+
try {
|
|
30
|
+
const react::RawValue* rawValue = rawProps.at("initialProps", nullptr, nullptr);
|
|
31
|
+
if (rawValue == nullptr) return sourceProps.initialProps;
|
|
32
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
33
|
+
return CachedProp<std::optional<RNInitialProps>>::fromRawValue(*runtime, value, sourceProps.initialProps);
|
|
34
|
+
} catch (const std::exception& exc) {
|
|
35
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.initialProps: ") + exc.what());
|
|
36
|
+
}
|
|
37
|
+
}()),
|
|
38
|
+
uiSettings([&]() -> CachedProp<std::optional<RNMapUiSettings>> {
|
|
39
|
+
try {
|
|
40
|
+
const react::RawValue* rawValue = rawProps.at("uiSettings", nullptr, nullptr);
|
|
41
|
+
if (rawValue == nullptr) return sourceProps.uiSettings;
|
|
42
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
43
|
+
return CachedProp<std::optional<RNMapUiSettings>>::fromRawValue(*runtime, value, sourceProps.uiSettings);
|
|
44
|
+
} catch (const std::exception& exc) {
|
|
45
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.uiSettings: ") + exc.what());
|
|
46
|
+
}
|
|
47
|
+
}()),
|
|
48
|
+
myLocationEnabled([&]() -> CachedProp<std::optional<bool>> {
|
|
49
|
+
try {
|
|
50
|
+
const react::RawValue* rawValue = rawProps.at("myLocationEnabled", nullptr, nullptr);
|
|
51
|
+
if (rawValue == nullptr) return sourceProps.myLocationEnabled;
|
|
52
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
53
|
+
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.myLocationEnabled);
|
|
54
|
+
} catch (const std::exception& exc) {
|
|
55
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.myLocationEnabled: ") + exc.what());
|
|
56
|
+
}
|
|
57
|
+
}()),
|
|
58
|
+
buildingEnabled([&]() -> CachedProp<std::optional<bool>> {
|
|
29
59
|
try {
|
|
30
60
|
const react::RawValue* rawValue = rawProps.at("buildingEnabled", nullptr, nullptr);
|
|
31
61
|
if (rawValue == nullptr) return sourceProps.buildingEnabled;
|
|
32
62
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
33
|
-
return CachedProp<bool
|
|
63
|
+
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.buildingEnabled);
|
|
34
64
|
} catch (const std::exception& exc) {
|
|
35
65
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.buildingEnabled: ") + exc.what());
|
|
36
66
|
}
|
|
37
67
|
}()),
|
|
38
|
-
trafficEnabled([&]() -> CachedProp<bool
|
|
68
|
+
trafficEnabled([&]() -> CachedProp<std::optional<bool>> {
|
|
39
69
|
try {
|
|
40
70
|
const react::RawValue* rawValue = rawProps.at("trafficEnabled", nullptr, nullptr);
|
|
41
71
|
if (rawValue == nullptr) return sourceProps.trafficEnabled;
|
|
42
72
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
43
|
-
return CachedProp<bool
|
|
73
|
+
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.trafficEnabled);
|
|
44
74
|
} catch (const std::exception& exc) {
|
|
45
75
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.trafficEnabled: ") + exc.what());
|
|
46
76
|
}
|
|
47
77
|
}()),
|
|
48
|
-
|
|
78
|
+
indoorEnabled([&]() -> CachedProp<std::optional<bool>> {
|
|
49
79
|
try {
|
|
50
|
-
const react::RawValue* rawValue = rawProps.at("
|
|
51
|
-
if (rawValue == nullptr) return sourceProps.
|
|
80
|
+
const react::RawValue* rawValue = rawProps.at("indoorEnabled", nullptr, nullptr);
|
|
81
|
+
if (rawValue == nullptr) return sourceProps.indoorEnabled;
|
|
52
82
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
53
|
-
return CachedProp<std::
|
|
83
|
+
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.indoorEnabled);
|
|
54
84
|
} catch (const std::exception& exc) {
|
|
55
|
-
throw std::runtime_error(std::string("RNGoogleMapsPlusView.
|
|
85
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.indoorEnabled: ") + exc.what());
|
|
56
86
|
}
|
|
57
87
|
}()),
|
|
58
|
-
|
|
88
|
+
customMapStyle([&]() -> CachedProp<std::optional<std::string>> {
|
|
59
89
|
try {
|
|
60
|
-
const react::RawValue* rawValue = rawProps.at("
|
|
61
|
-
if (rawValue == nullptr) return sourceProps.
|
|
90
|
+
const react::RawValue* rawValue = rawProps.at("customMapStyle", nullptr, nullptr);
|
|
91
|
+
if (rawValue == nullptr) return sourceProps.customMapStyle;
|
|
62
92
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
63
|
-
return CachedProp<
|
|
93
|
+
return CachedProp<std::optional<std::string>>::fromRawValue(*runtime, value, sourceProps.customMapStyle);
|
|
64
94
|
} catch (const std::exception& exc) {
|
|
65
|
-
throw std::runtime_error(std::string("RNGoogleMapsPlusView.
|
|
95
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.customMapStyle: ") + exc.what());
|
|
66
96
|
}
|
|
67
97
|
}()),
|
|
68
|
-
userInterfaceStyle([&]() -> CachedProp<RNUserInterfaceStyle
|
|
98
|
+
userInterfaceStyle([&]() -> CachedProp<std::optional<RNUserInterfaceStyle>> {
|
|
69
99
|
try {
|
|
70
100
|
const react::RawValue* rawValue = rawProps.at("userInterfaceStyle", nullptr, nullptr);
|
|
71
101
|
if (rawValue == nullptr) return sourceProps.userInterfaceStyle;
|
|
72
102
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
73
|
-
return CachedProp<RNUserInterfaceStyle
|
|
103
|
+
return CachedProp<std::optional<RNUserInterfaceStyle>>::fromRawValue(*runtime, value, sourceProps.userInterfaceStyle);
|
|
74
104
|
} catch (const std::exception& exc) {
|
|
75
105
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.userInterfaceStyle: ") + exc.what());
|
|
76
106
|
}
|
|
77
107
|
}()),
|
|
78
|
-
minZoomLevel([&]() -> CachedProp<double
|
|
108
|
+
minZoomLevel([&]() -> CachedProp<std::optional<double>> {
|
|
79
109
|
try {
|
|
80
110
|
const react::RawValue* rawValue = rawProps.at("minZoomLevel", nullptr, nullptr);
|
|
81
111
|
if (rawValue == nullptr) return sourceProps.minZoomLevel;
|
|
82
112
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
83
|
-
return CachedProp<double
|
|
113
|
+
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.minZoomLevel);
|
|
84
114
|
} catch (const std::exception& exc) {
|
|
85
115
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.minZoomLevel: ") + exc.what());
|
|
86
116
|
}
|
|
87
117
|
}()),
|
|
88
|
-
maxZoomLevel([&]() -> CachedProp<double
|
|
118
|
+
maxZoomLevel([&]() -> CachedProp<std::optional<double>> {
|
|
89
119
|
try {
|
|
90
120
|
const react::RawValue* rawValue = rawProps.at("maxZoomLevel", nullptr, nullptr);
|
|
91
121
|
if (rawValue == nullptr) return sourceProps.maxZoomLevel;
|
|
92
122
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
93
|
-
return CachedProp<double
|
|
123
|
+
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.maxZoomLevel);
|
|
94
124
|
} catch (const std::exception& exc) {
|
|
95
125
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.maxZoomLevel: ") + exc.what());
|
|
96
126
|
}
|
|
97
127
|
}()),
|
|
98
|
-
mapPadding([&]() -> CachedProp<RNMapPadding
|
|
128
|
+
mapPadding([&]() -> CachedProp<std::optional<RNMapPadding>> {
|
|
99
129
|
try {
|
|
100
130
|
const react::RawValue* rawValue = rawProps.at("mapPadding", nullptr, nullptr);
|
|
101
131
|
if (rawValue == nullptr) return sourceProps.mapPadding;
|
|
102
132
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
103
|
-
return CachedProp<RNMapPadding
|
|
133
|
+
return CachedProp<std::optional<RNMapPadding>>::fromRawValue(*runtime, value, sourceProps.mapPadding);
|
|
104
134
|
} catch (const std::exception& exc) {
|
|
105
135
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.mapPadding: ") + exc.what());
|
|
106
136
|
}
|
|
107
137
|
}()),
|
|
108
|
-
|
|
138
|
+
mapType([&]() -> CachedProp<std::optional<RNMapType>> {
|
|
139
|
+
try {
|
|
140
|
+
const react::RawValue* rawValue = rawProps.at("mapType", nullptr, nullptr);
|
|
141
|
+
if (rawValue == nullptr) return sourceProps.mapType;
|
|
142
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
143
|
+
return CachedProp<std::optional<RNMapType>>::fromRawValue(*runtime, value, sourceProps.mapType);
|
|
144
|
+
} catch (const std::exception& exc) {
|
|
145
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.mapType: ") + exc.what());
|
|
146
|
+
}
|
|
147
|
+
}()),
|
|
148
|
+
markers([&]() -> CachedProp<std::optional<std::vector<RNMarker>>> {
|
|
109
149
|
try {
|
|
110
150
|
const react::RawValue* rawValue = rawProps.at("markers", nullptr, nullptr);
|
|
111
151
|
if (rawValue == nullptr) return sourceProps.markers;
|
|
112
152
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
113
|
-
return CachedProp<std::vector<RNMarker
|
|
153
|
+
return CachedProp<std::optional<std::vector<RNMarker>>>::fromRawValue(*runtime, value, sourceProps.markers);
|
|
114
154
|
} catch (const std::exception& exc) {
|
|
115
155
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.markers: ") + exc.what());
|
|
116
156
|
}
|
|
117
157
|
}()),
|
|
118
|
-
polygons([&]() -> CachedProp<std::vector<RNPolygon
|
|
158
|
+
polygons([&]() -> CachedProp<std::optional<std::vector<RNPolygon>>> {
|
|
119
159
|
try {
|
|
120
160
|
const react::RawValue* rawValue = rawProps.at("polygons", nullptr, nullptr);
|
|
121
161
|
if (rawValue == nullptr) return sourceProps.polygons;
|
|
122
162
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
123
|
-
return CachedProp<std::vector<RNPolygon
|
|
163
|
+
return CachedProp<std::optional<std::vector<RNPolygon>>>::fromRawValue(*runtime, value, sourceProps.polygons);
|
|
124
164
|
} catch (const std::exception& exc) {
|
|
125
165
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.polygons: ") + exc.what());
|
|
126
166
|
}
|
|
127
167
|
}()),
|
|
128
|
-
polylines([&]() -> CachedProp<std::vector<RNPolyline
|
|
168
|
+
polylines([&]() -> CachedProp<std::optional<std::vector<RNPolyline>>> {
|
|
129
169
|
try {
|
|
130
170
|
const react::RawValue* rawValue = rawProps.at("polylines", nullptr, nullptr);
|
|
131
171
|
if (rawValue == nullptr) return sourceProps.polylines;
|
|
132
172
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
133
|
-
return CachedProp<std::vector<RNPolyline
|
|
173
|
+
return CachedProp<std::optional<std::vector<RNPolyline>>>::fromRawValue(*runtime, value, sourceProps.polylines);
|
|
134
174
|
} catch (const std::exception& exc) {
|
|
135
175
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.polylines: ") + exc.what());
|
|
136
176
|
}
|
|
137
177
|
}()),
|
|
178
|
+
circles([&]() -> CachedProp<std::optional<std::vector<RNCircle>>> {
|
|
179
|
+
try {
|
|
180
|
+
const react::RawValue* rawValue = rawProps.at("circles", nullptr, nullptr);
|
|
181
|
+
if (rawValue == nullptr) return sourceProps.circles;
|
|
182
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
183
|
+
return CachedProp<std::optional<std::vector<RNCircle>>>::fromRawValue(*runtime, value, sourceProps.circles);
|
|
184
|
+
} catch (const std::exception& exc) {
|
|
185
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.circles: ") + exc.what());
|
|
186
|
+
}
|
|
187
|
+
}()),
|
|
188
|
+
locationConfig([&]() -> CachedProp<std::optional<RNLocationConfig>> {
|
|
189
|
+
try {
|
|
190
|
+
const react::RawValue* rawValue = rawProps.at("locationConfig", nullptr, nullptr);
|
|
191
|
+
if (rawValue == nullptr) return sourceProps.locationConfig;
|
|
192
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
193
|
+
return CachedProp<std::optional<RNLocationConfig>>::fromRawValue(*runtime, value, sourceProps.locationConfig);
|
|
194
|
+
} catch (const std::exception& exc) {
|
|
195
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.locationConfig: ") + exc.what());
|
|
196
|
+
}
|
|
197
|
+
}()),
|
|
138
198
|
onMapError([&]() -> CachedProp<std::optional<std::function<void(RNMapErrorCode /* error */)>>> {
|
|
139
199
|
try {
|
|
140
200
|
const react::RawValue* rawValue = rawProps.at("onMapError", nullptr, nullptr);
|
|
@@ -195,6 +255,36 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
195
255
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMarkerPress: ") + exc.what());
|
|
196
256
|
}
|
|
197
257
|
}()),
|
|
258
|
+
onPolylinePress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
|
|
259
|
+
try {
|
|
260
|
+
const react::RawValue* rawValue = rawProps.at("onPolylinePress", nullptr, nullptr);
|
|
261
|
+
if (rawValue == nullptr) return sourceProps.onPolylinePress;
|
|
262
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
263
|
+
return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onPolylinePress);
|
|
264
|
+
} catch (const std::exception& exc) {
|
|
265
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onPolylinePress: ") + exc.what());
|
|
266
|
+
}
|
|
267
|
+
}()),
|
|
268
|
+
onPolygonPress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
|
|
269
|
+
try {
|
|
270
|
+
const react::RawValue* rawValue = rawProps.at("onPolygonPress", nullptr, nullptr);
|
|
271
|
+
if (rawValue == nullptr) return sourceProps.onPolygonPress;
|
|
272
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
273
|
+
return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onPolygonPress);
|
|
274
|
+
} catch (const std::exception& exc) {
|
|
275
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onPolygonPress: ") + exc.what());
|
|
276
|
+
}
|
|
277
|
+
}()),
|
|
278
|
+
onCirclePress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
|
|
279
|
+
try {
|
|
280
|
+
const react::RawValue* rawValue = rawProps.at("onCirclePress", nullptr, nullptr);
|
|
281
|
+
if (rawValue == nullptr) return sourceProps.onCirclePress;
|
|
282
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
283
|
+
return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCirclePress);
|
|
284
|
+
} catch (const std::exception& exc) {
|
|
285
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCirclePress: ") + exc.what());
|
|
286
|
+
}
|
|
287
|
+
}()),
|
|
198
288
|
onCameraChangeStart([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> {
|
|
199
289
|
try {
|
|
200
290
|
const react::RawValue* rawValue = rawProps.at("onCameraChangeStart", nullptr, nullptr);
|
|
@@ -238,23 +328,32 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
238
328
|
|
|
239
329
|
HybridRNGoogleMapsPlusViewProps::HybridRNGoogleMapsPlusViewProps(const HybridRNGoogleMapsPlusViewProps& other):
|
|
240
330
|
react::ViewProps(),
|
|
331
|
+
initialProps(other.initialProps),
|
|
332
|
+
uiSettings(other.uiSettings),
|
|
333
|
+
myLocationEnabled(other.myLocationEnabled),
|
|
241
334
|
buildingEnabled(other.buildingEnabled),
|
|
242
335
|
trafficEnabled(other.trafficEnabled),
|
|
336
|
+
indoorEnabled(other.indoorEnabled),
|
|
243
337
|
customMapStyle(other.customMapStyle),
|
|
244
|
-
initialCamera(other.initialCamera),
|
|
245
338
|
userInterfaceStyle(other.userInterfaceStyle),
|
|
246
339
|
minZoomLevel(other.minZoomLevel),
|
|
247
340
|
maxZoomLevel(other.maxZoomLevel),
|
|
248
341
|
mapPadding(other.mapPadding),
|
|
342
|
+
mapType(other.mapType),
|
|
249
343
|
markers(other.markers),
|
|
250
344
|
polygons(other.polygons),
|
|
251
345
|
polylines(other.polylines),
|
|
346
|
+
circles(other.circles),
|
|
347
|
+
locationConfig(other.locationConfig),
|
|
252
348
|
onMapError(other.onMapError),
|
|
253
349
|
onMapReady(other.onMapReady),
|
|
254
350
|
onLocationUpdate(other.onLocationUpdate),
|
|
255
351
|
onLocationError(other.onLocationError),
|
|
256
352
|
onMapPress(other.onMapPress),
|
|
257
353
|
onMarkerPress(other.onMarkerPress),
|
|
354
|
+
onPolylinePress(other.onPolylinePress),
|
|
355
|
+
onPolygonPress(other.onPolygonPress),
|
|
356
|
+
onCirclePress(other.onCirclePress),
|
|
258
357
|
onCameraChangeStart(other.onCameraChangeStart),
|
|
259
358
|
onCameraChange(other.onCameraChange),
|
|
260
359
|
onCameraChangeComplete(other.onCameraChangeComplete),
|
|
@@ -262,23 +361,32 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
262
361
|
|
|
263
362
|
bool HybridRNGoogleMapsPlusViewProps::filterObjectKeys(const std::string& propName) {
|
|
264
363
|
switch (hashString(propName)) {
|
|
364
|
+
case hashString("initialProps"): return true;
|
|
365
|
+
case hashString("uiSettings"): return true;
|
|
366
|
+
case hashString("myLocationEnabled"): return true;
|
|
265
367
|
case hashString("buildingEnabled"): return true;
|
|
266
368
|
case hashString("trafficEnabled"): return true;
|
|
369
|
+
case hashString("indoorEnabled"): return true;
|
|
267
370
|
case hashString("customMapStyle"): return true;
|
|
268
|
-
case hashString("initialCamera"): return true;
|
|
269
371
|
case hashString("userInterfaceStyle"): return true;
|
|
270
372
|
case hashString("minZoomLevel"): return true;
|
|
271
373
|
case hashString("maxZoomLevel"): return true;
|
|
272
374
|
case hashString("mapPadding"): return true;
|
|
375
|
+
case hashString("mapType"): return true;
|
|
273
376
|
case hashString("markers"): return true;
|
|
274
377
|
case hashString("polygons"): return true;
|
|
275
378
|
case hashString("polylines"): return true;
|
|
379
|
+
case hashString("circles"): return true;
|
|
380
|
+
case hashString("locationConfig"): return true;
|
|
276
381
|
case hashString("onMapError"): return true;
|
|
277
382
|
case hashString("onMapReady"): return true;
|
|
278
383
|
case hashString("onLocationUpdate"): return true;
|
|
279
384
|
case hashString("onLocationError"): return true;
|
|
280
385
|
case hashString("onMapPress"): return true;
|
|
281
386
|
case hashString("onMarkerPress"): return true;
|
|
387
|
+
case hashString("onPolylinePress"): return true;
|
|
388
|
+
case hashString("onPolygonPress"): return true;
|
|
389
|
+
case hashString("onCirclePress"): return true;
|
|
282
390
|
case hashString("onCameraChangeStart"): return true;
|
|
283
391
|
case hashString("onCameraChange"): return true;
|
|
284
392
|
case hashString("onCameraChangeComplete"): return true;
|