react-native-google-maps-plus 1.1.0-dev.2 → 1.1.0-dev.4
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 +7 -5
- package/RNGoogleMapsPlus.podspec +2 -1
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +91 -102
- package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +3 -3
- package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +16 -2
- package/android/src/main/java/com/rngooglemapsplus/MapHeatmapBuilder.kt +31 -0
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +25 -0
- package/android/src/main/java/com/rngooglemapsplus/MapPolygonBuilder.kt +18 -1
- package/android/src/main/java/com/rngooglemapsplus/MapPolylineBuilder.kt.kt +26 -9
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +61 -71
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNHeatmapPointExtension.kt +9 -0
- package/ios/GoogleMapViewImpl.swift +129 -213
- package/ios/LocationHandler.swift +2 -10
- package/ios/MapCircleBuilder.swift +23 -8
- package/ios/MapHeatmapBuilder.swift +27 -0
- package/ios/MapHelper.swift +6 -4
- package/ios/MapMarkerBuilder.swift +39 -41
- package/ios/MapPolygonBuilder.swift +25 -7
- package/ios/MapPolylineBuilder.swift +27 -11
- package/ios/RNGoogleMapsPlusView.swift +31 -14
- package/ios/extensions/RNCircle+Extension.swift +0 -13
- package/ios/extensions/RNHeatmap+Extension.swift +16 -0
- package/ios/extensions/RNPolygon+Extension.swift.swift +2 -19
- package/ios/extensions/RNPolyline+Extension.swift.swift +1 -26
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +3 -3
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +24 -1
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +48 -15
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +4 -4
- package/nitrogen/generated/android/c++/JRNCircle.hpp +4 -4
- package/nitrogen/generated/android/c++/JRNHeatmap.hpp +100 -0
- package/nitrogen/generated/android/c++/JRNHeatmapGradient.hpp +89 -0
- package/nitrogen/generated/android/c++/JRNHeatmapPoint.hpp +61 -0
- package/nitrogen/generated/android/c++/JRNMapZoomConfig.hpp +57 -0
- package/nitrogen/generated/android/c++/views/JHybridRNGoogleMapsPlusViewStateUpdater.cpp +6 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +7 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCircle.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNHeatmap.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNHeatmapGradient.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNHeatmapPoint.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapZoomConfig.kt +32 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +101 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +12 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +23 -11
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +9 -9
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +2 -2
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +39 -19
- package/nitrogen/generated/ios/swift/RNCircle.swift +5 -17
- package/nitrogen/generated/ios/swift/RNHeatmap.swift +180 -0
- package/nitrogen/generated/ios/swift/RNHeatmapGradient.swift +81 -0
- package/nitrogen/generated/ios/swift/RNHeatmapPoint.swift +57 -0
- package/nitrogen/generated/ios/swift/RNMapZoomConfig.swift +70 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +4 -4
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +10 -4
- package/nitrogen/generated/shared/c++/RNCircle.hpp +5 -5
- package/nitrogen/generated/shared/c++/RNHeatmap.hpp +98 -0
- package/nitrogen/generated/shared/c++/RNHeatmapGradient.hpp +76 -0
- package/nitrogen/generated/shared/c++/RNHeatmapPoint.hpp +75 -0
- package/nitrogen/generated/shared/c++/RNMapZoomConfig.hpp +71 -0
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +19 -19
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +4 -2
- package/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +2 -2
- package/package.json +12 -12
- package/src/RNGoogleMapsPlusView.nitro.ts +4 -2
- package/src/types.ts +28 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNHeatmapGradient.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RNHeatmapGradient`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNHeatmapGradient = margelo.nitro.rngooglemapsplus.RNHeatmapGradient
|
|
14
|
+
|
|
15
|
+
public extension RNHeatmapGradient {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNHeatmapGradient`.
|
|
20
|
+
*/
|
|
21
|
+
init(colors: [String], startPoints: [Double], colorMapSize: Double) {
|
|
22
|
+
self.init({ () -> bridge.std__vector_std__string_ in
|
|
23
|
+
var __vector = bridge.create_std__vector_std__string_(colors.count)
|
|
24
|
+
for __item in colors {
|
|
25
|
+
__vector.push_back(std.string(__item))
|
|
26
|
+
}
|
|
27
|
+
return __vector
|
|
28
|
+
}(), { () -> bridge.std__vector_double_ in
|
|
29
|
+
var __vector = bridge.create_std__vector_double_(startPoints.count)
|
|
30
|
+
for __item in startPoints {
|
|
31
|
+
__vector.push_back(__item)
|
|
32
|
+
}
|
|
33
|
+
return __vector
|
|
34
|
+
}(), colorMapSize)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var colors: [String] {
|
|
38
|
+
@inline(__always)
|
|
39
|
+
get {
|
|
40
|
+
return self.__colors.map({ __item in String(__item) })
|
|
41
|
+
}
|
|
42
|
+
@inline(__always)
|
|
43
|
+
set {
|
|
44
|
+
self.__colors = { () -> bridge.std__vector_std__string_ in
|
|
45
|
+
var __vector = bridge.create_std__vector_std__string_(newValue.count)
|
|
46
|
+
for __item in newValue {
|
|
47
|
+
__vector.push_back(std.string(__item))
|
|
48
|
+
}
|
|
49
|
+
return __vector
|
|
50
|
+
}()
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var startPoints: [Double] {
|
|
55
|
+
@inline(__always)
|
|
56
|
+
get {
|
|
57
|
+
return self.__startPoints.map({ __item in __item })
|
|
58
|
+
}
|
|
59
|
+
@inline(__always)
|
|
60
|
+
set {
|
|
61
|
+
self.__startPoints = { () -> bridge.std__vector_double_ in
|
|
62
|
+
var __vector = bridge.create_std__vector_double_(newValue.count)
|
|
63
|
+
for __item in newValue {
|
|
64
|
+
__vector.push_back(__item)
|
|
65
|
+
}
|
|
66
|
+
return __vector
|
|
67
|
+
}()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
var colorMapSize: Double {
|
|
72
|
+
@inline(__always)
|
|
73
|
+
get {
|
|
74
|
+
return self.__colorMapSize
|
|
75
|
+
}
|
|
76
|
+
@inline(__always)
|
|
77
|
+
set {
|
|
78
|
+
self.__colorMapSize = newValue
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNHeatmapPoint.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RNHeatmapPoint`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNHeatmapPoint = margelo.nitro.rngooglemapsplus.RNHeatmapPoint
|
|
14
|
+
|
|
15
|
+
public extension RNHeatmapPoint {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNHeatmapPoint`.
|
|
20
|
+
*/
|
|
21
|
+
init(latitude: Double, longitude: Double, weight: Double) {
|
|
22
|
+
self.init(latitude, longitude, weight)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var latitude: Double {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return self.__latitude
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__latitude = newValue
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var longitude: Double {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return self.__longitude
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__longitude = newValue
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var weight: Double {
|
|
48
|
+
@inline(__always)
|
|
49
|
+
get {
|
|
50
|
+
return self.__weight
|
|
51
|
+
}
|
|
52
|
+
@inline(__always)
|
|
53
|
+
set {
|
|
54
|
+
self.__weight = newValue
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNMapZoomConfig.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RNMapZoomConfig`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNMapZoomConfig = margelo.nitro.rngooglemapsplus.RNMapZoomConfig
|
|
14
|
+
|
|
15
|
+
public extension RNMapZoomConfig {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNMapZoomConfig`.
|
|
20
|
+
*/
|
|
21
|
+
init(min: Double?, max: Double?) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_double_ in
|
|
23
|
+
if let __unwrappedValue = min {
|
|
24
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
29
|
+
if let __unwrappedValue = max {
|
|
30
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}())
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var min: Double? {
|
|
38
|
+
@inline(__always)
|
|
39
|
+
get {
|
|
40
|
+
return self.__min.value
|
|
41
|
+
}
|
|
42
|
+
@inline(__always)
|
|
43
|
+
set {
|
|
44
|
+
self.__min = { () -> bridge.std__optional_double_ in
|
|
45
|
+
if let __unwrappedValue = newValue {
|
|
46
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
47
|
+
} else {
|
|
48
|
+
return .init()
|
|
49
|
+
}
|
|
50
|
+
}()
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var max: Double? {
|
|
55
|
+
@inline(__always)
|
|
56
|
+
get {
|
|
57
|
+
return self.__max.value
|
|
58
|
+
}
|
|
59
|
+
@inline(__always)
|
|
60
|
+
set {
|
|
61
|
+
self.__max = { () -> bridge.std__optional_double_ in
|
|
62
|
+
if let __unwrappedValue = newValue {
|
|
63
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
64
|
+
} else {
|
|
65
|
+
return .init()
|
|
66
|
+
}
|
|
67
|
+
}()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -30,10 +30,8 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
30
30
|
prototype.registerHybridSetter("customMapStyle", &HybridRNGoogleMapsPlusViewSpec::setCustomMapStyle);
|
|
31
31
|
prototype.registerHybridGetter("userInterfaceStyle", &HybridRNGoogleMapsPlusViewSpec::getUserInterfaceStyle);
|
|
32
32
|
prototype.registerHybridSetter("userInterfaceStyle", &HybridRNGoogleMapsPlusViewSpec::setUserInterfaceStyle);
|
|
33
|
-
prototype.registerHybridGetter("
|
|
34
|
-
prototype.registerHybridSetter("
|
|
35
|
-
prototype.registerHybridGetter("maxZoomLevel", &HybridRNGoogleMapsPlusViewSpec::getMaxZoomLevel);
|
|
36
|
-
prototype.registerHybridSetter("maxZoomLevel", &HybridRNGoogleMapsPlusViewSpec::setMaxZoomLevel);
|
|
33
|
+
prototype.registerHybridGetter("mapZoomConfig", &HybridRNGoogleMapsPlusViewSpec::getMapZoomConfig);
|
|
34
|
+
prototype.registerHybridSetter("mapZoomConfig", &HybridRNGoogleMapsPlusViewSpec::setMapZoomConfig);
|
|
37
35
|
prototype.registerHybridGetter("mapPadding", &HybridRNGoogleMapsPlusViewSpec::getMapPadding);
|
|
38
36
|
prototype.registerHybridSetter("mapPadding", &HybridRNGoogleMapsPlusViewSpec::setMapPadding);
|
|
39
37
|
prototype.registerHybridGetter("mapType", &HybridRNGoogleMapsPlusViewSpec::getMapType);
|
|
@@ -46,6 +44,8 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
46
44
|
prototype.registerHybridSetter("polylines", &HybridRNGoogleMapsPlusViewSpec::setPolylines);
|
|
47
45
|
prototype.registerHybridGetter("circles", &HybridRNGoogleMapsPlusViewSpec::getCircles);
|
|
48
46
|
prototype.registerHybridSetter("circles", &HybridRNGoogleMapsPlusViewSpec::setCircles);
|
|
47
|
+
prototype.registerHybridGetter("heatmaps", &HybridRNGoogleMapsPlusViewSpec::getHeatmaps);
|
|
48
|
+
prototype.registerHybridSetter("heatmaps", &HybridRNGoogleMapsPlusViewSpec::setHeatmaps);
|
|
49
49
|
prototype.registerHybridGetter("locationConfig", &HybridRNGoogleMapsPlusViewSpec::getLocationConfig);
|
|
50
50
|
prototype.registerHybridSetter("locationConfig", &HybridRNGoogleMapsPlusViewSpec::setLocationConfig);
|
|
51
51
|
prototype.registerHybridGetter("onMapError", &HybridRNGoogleMapsPlusViewSpec::getOnMapError);
|
|
@@ -19,6 +19,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNInitialProps; }
|
|
|
19
19
|
namespace margelo::nitro::rngooglemapsplus { struct RNMapUiSettings; }
|
|
20
20
|
// Forward declaration of `RNUserInterfaceStyle` to properly resolve imports.
|
|
21
21
|
namespace margelo::nitro::rngooglemapsplus { enum class RNUserInterfaceStyle; }
|
|
22
|
+
// Forward declaration of `RNMapZoomConfig` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNMapZoomConfig; }
|
|
22
24
|
// Forward declaration of `RNMapPadding` to properly resolve imports.
|
|
23
25
|
namespace margelo::nitro::rngooglemapsplus { struct RNMapPadding; }
|
|
24
26
|
// Forward declaration of `RNMapType` to properly resolve imports.
|
|
@@ -31,6 +33,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNPolygon; }
|
|
|
31
33
|
namespace margelo::nitro::rngooglemapsplus { struct RNPolyline; }
|
|
32
34
|
// Forward declaration of `RNCircle` to properly resolve imports.
|
|
33
35
|
namespace margelo::nitro::rngooglemapsplus { struct RNCircle; }
|
|
36
|
+
// Forward declaration of `RNHeatmap` to properly resolve imports.
|
|
37
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNHeatmap; }
|
|
34
38
|
// Forward declaration of `RNLocationConfig` to properly resolve imports.
|
|
35
39
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocationConfig; }
|
|
36
40
|
// Forward declaration of `RNMapErrorCode` to properly resolve imports.
|
|
@@ -53,6 +57,7 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult;
|
|
|
53
57
|
#include "RNMapUiSettings.hpp"
|
|
54
58
|
#include <string>
|
|
55
59
|
#include "RNUserInterfaceStyle.hpp"
|
|
60
|
+
#include "RNMapZoomConfig.hpp"
|
|
56
61
|
#include "RNMapPadding.hpp"
|
|
57
62
|
#include "RNMapType.hpp"
|
|
58
63
|
#include "RNMarker.hpp"
|
|
@@ -60,6 +65,7 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult;
|
|
|
60
65
|
#include "RNPolygon.hpp"
|
|
61
66
|
#include "RNPolyline.hpp"
|
|
62
67
|
#include "RNCircle.hpp"
|
|
68
|
+
#include "RNHeatmap.hpp"
|
|
63
69
|
#include "RNLocationConfig.hpp"
|
|
64
70
|
#include "RNMapErrorCode.hpp"
|
|
65
71
|
#include <functional>
|
|
@@ -114,10 +120,8 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
114
120
|
virtual void setCustomMapStyle(const std::optional<std::string>& customMapStyle) = 0;
|
|
115
121
|
virtual std::optional<RNUserInterfaceStyle> getUserInterfaceStyle() = 0;
|
|
116
122
|
virtual void setUserInterfaceStyle(std::optional<RNUserInterfaceStyle> userInterfaceStyle) = 0;
|
|
117
|
-
virtual std::optional<
|
|
118
|
-
virtual void
|
|
119
|
-
virtual std::optional<double> getMaxZoomLevel() = 0;
|
|
120
|
-
virtual void setMaxZoomLevel(std::optional<double> maxZoomLevel) = 0;
|
|
123
|
+
virtual std::optional<RNMapZoomConfig> getMapZoomConfig() = 0;
|
|
124
|
+
virtual void setMapZoomConfig(const std::optional<RNMapZoomConfig>& mapZoomConfig) = 0;
|
|
121
125
|
virtual std::optional<RNMapPadding> getMapPadding() = 0;
|
|
122
126
|
virtual void setMapPadding(const std::optional<RNMapPadding>& mapPadding) = 0;
|
|
123
127
|
virtual std::optional<RNMapType> getMapType() = 0;
|
|
@@ -130,6 +134,8 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
130
134
|
virtual void setPolylines(const std::optional<std::vector<RNPolyline>>& polylines) = 0;
|
|
131
135
|
virtual std::optional<std::vector<RNCircle>> getCircles() = 0;
|
|
132
136
|
virtual void setCircles(const std::optional<std::vector<RNCircle>>& circles) = 0;
|
|
137
|
+
virtual std::optional<std::vector<RNHeatmap>> getHeatmaps() = 0;
|
|
138
|
+
virtual void setHeatmaps(const std::optional<std::vector<RNHeatmap>>& heatmaps) = 0;
|
|
133
139
|
virtual std::optional<RNLocationConfig> getLocationConfig() = 0;
|
|
134
140
|
virtual void setLocationConfig(const std::optional<RNLocationConfig>& locationConfig) = 0;
|
|
135
141
|
virtual std::optional<std::function<void(RNMapErrorCode /* error */)>> getOnMapError() = 0;
|
|
@@ -36,14 +36,14 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
36
36
|
std::optional<bool> pressable SWIFT_PRIVATE;
|
|
37
37
|
std::optional<double> zIndex SWIFT_PRIVATE;
|
|
38
38
|
RNLatLng center SWIFT_PRIVATE;
|
|
39
|
-
|
|
39
|
+
double radius SWIFT_PRIVATE;
|
|
40
40
|
std::optional<double> strokeWidth SWIFT_PRIVATE;
|
|
41
41
|
std::optional<std::string> strokeColor SWIFT_PRIVATE;
|
|
42
42
|
std::optional<std::string> fillColor SWIFT_PRIVATE;
|
|
43
43
|
|
|
44
44
|
public:
|
|
45
45
|
RNCircle() = default;
|
|
46
|
-
explicit RNCircle(std::string id, std::optional<bool> pressable, std::optional<double> zIndex, RNLatLng center,
|
|
46
|
+
explicit RNCircle(std::string id, std::optional<bool> pressable, std::optional<double> zIndex, RNLatLng center, 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
47
|
};
|
|
48
48
|
|
|
49
49
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -60,7 +60,7 @@ namespace margelo::nitro {
|
|
|
60
60
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "pressable")),
|
|
61
61
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
62
62
|
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "center")),
|
|
63
|
-
JSIConverter<
|
|
63
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "radius")),
|
|
64
64
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "strokeWidth")),
|
|
65
65
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "strokeColor")),
|
|
66
66
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "fillColor"))
|
|
@@ -72,7 +72,7 @@ namespace margelo::nitro {
|
|
|
72
72
|
obj.setProperty(runtime, "pressable", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.pressable));
|
|
73
73
|
obj.setProperty(runtime, "zIndex", JSIConverter<std::optional<double>>::toJSI(runtime, arg.zIndex));
|
|
74
74
|
obj.setProperty(runtime, "center", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.center));
|
|
75
|
-
obj.setProperty(runtime, "radius", JSIConverter<
|
|
75
|
+
obj.setProperty(runtime, "radius", JSIConverter<double>::toJSI(runtime, arg.radius));
|
|
76
76
|
obj.setProperty(runtime, "strokeWidth", JSIConverter<std::optional<double>>::toJSI(runtime, arg.strokeWidth));
|
|
77
77
|
obj.setProperty(runtime, "strokeColor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.strokeColor));
|
|
78
78
|
obj.setProperty(runtime, "fillColor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.fillColor));
|
|
@@ -87,7 +87,7 @@ namespace margelo::nitro {
|
|
|
87
87
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "pressable"))) return false;
|
|
88
88
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
89
89
|
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "center"))) return false;
|
|
90
|
-
if (!JSIConverter<
|
|
90
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "radius"))) return false;
|
|
91
91
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "strokeWidth"))) return false;
|
|
92
92
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "strokeColor"))) return false;
|
|
93
93
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "fillColor"))) return false;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNHeatmap.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 `RNHeatmapPoint` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNHeatmapPoint; }
|
|
23
|
+
// Forward declaration of `RNHeatmapGradient` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNHeatmapGradient; }
|
|
25
|
+
|
|
26
|
+
#include <string>
|
|
27
|
+
#include <optional>
|
|
28
|
+
#include "RNHeatmapPoint.hpp"
|
|
29
|
+
#include <vector>
|
|
30
|
+
#include "RNHeatmapGradient.hpp"
|
|
31
|
+
|
|
32
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A struct which can be represented as a JavaScript object (RNHeatmap).
|
|
36
|
+
*/
|
|
37
|
+
struct RNHeatmap {
|
|
38
|
+
public:
|
|
39
|
+
std::string id SWIFT_PRIVATE;
|
|
40
|
+
std::optional<bool> pressable SWIFT_PRIVATE;
|
|
41
|
+
std::optional<double> zIndex SWIFT_PRIVATE;
|
|
42
|
+
std::vector<RNHeatmapPoint> weightedData SWIFT_PRIVATE;
|
|
43
|
+
std::optional<double> radius SWIFT_PRIVATE;
|
|
44
|
+
std::optional<double> opacity SWIFT_PRIVATE;
|
|
45
|
+
std::optional<RNHeatmapGradient> gradient SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
RNHeatmap() = default;
|
|
49
|
+
explicit RNHeatmap(std::string id, std::optional<bool> pressable, std::optional<double> zIndex, std::vector<RNHeatmapPoint> weightedData, std::optional<double> radius, std::optional<double> opacity, std::optional<RNHeatmapGradient> gradient): id(id), pressable(pressable), zIndex(zIndex), weightedData(weightedData), radius(radius), opacity(opacity), gradient(gradient) {}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
53
|
+
|
|
54
|
+
namespace margelo::nitro {
|
|
55
|
+
|
|
56
|
+
// C++ RNHeatmap <> JS RNHeatmap (object)
|
|
57
|
+
template <>
|
|
58
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNHeatmap> final {
|
|
59
|
+
static inline margelo::nitro::rngooglemapsplus::RNHeatmap fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
60
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
61
|
+
return margelo::nitro::rngooglemapsplus::RNHeatmap(
|
|
62
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
63
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "pressable")),
|
|
64
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
65
|
+
JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNHeatmapPoint>>::fromJSI(runtime, obj.getProperty(runtime, "weightedData")),
|
|
66
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "radius")),
|
|
67
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "opacity")),
|
|
68
|
+
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNHeatmapGradient>>::fromJSI(runtime, obj.getProperty(runtime, "gradient"))
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNHeatmap& arg) {
|
|
72
|
+
jsi::Object obj(runtime);
|
|
73
|
+
obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
74
|
+
obj.setProperty(runtime, "pressable", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.pressable));
|
|
75
|
+
obj.setProperty(runtime, "zIndex", JSIConverter<std::optional<double>>::toJSI(runtime, arg.zIndex));
|
|
76
|
+
obj.setProperty(runtime, "weightedData", JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNHeatmapPoint>>::toJSI(runtime, arg.weightedData));
|
|
77
|
+
obj.setProperty(runtime, "radius", JSIConverter<std::optional<double>>::toJSI(runtime, arg.radius));
|
|
78
|
+
obj.setProperty(runtime, "opacity", JSIConverter<std::optional<double>>::toJSI(runtime, arg.opacity));
|
|
79
|
+
obj.setProperty(runtime, "gradient", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNHeatmapGradient>>::toJSI(runtime, arg.gradient));
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
83
|
+
if (!value.isObject()) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
jsi::Object obj = value.getObject(runtime);
|
|
87
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
88
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "pressable"))) return false;
|
|
89
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
90
|
+
if (!JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNHeatmapPoint>>::canConvert(runtime, obj.getProperty(runtime, "weightedData"))) return false;
|
|
91
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "radius"))) return false;
|
|
92
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "opacity"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNHeatmapGradient>>::canConvert(runtime, obj.getProperty(runtime, "gradient"))) return false;
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNHeatmapGradient.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 <string>
|
|
24
|
+
#include <vector>
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A struct which can be represented as a JavaScript object (RNHeatmapGradient).
|
|
30
|
+
*/
|
|
31
|
+
struct RNHeatmapGradient {
|
|
32
|
+
public:
|
|
33
|
+
std::vector<std::string> colors SWIFT_PRIVATE;
|
|
34
|
+
std::vector<double> startPoints SWIFT_PRIVATE;
|
|
35
|
+
double colorMapSize SWIFT_PRIVATE;
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
RNHeatmapGradient() = default;
|
|
39
|
+
explicit RNHeatmapGradient(std::vector<std::string> colors, std::vector<double> startPoints, double colorMapSize): colors(colors), startPoints(startPoints), colorMapSize(colorMapSize) {}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
43
|
+
|
|
44
|
+
namespace margelo::nitro {
|
|
45
|
+
|
|
46
|
+
// C++ RNHeatmapGradient <> JS RNHeatmapGradient (object)
|
|
47
|
+
template <>
|
|
48
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNHeatmapGradient> final {
|
|
49
|
+
static inline margelo::nitro::rngooglemapsplus::RNHeatmapGradient fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
50
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
51
|
+
return margelo::nitro::rngooglemapsplus::RNHeatmapGradient(
|
|
52
|
+
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "colors")),
|
|
53
|
+
JSIConverter<std::vector<double>>::fromJSI(runtime, obj.getProperty(runtime, "startPoints")),
|
|
54
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "colorMapSize"))
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNHeatmapGradient& arg) {
|
|
58
|
+
jsi::Object obj(runtime);
|
|
59
|
+
obj.setProperty(runtime, "colors", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.colors));
|
|
60
|
+
obj.setProperty(runtime, "startPoints", JSIConverter<std::vector<double>>::toJSI(runtime, arg.startPoints));
|
|
61
|
+
obj.setProperty(runtime, "colorMapSize", JSIConverter<double>::toJSI(runtime, arg.colorMapSize));
|
|
62
|
+
return obj;
|
|
63
|
+
}
|
|
64
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
65
|
+
if (!value.isObject()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
jsi::Object obj = value.getObject(runtime);
|
|
69
|
+
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "colors"))) return false;
|
|
70
|
+
if (!JSIConverter<std::vector<double>>::canConvert(runtime, obj.getProperty(runtime, "startPoints"))) return false;
|
|
71
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "colorMapSize"))) return false;
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNHeatmapPoint.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
|
+
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (RNHeatmapPoint).
|
|
29
|
+
*/
|
|
30
|
+
struct RNHeatmapPoint {
|
|
31
|
+
public:
|
|
32
|
+
double latitude SWIFT_PRIVATE;
|
|
33
|
+
double longitude SWIFT_PRIVATE;
|
|
34
|
+
double weight SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
RNHeatmapPoint() = default;
|
|
38
|
+
explicit RNHeatmapPoint(double latitude, double longitude, double weight): latitude(latitude), longitude(longitude), weight(weight) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
// C++ RNHeatmapPoint <> JS RNHeatmapPoint (object)
|
|
46
|
+
template <>
|
|
47
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNHeatmapPoint> final {
|
|
48
|
+
static inline margelo::nitro::rngooglemapsplus::RNHeatmapPoint fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
49
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
50
|
+
return margelo::nitro::rngooglemapsplus::RNHeatmapPoint(
|
|
51
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "latitude")),
|
|
52
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "longitude")),
|
|
53
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "weight"))
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNHeatmapPoint& arg) {
|
|
57
|
+
jsi::Object obj(runtime);
|
|
58
|
+
obj.setProperty(runtime, "latitude", JSIConverter<double>::toJSI(runtime, arg.latitude));
|
|
59
|
+
obj.setProperty(runtime, "longitude", JSIConverter<double>::toJSI(runtime, arg.longitude));
|
|
60
|
+
obj.setProperty(runtime, "weight", JSIConverter<double>::toJSI(runtime, arg.weight));
|
|
61
|
+
return obj;
|
|
62
|
+
}
|
|
63
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
64
|
+
if (!value.isObject()) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
jsi::Object obj = value.getObject(runtime);
|
|
68
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "latitude"))) return false;
|
|
69
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "longitude"))) return false;
|
|
70
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "weight"))) return false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNMapZoomConfig.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 (RNMapZoomConfig).
|
|
29
|
+
*/
|
|
30
|
+
struct RNMapZoomConfig {
|
|
31
|
+
public:
|
|
32
|
+
std::optional<double> min SWIFT_PRIVATE;
|
|
33
|
+
std::optional<double> max SWIFT_PRIVATE;
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
RNMapZoomConfig() = default;
|
|
37
|
+
explicit RNMapZoomConfig(std::optional<double> min, std::optional<double> max): min(min), max(max) {}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
41
|
+
|
|
42
|
+
namespace margelo::nitro {
|
|
43
|
+
|
|
44
|
+
// C++ RNMapZoomConfig <> JS RNMapZoomConfig (object)
|
|
45
|
+
template <>
|
|
46
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNMapZoomConfig> final {
|
|
47
|
+
static inline margelo::nitro::rngooglemapsplus::RNMapZoomConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
48
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
49
|
+
return margelo::nitro::rngooglemapsplus::RNMapZoomConfig(
|
|
50
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "min")),
|
|
51
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "max"))
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNMapZoomConfig& arg) {
|
|
55
|
+
jsi::Object obj(runtime);
|
|
56
|
+
obj.setProperty(runtime, "min", JSIConverter<std::optional<double>>::toJSI(runtime, arg.min));
|
|
57
|
+
obj.setProperty(runtime, "max", JSIConverter<std::optional<double>>::toJSI(runtime, arg.max));
|
|
58
|
+
return obj;
|
|
59
|
+
}
|
|
60
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
61
|
+
if (!value.isObject()) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
jsi::Object obj = value.getObject(runtime);
|
|
65
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "min"))) return false;
|
|
66
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "max"))) return false;
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
} // namespace margelo::nitro
|