react-native-google-maps-plus 1.3.0-dev.4 → 1.3.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +15 -23
- package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +4 -3
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +10 -6
- package/android/src/main/java/com/rngooglemapsplus/MapPolygonBuilder.kt +18 -10
- package/android/src/main/java/com/rngooglemapsplus/MapPolylineBuilder.kt.kt +6 -4
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +8 -5
- package/android/src/main/java/com/rngooglemapsplus/extensions/LatLngExtension.kt +6 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNCameraExtension.kt +1 -2
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNLatLngExtension.kt +6 -0
- package/ios/GoogleMapViewImpl.swift +18 -49
- package/ios/MapCircleBuilder.swift +2 -10
- package/ios/MapMarkerBuilder.swift +11 -9
- package/ios/MapPolygonBuilder.swift +17 -2
- package/ios/MapPolylineBuilder.swift +4 -2
- package/ios/RNGoogleMapsPlusView.swift +7 -5
- package/ios/extensions/CLLocationCoordinate2D+Extension.swift +7 -0
- package/ios/extensions/RNLatLng+Extension.swift +7 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/types.d.ts +8 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +4 -0
- package/nitrogen/generated/android/c++/JRNMarker.hpp +8 -0
- package/nitrogen/generated/android/c++/JRNPolygon.hpp +29 -2
- package/nitrogen/generated/android/c++/JRNPolygonHole.hpp +72 -0
- package/nitrogen/generated/android/c++/JRNPolyline.hpp +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +6 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygon.kt +7 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygonHole.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolyline.kt +3 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +29 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/swift/RNMarker.swift +54 -1
- package/nitrogen/generated/ios/swift/RNPolygon.swift +66 -1
- package/nitrogen/generated/ios/swift/RNPolygonHole.swift +47 -0
- package/nitrogen/generated/ios/swift/RNPolyline.swift +24 -1
- package/nitrogen/generated/shared/c++/RNMarker.hpp +9 -1
- package/nitrogen/generated/shared/c++/RNPolygon.hpp +13 -2
- package/nitrogen/generated/shared/c++/RNPolygonHole.hpp +69 -0
- package/nitrogen/generated/shared/c++/RNPolyline.hpp +5 -1
- package/package.json +1 -1
- package/src/types.ts +9 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNPolygonHole.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 `RNPolygonHole`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNPolygonHole = margelo.nitro.rngooglemapsplus.RNPolygonHole
|
|
14
|
+
|
|
15
|
+
public extension RNPolygonHole {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNPolygonHole`.
|
|
20
|
+
*/
|
|
21
|
+
init(coordinates: [RNLatLng]) {
|
|
22
|
+
self.init({ () -> bridge.std__vector_RNLatLng_ in
|
|
23
|
+
var __vector = bridge.create_std__vector_RNLatLng_(coordinates.count)
|
|
24
|
+
for __item in coordinates {
|
|
25
|
+
__vector.push_back(__item)
|
|
26
|
+
}
|
|
27
|
+
return __vector
|
|
28
|
+
}())
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var coordinates: [RNLatLng] {
|
|
32
|
+
@inline(__always)
|
|
33
|
+
get {
|
|
34
|
+
return self.__coordinates.map({ __item in __item })
|
|
35
|
+
}
|
|
36
|
+
@inline(__always)
|
|
37
|
+
set {
|
|
38
|
+
self.__coordinates = { () -> bridge.std__vector_RNLatLng_ in
|
|
39
|
+
var __vector = bridge.create_std__vector_RNLatLng_(newValue.count)
|
|
40
|
+
for __item in newValue {
|
|
41
|
+
__vector.push_back(__item)
|
|
42
|
+
}
|
|
43
|
+
return __vector
|
|
44
|
+
}()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -18,7 +18,7 @@ public extension RNPolyline {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `RNPolyline`.
|
|
20
20
|
*/
|
|
21
|
-
init(id: String, zIndex: Double?, pressable: Bool?, coordinates: [RNLatLng], lineCap: RNLineCapType?, lineJoin: RNLineJoinType?, color: String?, width: Double?) {
|
|
21
|
+
init(id: String, zIndex: Double?, pressable: Bool?, coordinates: [RNLatLng], lineCap: RNLineCapType?, lineJoin: RNLineJoinType?, geodesic: Bool?, color: String?, width: Double?) {
|
|
22
22
|
self.init(std.string(id), { () -> bridge.std__optional_double_ in
|
|
23
23
|
if let __unwrappedValue = zIndex {
|
|
24
24
|
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
@@ -49,6 +49,12 @@ public extension RNPolyline {
|
|
|
49
49
|
} else {
|
|
50
50
|
return .init()
|
|
51
51
|
}
|
|
52
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
53
|
+
if let __unwrappedValue = geodesic {
|
|
54
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
52
58
|
}(), { () -> bridge.std__optional_std__string_ in
|
|
53
59
|
if let __unwrappedValue = color {
|
|
54
60
|
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
@@ -160,6 +166,23 @@ public extension RNPolyline {
|
|
|
160
166
|
}
|
|
161
167
|
}
|
|
162
168
|
|
|
169
|
+
var geodesic: Bool? {
|
|
170
|
+
@inline(__always)
|
|
171
|
+
get {
|
|
172
|
+
return self.__geodesic.value
|
|
173
|
+
}
|
|
174
|
+
@inline(__always)
|
|
175
|
+
set {
|
|
176
|
+
self.__geodesic = { () -> bridge.std__optional_bool_ in
|
|
177
|
+
if let __unwrappedValue = newValue {
|
|
178
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
179
|
+
} else {
|
|
180
|
+
return .init()
|
|
181
|
+
}
|
|
182
|
+
}()
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
163
186
|
var color: String? {
|
|
164
187
|
@inline(__always)
|
|
165
188
|
get {
|
|
@@ -48,11 +48,13 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
48
48
|
std::optional<double> opacity SWIFT_PRIVATE;
|
|
49
49
|
std::optional<bool> flat SWIFT_PRIVATE;
|
|
50
50
|
std::optional<bool> draggable SWIFT_PRIVATE;
|
|
51
|
+
std::optional<double> rotation SWIFT_PRIVATE;
|
|
52
|
+
std::optional<RNPosition> infoWindowAnchor SWIFT_PRIVATE;
|
|
51
53
|
std::optional<RNMarkerSvg> iconSvg SWIFT_PRIVATE;
|
|
52
54
|
|
|
53
55
|
public:
|
|
54
56
|
RNMarker() = default;
|
|
55
|
-
explicit RNMarker(std::string id, std::optional<double> zIndex, RNLatLng coordinate, std::optional<RNPosition> anchor, std::optional<bool> showInfoWindow, std::optional<std::string> title, std::optional<std::string> snippet, std::optional<double> opacity, std::optional<bool> flat, std::optional<bool> draggable, std::optional<RNMarkerSvg> iconSvg): id(id), zIndex(zIndex), coordinate(coordinate), anchor(anchor), showInfoWindow(showInfoWindow), title(title), snippet(snippet), opacity(opacity), flat(flat), draggable(draggable), iconSvg(iconSvg) {}
|
|
57
|
+
explicit RNMarker(std::string id, std::optional<double> zIndex, RNLatLng coordinate, std::optional<RNPosition> anchor, std::optional<bool> showInfoWindow, std::optional<std::string> title, std::optional<std::string> snippet, std::optional<double> opacity, std::optional<bool> flat, std::optional<bool> draggable, std::optional<double> rotation, std::optional<RNPosition> infoWindowAnchor, std::optional<RNMarkerSvg> iconSvg): id(id), zIndex(zIndex), coordinate(coordinate), anchor(anchor), showInfoWindow(showInfoWindow), title(title), snippet(snippet), opacity(opacity), flat(flat), draggable(draggable), rotation(rotation), infoWindowAnchor(infoWindowAnchor), iconSvg(iconSvg) {}
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -75,6 +77,8 @@ namespace margelo::nitro {
|
|
|
75
77
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "opacity")),
|
|
76
78
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "flat")),
|
|
77
79
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "draggable")),
|
|
80
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "rotation")),
|
|
81
|
+
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::fromJSI(runtime, obj.getProperty(runtime, "infoWindowAnchor")),
|
|
78
82
|
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::fromJSI(runtime, obj.getProperty(runtime, "iconSvg"))
|
|
79
83
|
);
|
|
80
84
|
}
|
|
@@ -90,6 +94,8 @@ namespace margelo::nitro {
|
|
|
90
94
|
obj.setProperty(runtime, "opacity", JSIConverter<std::optional<double>>::toJSI(runtime, arg.opacity));
|
|
91
95
|
obj.setProperty(runtime, "flat", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.flat));
|
|
92
96
|
obj.setProperty(runtime, "draggable", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.draggable));
|
|
97
|
+
obj.setProperty(runtime, "rotation", JSIConverter<std::optional<double>>::toJSI(runtime, arg.rotation));
|
|
98
|
+
obj.setProperty(runtime, "infoWindowAnchor", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::toJSI(runtime, arg.infoWindowAnchor));
|
|
93
99
|
obj.setProperty(runtime, "iconSvg", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::toJSI(runtime, arg.iconSvg));
|
|
94
100
|
return obj;
|
|
95
101
|
}
|
|
@@ -108,6 +114,8 @@ namespace margelo::nitro {
|
|
|
108
114
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "opacity"))) return false;
|
|
109
115
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "flat"))) return false;
|
|
110
116
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "draggable"))) return false;
|
|
117
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "rotation"))) return false;
|
|
118
|
+
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::canConvert(runtime, obj.getProperty(runtime, "infoWindowAnchor"))) return false;
|
|
111
119
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::canConvert(runtime, obj.getProperty(runtime, "iconSvg"))) return false;
|
|
112
120
|
return true;
|
|
113
121
|
}
|
|
@@ -20,11 +20,14 @@
|
|
|
20
20
|
|
|
21
21
|
// Forward declaration of `RNLatLng` to properly resolve imports.
|
|
22
22
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
23
|
+
// Forward declaration of `RNPolygonHole` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNPolygonHole; }
|
|
23
25
|
|
|
24
26
|
#include <string>
|
|
25
27
|
#include <optional>
|
|
26
28
|
#include "RNLatLng.hpp"
|
|
27
29
|
#include <vector>
|
|
30
|
+
#include "RNPolygonHole.hpp"
|
|
28
31
|
|
|
29
32
|
namespace margelo::nitro::rngooglemapsplus {
|
|
30
33
|
|
|
@@ -40,10 +43,12 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
40
43
|
std::optional<std::string> fillColor SWIFT_PRIVATE;
|
|
41
44
|
std::optional<std::string> strokeColor SWIFT_PRIVATE;
|
|
42
45
|
std::optional<double> strokeWidth SWIFT_PRIVATE;
|
|
46
|
+
std::optional<std::vector<RNPolygonHole>> holes SWIFT_PRIVATE;
|
|
47
|
+
std::optional<bool> geodesic SWIFT_PRIVATE;
|
|
43
48
|
|
|
44
49
|
public:
|
|
45
50
|
RNPolygon() = default;
|
|
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) {}
|
|
51
|
+
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, std::optional<std::vector<RNPolygonHole>> holes, std::optional<bool> geodesic): id(id), zIndex(zIndex), pressable(pressable), coordinates(coordinates), fillColor(fillColor), strokeColor(strokeColor), strokeWidth(strokeWidth), holes(holes), geodesic(geodesic) {}
|
|
47
52
|
};
|
|
48
53
|
|
|
49
54
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -62,7 +67,9 @@ namespace margelo::nitro {
|
|
|
62
67
|
JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::fromJSI(runtime, obj.getProperty(runtime, "coordinates")),
|
|
63
68
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "fillColor")),
|
|
64
69
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "strokeColor")),
|
|
65
|
-
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "strokeWidth"))
|
|
70
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "strokeWidth")),
|
|
71
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::rngooglemapsplus::RNPolygonHole>>>::fromJSI(runtime, obj.getProperty(runtime, "holes")),
|
|
72
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "geodesic"))
|
|
66
73
|
);
|
|
67
74
|
}
|
|
68
75
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNPolygon& arg) {
|
|
@@ -74,6 +81,8 @@ namespace margelo::nitro {
|
|
|
74
81
|
obj.setProperty(runtime, "fillColor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.fillColor));
|
|
75
82
|
obj.setProperty(runtime, "strokeColor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.strokeColor));
|
|
76
83
|
obj.setProperty(runtime, "strokeWidth", JSIConverter<std::optional<double>>::toJSI(runtime, arg.strokeWidth));
|
|
84
|
+
obj.setProperty(runtime, "holes", JSIConverter<std::optional<std::vector<margelo::nitro::rngooglemapsplus::RNPolygonHole>>>::toJSI(runtime, arg.holes));
|
|
85
|
+
obj.setProperty(runtime, "geodesic", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.geodesic));
|
|
77
86
|
return obj;
|
|
78
87
|
}
|
|
79
88
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -88,6 +97,8 @@ namespace margelo::nitro {
|
|
|
88
97
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "fillColor"))) return false;
|
|
89
98
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "strokeColor"))) return false;
|
|
90
99
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "strokeWidth"))) return false;
|
|
100
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::rngooglemapsplus::RNPolygonHole>>>::canConvert(runtime, obj.getProperty(runtime, "holes"))) return false;
|
|
101
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "geodesic"))) return false;
|
|
91
102
|
return true;
|
|
92
103
|
}
|
|
93
104
|
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNPolygonHole.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 "RNLatLng.hpp"
|
|
25
|
+
#include <vector>
|
|
26
|
+
|
|
27
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A struct which can be represented as a JavaScript object (RNPolygonHole).
|
|
31
|
+
*/
|
|
32
|
+
struct RNPolygonHole {
|
|
33
|
+
public:
|
|
34
|
+
std::vector<RNLatLng> coordinates SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
RNPolygonHole() = default;
|
|
38
|
+
explicit RNPolygonHole(std::vector<RNLatLng> coordinates): coordinates(coordinates) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
// C++ RNPolygonHole <> JS RNPolygonHole (object)
|
|
46
|
+
template <>
|
|
47
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNPolygonHole> final {
|
|
48
|
+
static inline margelo::nitro::rngooglemapsplus::RNPolygonHole fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
49
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
50
|
+
return margelo::nitro::rngooglemapsplus::RNPolygonHole(
|
|
51
|
+
JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::fromJSI(runtime, obj.getProperty(runtime, "coordinates"))
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNPolygonHole& arg) {
|
|
55
|
+
jsi::Object obj(runtime);
|
|
56
|
+
obj.setProperty(runtime, "coordinates", JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::toJSI(runtime, arg.coordinates));
|
|
57
|
+
return obj;
|
|
58
|
+
}
|
|
59
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
60
|
+
if (!value.isObject()) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
jsi::Object obj = value.getObject(runtime);
|
|
64
|
+
if (!JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::canConvert(runtime, obj.getProperty(runtime, "coordinates"))) return false;
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
} // namespace margelo::nitro
|
|
@@ -45,12 +45,13 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
45
45
|
std::vector<RNLatLng> coordinates SWIFT_PRIVATE;
|
|
46
46
|
std::optional<RNLineCapType> lineCap SWIFT_PRIVATE;
|
|
47
47
|
std::optional<RNLineJoinType> lineJoin SWIFT_PRIVATE;
|
|
48
|
+
std::optional<bool> geodesic SWIFT_PRIVATE;
|
|
48
49
|
std::optional<std::string> color SWIFT_PRIVATE;
|
|
49
50
|
std::optional<double> width SWIFT_PRIVATE;
|
|
50
51
|
|
|
51
52
|
public:
|
|
52
53
|
RNPolyline() = default;
|
|
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) {}
|
|
54
|
+
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<bool> geodesic, std::optional<std::string> color, std::optional<double> width): id(id), zIndex(zIndex), pressable(pressable), coordinates(coordinates), lineCap(lineCap), lineJoin(lineJoin), geodesic(geodesic), color(color), width(width) {}
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -69,6 +70,7 @@ namespace margelo::nitro {
|
|
|
69
70
|
JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::fromJSI(runtime, obj.getProperty(runtime, "coordinates")),
|
|
70
71
|
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineCapType>>::fromJSI(runtime, obj.getProperty(runtime, "lineCap")),
|
|
71
72
|
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineJoinType>>::fromJSI(runtime, obj.getProperty(runtime, "lineJoin")),
|
|
73
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "geodesic")),
|
|
72
74
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "color")),
|
|
73
75
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "width"))
|
|
74
76
|
);
|
|
@@ -81,6 +83,7 @@ namespace margelo::nitro {
|
|
|
81
83
|
obj.setProperty(runtime, "coordinates", JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::toJSI(runtime, arg.coordinates));
|
|
82
84
|
obj.setProperty(runtime, "lineCap", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineCapType>>::toJSI(runtime, arg.lineCap));
|
|
83
85
|
obj.setProperty(runtime, "lineJoin", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineJoinType>>::toJSI(runtime, arg.lineJoin));
|
|
86
|
+
obj.setProperty(runtime, "geodesic", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.geodesic));
|
|
84
87
|
obj.setProperty(runtime, "color", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.color));
|
|
85
88
|
obj.setProperty(runtime, "width", JSIConverter<std::optional<double>>::toJSI(runtime, arg.width));
|
|
86
89
|
return obj;
|
|
@@ -96,6 +99,7 @@ namespace margelo::nitro {
|
|
|
96
99
|
if (!JSIConverter<std::vector<margelo::nitro::rngooglemapsplus::RNLatLng>>::canConvert(runtime, obj.getProperty(runtime, "coordinates"))) return false;
|
|
97
100
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineCapType>>::canConvert(runtime, obj.getProperty(runtime, "lineCap"))) return false;
|
|
98
101
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLineJoinType>>::canConvert(runtime, obj.getProperty(runtime, "lineJoin"))) return false;
|
|
102
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "geodesic"))) return false;
|
|
99
103
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "color"))) return false;
|
|
100
104
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "width"))) return false;
|
|
101
105
|
return true;
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -164,6 +164,8 @@ export type RNMarker = {
|
|
|
164
164
|
opacity?: number;
|
|
165
165
|
flat?: boolean;
|
|
166
166
|
draggable?: boolean;
|
|
167
|
+
rotation?: number;
|
|
168
|
+
infoWindowAnchor?: RNPosition;
|
|
167
169
|
iconSvg?: RNMarkerSvg;
|
|
168
170
|
};
|
|
169
171
|
|
|
@@ -181,6 +183,12 @@ export type RNPolygon = {
|
|
|
181
183
|
fillColor?: string;
|
|
182
184
|
strokeColor?: string;
|
|
183
185
|
strokeWidth?: number;
|
|
186
|
+
holes?: RNPolygonHole[];
|
|
187
|
+
geodesic?: boolean;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export type RNPolygonHole = {
|
|
191
|
+
coordinates: RNLatLng[];
|
|
184
192
|
};
|
|
185
193
|
|
|
186
194
|
export type RNPolyline = {
|
|
@@ -190,6 +198,7 @@ export type RNPolyline = {
|
|
|
190
198
|
coordinates: RNLatLng[];
|
|
191
199
|
lineCap?: RNLineCapType;
|
|
192
200
|
lineJoin?: RNLineJoinType;
|
|
201
|
+
geodesic?: boolean;
|
|
193
202
|
color?: string;
|
|
194
203
|
width?: number;
|
|
195
204
|
};
|