react-native-google-maps-plus 1.2.0-dev.1 → 1.3.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/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +36 -8
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +13 -3
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +19 -4
- package/ios/GoogleMapViewImpl.swift +33 -12
- package/ios/MapMarkerBuilder.swift +17 -8
- package/ios/RNGoogleMapsPlusView.swift +13 -4
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +7 -4
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +6 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.cpp +4 -2
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string_.hpp +76 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string__RNLatLng.hpp +78 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +95 -37
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +14 -8
- package/nitrogen/generated/android/c++/JRNMarker.hpp +24 -0
- package/nitrogen/generated/android/c++/views/JHybridRNGoogleMapsPlusViewStateUpdater.cpp +12 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_std__string.kt → Func_void_std__optional_std__string_.kt} +12 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_std__optional_std__string__RNLatLng.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +54 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +18 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +12 -4
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +55 -18
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +29 -8
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +15 -0
- package/nitrogen/generated/ios/swift/{Func_void_std__string.swift → Func_void_std__optional_std__string_.swift} +18 -11
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string__RNLatLng.swift +54 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +7 -4
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +186 -48
- package/nitrogen/generated/ios/swift/RNMarker.swift +153 -1
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +6 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +14 -8
- package/nitrogen/generated/shared/c++/RNMarker.hpp +25 -1
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +44 -8
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +7 -4
- package/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +3 -0
- package/package.json +1 -1
- package/src/RNGoogleMapsPlusView.nitro.ts +7 -4
- package/src/types.ts +6 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +0 -75
|
@@ -18,7 +18,7 @@ public extension RNMarker {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `RNMarker`.
|
|
20
20
|
*/
|
|
21
|
-
init(id: String, zIndex: Double?, coordinate: RNLatLng, anchor: RNPosition?, iconSvg: RNMarkerSvg?) {
|
|
21
|
+
init(id: String, zIndex: Double?, coordinate: RNLatLng, anchor: RNPosition?, showInfoWindow: Bool?, title: String?, snippet: String?, opacity: Double?, flat: Bool?, draggable: Bool?, iconSvg: RNMarkerSvg?) {
|
|
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)
|
|
@@ -31,6 +31,42 @@ public extension RNMarker {
|
|
|
31
31
|
} else {
|
|
32
32
|
return .init()
|
|
33
33
|
}
|
|
34
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
35
|
+
if let __unwrappedValue = showInfoWindow {
|
|
36
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
41
|
+
if let __unwrappedValue = title {
|
|
42
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
47
|
+
if let __unwrappedValue = snippet {
|
|
48
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
49
|
+
} else {
|
|
50
|
+
return .init()
|
|
51
|
+
}
|
|
52
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
53
|
+
if let __unwrappedValue = opacity {
|
|
54
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
58
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
59
|
+
if let __unwrappedValue = flat {
|
|
60
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
61
|
+
} else {
|
|
62
|
+
return .init()
|
|
63
|
+
}
|
|
64
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
65
|
+
if let __unwrappedValue = draggable {
|
|
66
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
67
|
+
} else {
|
|
68
|
+
return .init()
|
|
69
|
+
}
|
|
34
70
|
}(), { () -> bridge.std__optional_RNMarkerSvg_ in
|
|
35
71
|
if let __unwrappedValue = iconSvg {
|
|
36
72
|
return bridge.create_std__optional_RNMarkerSvg_(__unwrappedValue)
|
|
@@ -103,6 +139,122 @@ public extension RNMarker {
|
|
|
103
139
|
}
|
|
104
140
|
}
|
|
105
141
|
|
|
142
|
+
var showInfoWindow: Bool? {
|
|
143
|
+
@inline(__always)
|
|
144
|
+
get {
|
|
145
|
+
return self.__showInfoWindow.value
|
|
146
|
+
}
|
|
147
|
+
@inline(__always)
|
|
148
|
+
set {
|
|
149
|
+
self.__showInfoWindow = { () -> bridge.std__optional_bool_ in
|
|
150
|
+
if let __unwrappedValue = newValue {
|
|
151
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
152
|
+
} else {
|
|
153
|
+
return .init()
|
|
154
|
+
}
|
|
155
|
+
}()
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
var title: String? {
|
|
160
|
+
@inline(__always)
|
|
161
|
+
get {
|
|
162
|
+
return { () -> String? in
|
|
163
|
+
if bridge.has_value_std__optional_std__string_(self.__title) {
|
|
164
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__title)
|
|
165
|
+
return String(__unwrapped)
|
|
166
|
+
} else {
|
|
167
|
+
return nil
|
|
168
|
+
}
|
|
169
|
+
}()
|
|
170
|
+
}
|
|
171
|
+
@inline(__always)
|
|
172
|
+
set {
|
|
173
|
+
self.__title = { () -> bridge.std__optional_std__string_ in
|
|
174
|
+
if let __unwrappedValue = newValue {
|
|
175
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
176
|
+
} else {
|
|
177
|
+
return .init()
|
|
178
|
+
}
|
|
179
|
+
}()
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
var snippet: String? {
|
|
184
|
+
@inline(__always)
|
|
185
|
+
get {
|
|
186
|
+
return { () -> String? in
|
|
187
|
+
if bridge.has_value_std__optional_std__string_(self.__snippet) {
|
|
188
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__snippet)
|
|
189
|
+
return String(__unwrapped)
|
|
190
|
+
} else {
|
|
191
|
+
return nil
|
|
192
|
+
}
|
|
193
|
+
}()
|
|
194
|
+
}
|
|
195
|
+
@inline(__always)
|
|
196
|
+
set {
|
|
197
|
+
self.__snippet = { () -> bridge.std__optional_std__string_ in
|
|
198
|
+
if let __unwrappedValue = newValue {
|
|
199
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
200
|
+
} else {
|
|
201
|
+
return .init()
|
|
202
|
+
}
|
|
203
|
+
}()
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
var opacity: Double? {
|
|
208
|
+
@inline(__always)
|
|
209
|
+
get {
|
|
210
|
+
return self.__opacity.value
|
|
211
|
+
}
|
|
212
|
+
@inline(__always)
|
|
213
|
+
set {
|
|
214
|
+
self.__opacity = { () -> bridge.std__optional_double_ in
|
|
215
|
+
if let __unwrappedValue = newValue {
|
|
216
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
217
|
+
} else {
|
|
218
|
+
return .init()
|
|
219
|
+
}
|
|
220
|
+
}()
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
var flat: Bool? {
|
|
225
|
+
@inline(__always)
|
|
226
|
+
get {
|
|
227
|
+
return self.__flat.value
|
|
228
|
+
}
|
|
229
|
+
@inline(__always)
|
|
230
|
+
set {
|
|
231
|
+
self.__flat = { () -> bridge.std__optional_bool_ in
|
|
232
|
+
if let __unwrappedValue = newValue {
|
|
233
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
234
|
+
} else {
|
|
235
|
+
return .init()
|
|
236
|
+
}
|
|
237
|
+
}()
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
var draggable: Bool? {
|
|
242
|
+
@inline(__always)
|
|
243
|
+
get {
|
|
244
|
+
return self.__draggable.value
|
|
245
|
+
}
|
|
246
|
+
@inline(__always)
|
|
247
|
+
set {
|
|
248
|
+
self.__draggable = { () -> bridge.std__optional_bool_ in
|
|
249
|
+
if let __unwrappedValue = newValue {
|
|
250
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
251
|
+
} else {
|
|
252
|
+
return .init()
|
|
253
|
+
}
|
|
254
|
+
}()
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
106
258
|
var iconSvg: RNMarkerSvg? {
|
|
107
259
|
@inline(__always)
|
|
108
260
|
get {
|
|
@@ -68,6 +68,12 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
68
68
|
prototype.registerHybridSetter("onPolygonPress", &HybridRNGoogleMapsPlusViewSpec::setOnPolygonPress);
|
|
69
69
|
prototype.registerHybridGetter("onCirclePress", &HybridRNGoogleMapsPlusViewSpec::getOnCirclePress);
|
|
70
70
|
prototype.registerHybridSetter("onCirclePress", &HybridRNGoogleMapsPlusViewSpec::setOnCirclePress);
|
|
71
|
+
prototype.registerHybridGetter("onMarkerDragStart", &HybridRNGoogleMapsPlusViewSpec::getOnMarkerDragStart);
|
|
72
|
+
prototype.registerHybridSetter("onMarkerDragStart", &HybridRNGoogleMapsPlusViewSpec::setOnMarkerDragStart);
|
|
73
|
+
prototype.registerHybridGetter("onMarkerDrag", &HybridRNGoogleMapsPlusViewSpec::getOnMarkerDrag);
|
|
74
|
+
prototype.registerHybridSetter("onMarkerDrag", &HybridRNGoogleMapsPlusViewSpec::setOnMarkerDrag);
|
|
75
|
+
prototype.registerHybridGetter("onMarkerDragEnd", &HybridRNGoogleMapsPlusViewSpec::getOnMarkerDragEnd);
|
|
76
|
+
prototype.registerHybridSetter("onMarkerDragEnd", &HybridRNGoogleMapsPlusViewSpec::setOnMarkerDragEnd);
|
|
71
77
|
prototype.registerHybridGetter("onCameraChangeStart", &HybridRNGoogleMapsPlusViewSpec::getOnCameraChangeStart);
|
|
72
78
|
prototype.registerHybridSetter("onCameraChangeStart", &HybridRNGoogleMapsPlusViewSpec::setOnCameraChangeStart);
|
|
73
79
|
prototype.registerHybridGetter("onCameraChange", &HybridRNGoogleMapsPlusViewSpec::getOnCameraChange);
|
|
@@ -153,14 +153,20 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
153
153
|
virtual void setOnLocationError(const std::optional<std::function<void(RNLocationErrorCode /* error */)>>& onLocationError) = 0;
|
|
154
154
|
virtual std::optional<std::function<void(const RNLatLng& /* coordinate */)>> getOnMapPress() = 0;
|
|
155
155
|
virtual void setOnMapPress(const std::optional<std::function<void(const RNLatLng& /* coordinate */)>>& onMapPress) = 0;
|
|
156
|
-
virtual std::optional<std::function<void(const std::string
|
|
157
|
-
virtual void setOnMarkerPress(const std::optional<std::function<void(const std::string
|
|
158
|
-
virtual std::optional<std::function<void(const std::string
|
|
159
|
-
virtual void setOnPolylinePress(const std::optional<std::function<void(const std::string
|
|
160
|
-
virtual std::optional<std::function<void(const std::string
|
|
161
|
-
virtual void setOnPolygonPress(const std::optional<std::function<void(const std::string
|
|
162
|
-
virtual std::optional<std::function<void(const std::string
|
|
163
|
-
virtual void setOnCirclePress(const std::optional<std::function<void(const std::string
|
|
156
|
+
virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnMarkerPress() = 0;
|
|
157
|
+
virtual void setOnMarkerPress(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onMarkerPress) = 0;
|
|
158
|
+
virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnPolylinePress() = 0;
|
|
159
|
+
virtual void setOnPolylinePress(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onPolylinePress) = 0;
|
|
160
|
+
virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnPolygonPress() = 0;
|
|
161
|
+
virtual void setOnPolygonPress(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onPolygonPress) = 0;
|
|
162
|
+
virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnCirclePress() = 0;
|
|
163
|
+
virtual void setOnCirclePress(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onCirclePress) = 0;
|
|
164
|
+
virtual std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>> getOnMarkerDragStart() = 0;
|
|
165
|
+
virtual void setOnMarkerDragStart(const std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>& onMarkerDragStart) = 0;
|
|
166
|
+
virtual std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>> getOnMarkerDrag() = 0;
|
|
167
|
+
virtual void setOnMarkerDrag(const std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>& onMarkerDrag) = 0;
|
|
168
|
+
virtual std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>> getOnMarkerDragEnd() = 0;
|
|
169
|
+
virtual void setOnMarkerDragEnd(const std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>& onMarkerDragEnd) = 0;
|
|
164
170
|
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>> getOnCameraChangeStart() = 0;
|
|
165
171
|
virtual void setOnCameraChangeStart(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>& onCameraChangeStart) = 0;
|
|
166
172
|
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>> getOnCameraChange() = 0;
|
|
@@ -42,11 +42,17 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
42
42
|
std::optional<double> zIndex SWIFT_PRIVATE;
|
|
43
43
|
RNLatLng coordinate SWIFT_PRIVATE;
|
|
44
44
|
std::optional<RNPosition> anchor SWIFT_PRIVATE;
|
|
45
|
+
std::optional<bool> showInfoWindow SWIFT_PRIVATE;
|
|
46
|
+
std::optional<std::string> title SWIFT_PRIVATE;
|
|
47
|
+
std::optional<std::string> snippet SWIFT_PRIVATE;
|
|
48
|
+
std::optional<double> opacity SWIFT_PRIVATE;
|
|
49
|
+
std::optional<bool> flat SWIFT_PRIVATE;
|
|
50
|
+
std::optional<bool> draggable SWIFT_PRIVATE;
|
|
45
51
|
std::optional<RNMarkerSvg> iconSvg SWIFT_PRIVATE;
|
|
46
52
|
|
|
47
53
|
public:
|
|
48
54
|
RNMarker() = default;
|
|
49
|
-
explicit RNMarker(std::string id, std::optional<double> zIndex, RNLatLng coordinate, std::optional<RNPosition> anchor, std::optional<RNMarkerSvg> iconSvg): id(id), zIndex(zIndex), coordinate(coordinate), anchor(anchor), iconSvg(iconSvg) {}
|
|
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) {}
|
|
50
56
|
};
|
|
51
57
|
|
|
52
58
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -63,6 +69,12 @@ namespace margelo::nitro {
|
|
|
63
69
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
64
70
|
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "coordinate")),
|
|
65
71
|
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
|
|
72
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "showInfoWindow")),
|
|
73
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "title")),
|
|
74
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "snippet")),
|
|
75
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "opacity")),
|
|
76
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "flat")),
|
|
77
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "draggable")),
|
|
66
78
|
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::fromJSI(runtime, obj.getProperty(runtime, "iconSvg"))
|
|
67
79
|
);
|
|
68
80
|
}
|
|
@@ -72,6 +84,12 @@ namespace margelo::nitro {
|
|
|
72
84
|
obj.setProperty(runtime, "zIndex", JSIConverter<std::optional<double>>::toJSI(runtime, arg.zIndex));
|
|
73
85
|
obj.setProperty(runtime, "coordinate", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.coordinate));
|
|
74
86
|
obj.setProperty(runtime, "anchor", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::toJSI(runtime, arg.anchor));
|
|
87
|
+
obj.setProperty(runtime, "showInfoWindow", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.showInfoWindow));
|
|
88
|
+
obj.setProperty(runtime, "title", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.title));
|
|
89
|
+
obj.setProperty(runtime, "snippet", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.snippet));
|
|
90
|
+
obj.setProperty(runtime, "opacity", JSIConverter<std::optional<double>>::toJSI(runtime, arg.opacity));
|
|
91
|
+
obj.setProperty(runtime, "flat", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.flat));
|
|
92
|
+
obj.setProperty(runtime, "draggable", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.draggable));
|
|
75
93
|
obj.setProperty(runtime, "iconSvg", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::toJSI(runtime, arg.iconSvg));
|
|
76
94
|
return obj;
|
|
77
95
|
}
|
|
@@ -84,6 +102,12 @@ namespace margelo::nitro {
|
|
|
84
102
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
85
103
|
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "coordinate"))) return false;
|
|
86
104
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
|
|
105
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "showInfoWindow"))) return false;
|
|
106
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "title"))) return false;
|
|
107
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "snippet"))) return false;
|
|
108
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "opacity"))) return false;
|
|
109
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "flat"))) return false;
|
|
110
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "draggable"))) return false;
|
|
87
111
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::canConvert(runtime, obj.getProperty(runtime, "iconSvg"))) return false;
|
|
88
112
|
return true;
|
|
89
113
|
}
|
|
@@ -255,46 +255,76 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
255
255
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapPress: ") + exc.what());
|
|
256
256
|
}
|
|
257
257
|
}()),
|
|
258
|
-
onMarkerPress([&]() -> CachedProp<std::optional<std::function<void(const std::string
|
|
258
|
+
onMarkerPress([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
|
|
259
259
|
try {
|
|
260
260
|
const react::RawValue* rawValue = rawProps.at("onMarkerPress", nullptr, nullptr);
|
|
261
261
|
if (rawValue == nullptr) return sourceProps.onMarkerPress;
|
|
262
262
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
263
|
-
return CachedProp<std::optional<std::function<void(const std::string
|
|
263
|
+
return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerPress);
|
|
264
264
|
} catch (const std::exception& exc) {
|
|
265
265
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMarkerPress: ") + exc.what());
|
|
266
266
|
}
|
|
267
267
|
}()),
|
|
268
|
-
onPolylinePress([&]() -> CachedProp<std::optional<std::function<void(const std::string
|
|
268
|
+
onPolylinePress([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
|
|
269
269
|
try {
|
|
270
270
|
const react::RawValue* rawValue = rawProps.at("onPolylinePress", nullptr, nullptr);
|
|
271
271
|
if (rawValue == nullptr) return sourceProps.onPolylinePress;
|
|
272
272
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
273
|
-
return CachedProp<std::optional<std::function<void(const std::string
|
|
273
|
+
return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onPolylinePress);
|
|
274
274
|
} catch (const std::exception& exc) {
|
|
275
275
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onPolylinePress: ") + exc.what());
|
|
276
276
|
}
|
|
277
277
|
}()),
|
|
278
|
-
onPolygonPress([&]() -> CachedProp<std::optional<std::function<void(const std::string
|
|
278
|
+
onPolygonPress([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
|
|
279
279
|
try {
|
|
280
280
|
const react::RawValue* rawValue = rawProps.at("onPolygonPress", nullptr, nullptr);
|
|
281
281
|
if (rawValue == nullptr) return sourceProps.onPolygonPress;
|
|
282
282
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
283
|
-
return CachedProp<std::optional<std::function<void(const std::string
|
|
283
|
+
return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onPolygonPress);
|
|
284
284
|
} catch (const std::exception& exc) {
|
|
285
285
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onPolygonPress: ") + exc.what());
|
|
286
286
|
}
|
|
287
287
|
}()),
|
|
288
|
-
onCirclePress([&]() -> CachedProp<std::optional<std::function<void(const std::string
|
|
288
|
+
onCirclePress([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
|
|
289
289
|
try {
|
|
290
290
|
const react::RawValue* rawValue = rawProps.at("onCirclePress", nullptr, nullptr);
|
|
291
291
|
if (rawValue == nullptr) return sourceProps.onCirclePress;
|
|
292
292
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
293
|
-
return CachedProp<std::optional<std::function<void(const std::string
|
|
293
|
+
return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCirclePress);
|
|
294
294
|
} catch (const std::exception& exc) {
|
|
295
295
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCirclePress: ") + exc.what());
|
|
296
296
|
}
|
|
297
297
|
}()),
|
|
298
|
+
onMarkerDragStart([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> {
|
|
299
|
+
try {
|
|
300
|
+
const react::RawValue* rawValue = rawProps.at("onMarkerDragStart", nullptr, nullptr);
|
|
301
|
+
if (rawValue == nullptr) return sourceProps.onMarkerDragStart;
|
|
302
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
303
|
+
return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerDragStart);
|
|
304
|
+
} catch (const std::exception& exc) {
|
|
305
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMarkerDragStart: ") + exc.what());
|
|
306
|
+
}
|
|
307
|
+
}()),
|
|
308
|
+
onMarkerDrag([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> {
|
|
309
|
+
try {
|
|
310
|
+
const react::RawValue* rawValue = rawProps.at("onMarkerDrag", nullptr, nullptr);
|
|
311
|
+
if (rawValue == nullptr) return sourceProps.onMarkerDrag;
|
|
312
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
313
|
+
return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerDrag);
|
|
314
|
+
} catch (const std::exception& exc) {
|
|
315
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMarkerDrag: ") + exc.what());
|
|
316
|
+
}
|
|
317
|
+
}()),
|
|
318
|
+
onMarkerDragEnd([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> {
|
|
319
|
+
try {
|
|
320
|
+
const react::RawValue* rawValue = rawProps.at("onMarkerDragEnd", nullptr, nullptr);
|
|
321
|
+
if (rawValue == nullptr) return sourceProps.onMarkerDragEnd;
|
|
322
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
323
|
+
return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerDragEnd);
|
|
324
|
+
} catch (const std::exception& exc) {
|
|
325
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMarkerDragEnd: ") + exc.what());
|
|
326
|
+
}
|
|
327
|
+
}()),
|
|
298
328
|
onCameraChangeStart([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> {
|
|
299
329
|
try {
|
|
300
330
|
const react::RawValue* rawValue = rawProps.at("onCameraChangeStart", nullptr, nullptr);
|
|
@@ -365,6 +395,9 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
365
395
|
onPolylinePress(other.onPolylinePress),
|
|
366
396
|
onPolygonPress(other.onPolygonPress),
|
|
367
397
|
onCirclePress(other.onCirclePress),
|
|
398
|
+
onMarkerDragStart(other.onMarkerDragStart),
|
|
399
|
+
onMarkerDrag(other.onMarkerDrag),
|
|
400
|
+
onMarkerDragEnd(other.onMarkerDragEnd),
|
|
368
401
|
onCameraChangeStart(other.onCameraChangeStart),
|
|
369
402
|
onCameraChange(other.onCameraChange),
|
|
370
403
|
onCameraChangeComplete(other.onCameraChangeComplete),
|
|
@@ -399,6 +432,9 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
399
432
|
case hashString("onPolylinePress"): return true;
|
|
400
433
|
case hashString("onPolygonPress"): return true;
|
|
401
434
|
case hashString("onCirclePress"): return true;
|
|
435
|
+
case hashString("onMarkerDragStart"): return true;
|
|
436
|
+
case hashString("onMarkerDrag"): return true;
|
|
437
|
+
case hashString("onMarkerDragEnd"): return true;
|
|
402
438
|
case hashString("onCameraChangeStart"): return true;
|
|
403
439
|
case hashString("onCameraChange"): return true;
|
|
404
440
|
case hashString("onCameraChangeComplete"): return true;
|
|
@@ -86,10 +86,13 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
86
86
|
CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>> onLocationUpdate;
|
|
87
87
|
CachedProp<std::optional<std::function<void(RNLocationErrorCode /* error */)>>> onLocationError;
|
|
88
88
|
CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>> onMapPress;
|
|
89
|
-
CachedProp<std::optional<std::function<void(const std::string
|
|
90
|
-
CachedProp<std::optional<std::function<void(const std::string
|
|
91
|
-
CachedProp<std::optional<std::function<void(const std::string
|
|
92
|
-
CachedProp<std::optional<std::function<void(const std::string
|
|
89
|
+
CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onMarkerPress;
|
|
90
|
+
CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onPolylinePress;
|
|
91
|
+
CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onPolygonPress;
|
|
92
|
+
CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onCirclePress;
|
|
93
|
+
CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> onMarkerDragStart;
|
|
94
|
+
CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> onMarkerDrag;
|
|
95
|
+
CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> onMarkerDragEnd;
|
|
93
96
|
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChangeStart;
|
|
94
97
|
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChange;
|
|
95
98
|
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChangeComplete;
|
package/package.json
CHANGED
|
@@ -50,10 +50,13 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
|
|
|
50
50
|
onLocationUpdate?: (location: RNLocation) => void;
|
|
51
51
|
onLocationError?: (error: RNLocationErrorCode) => void;
|
|
52
52
|
onMapPress?: (coordinate: RNLatLng) => void;
|
|
53
|
-
onMarkerPress?: (id
|
|
54
|
-
onPolylinePress?: (id
|
|
55
|
-
onPolygonPress?: (id
|
|
56
|
-
onCirclePress?: (id
|
|
53
|
+
onMarkerPress?: (id?: string | undefined) => void;
|
|
54
|
+
onPolylinePress?: (id?: string | undefined) => void;
|
|
55
|
+
onPolygonPress?: (id?: string | undefined) => void;
|
|
56
|
+
onCirclePress?: (id?: string | undefined) => void;
|
|
57
|
+
onMarkerDragStart?: (id: string | undefined, location: RNLatLng) => void;
|
|
58
|
+
onMarkerDrag?: (id: string | undefined, location: RNLatLng) => void;
|
|
59
|
+
onMarkerDragEnd?: (id: string | undefined, location: RNLatLng) => void;
|
|
57
60
|
onCameraChangeStart?: (
|
|
58
61
|
region: RNRegion,
|
|
59
62
|
camera: RNCamera,
|
package/src/types.ts
CHANGED
|
@@ -136,6 +136,12 @@ export type RNMarker = {
|
|
|
136
136
|
zIndex?: number;
|
|
137
137
|
coordinate: RNLatLng;
|
|
138
138
|
anchor?: RNPosition;
|
|
139
|
+
showInfoWindow?: boolean;
|
|
140
|
+
title?: string;
|
|
141
|
+
snippet?: string;
|
|
142
|
+
opacity?: number;
|
|
143
|
+
flat?: boolean;
|
|
144
|
+
draggable?: boolean;
|
|
139
145
|
iconSvg?: RNMarkerSvg;
|
|
140
146
|
};
|
|
141
147
|
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JFunc_void_std__string.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
|
-
#include <fbjni/fbjni.h>
|
|
11
|
-
#include <functional>
|
|
12
|
-
|
|
13
|
-
#include <string>
|
|
14
|
-
#include <functional>
|
|
15
|
-
|
|
16
|
-
namespace margelo::nitro::rngooglemapsplus {
|
|
17
|
-
|
|
18
|
-
using namespace facebook;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Represents the Java/Kotlin callback `(id: String) -> Unit`.
|
|
22
|
-
* This can be passed around between C++ and Java/Kotlin.
|
|
23
|
-
*/
|
|
24
|
-
struct JFunc_void_std__string: public jni::JavaClass<JFunc_void_std__string> {
|
|
25
|
-
public:
|
|
26
|
-
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_std__string;";
|
|
27
|
-
|
|
28
|
-
public:
|
|
29
|
-
/**
|
|
30
|
-
* Invokes the function this `JFunc_void_std__string` instance holds through JNI.
|
|
31
|
-
*/
|
|
32
|
-
void invoke(const std::string& id) const {
|
|
33
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* id */)>("invoke");
|
|
34
|
-
method(self(), jni::make_jstring(id));
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* An implementation of Func_void_std__string that is backed by a C++ implementation (using `std::function<...>`)
|
|
40
|
-
*/
|
|
41
|
-
struct JFunc_void_std__string_cxx final: public jni::HybridClass<JFunc_void_std__string_cxx, JFunc_void_std__string> {
|
|
42
|
-
public:
|
|
43
|
-
static jni::local_ref<JFunc_void_std__string::javaobject> fromCpp(const std::function<void(const std::string& /* id */)>& func) {
|
|
44
|
-
return JFunc_void_std__string_cxx::newObjectCxxArgs(func);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public:
|
|
48
|
-
/**
|
|
49
|
-
* Invokes the C++ `std::function<...>` this `JFunc_void_std__string_cxx` instance holds.
|
|
50
|
-
*/
|
|
51
|
-
void invoke_cxx(jni::alias_ref<jni::JString> id) {
|
|
52
|
-
_func(id->toStdString());
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public:
|
|
56
|
-
[[nodiscard]]
|
|
57
|
-
inline const std::function<void(const std::string& /* id */)>& getFunction() const {
|
|
58
|
-
return _func;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
public:
|
|
62
|
-
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_std__string_cxx;";
|
|
63
|
-
static void registerNatives() {
|
|
64
|
-
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__string_cxx::invoke_cxx)});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
private:
|
|
68
|
-
explicit JFunc_void_std__string_cxx(const std::function<void(const std::string& /* id */)>& func): _func(func) { }
|
|
69
|
-
|
|
70
|
-
private:
|
|
71
|
-
friend HybridBase;
|
|
72
|
-
std::function<void(const std::string& /* id */)> _func;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
} // namespace margelo::nitro::rngooglemapsplus
|