@maydon_tech/react-native-nitro-maps 0.1.3 → 0.2.0
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/LICENSE +1 -1
- package/NitroMap.podspec +1 -1
- package/README.md +82 -9
- package/android/CMakeLists.txt +4 -1
- package/android/gradle.properties +4 -4
- package/android/src/main/cpp/ClusterEngineJNI.cpp +198 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/NitroMap.kt +397 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/NitroMapConfig.kt +53 -0
- package/android/src/main/{java → kotlin}/com/margelo/nitro/nitromap/NitroMapPackage.kt +4 -4
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/NitroMapView.kt +73 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/UserLocationManager.kt +295 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/clustering/ClusterIconRenderer.kt +111 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/clustering/ClusteringManager.kt +104 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/clustering/NitroClusterEngine.kt +166 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/markers/MarkerIconFactory.kt +303 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/markers/MarkerSelectionHandler.kt +72 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/markers/PriceMarkerRenderer.kt +159 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/MapProviderFactory.kt +24 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/MapProviderInterface.kt +128 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapDelegate.kt +317 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+Clustering.kt +524 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+Markers.kt +358 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+Overlays.kt +272 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+UserLocation.kt +296 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider.kt +815 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/MarkerTagData.kt +19 -0
- package/ios/Clustering/ClusterIconRenderer.swift +3 -3
- package/ios/Location/NitroLocationManager.swift +116 -0
- package/ios/MarkerRenderer/MarkerIconFactory.swift +1 -3
- package/ios/MarkerRenderer/PriceMarkerRenderer.swift +10 -6
- package/ios/NitroMap.swift +279 -13
- package/ios/NitroMapConfig/NitroMapConfig.swift +45 -0
- package/ios/Providers/{GoogleMapDelegate.swift → Google/GoogleMapDelegate.swift} +48 -23
- package/ios/Providers/Google/GoogleMapProvider+Camera.swift +180 -0
- package/ios/Providers/Google/GoogleMapProvider+Clustering.swift +541 -0
- package/ios/Providers/Google/GoogleMapProvider+Markers.swift +270 -0
- package/ios/Providers/Google/GoogleMapProvider+Overlays.swift +245 -0
- package/ios/Providers/Google/GoogleMapProvider+UserLocation.swift +180 -0
- package/ios/Providers/Google/GoogleMapProvider.swift +342 -0
- package/ios/Providers/MapProviderFactory.swift +17 -0
- package/ios/Providers/MapProviderProtocol.swift +48 -1
- package/ios/Shared/ClusterConfig+Factory.swift +2 -2
- package/ios/Shared/MapStyleProvider.swift +6 -4
- package/ios/Shared/MarkerSelectionHandler.swift +4 -1
- package/ios/Utils/ColorValueExtension.swift +46 -67
- package/lib/module/components/ImageMarker.js +39 -29
- package/lib/module/components/ImageMarker.js.map +1 -1
- package/lib/module/components/Marker.js +118 -0
- package/lib/module/components/Marker.js.map +1 -0
- package/lib/module/components/NitroCircle.js +92 -0
- package/lib/module/components/NitroCircle.js.map +1 -0
- package/lib/module/components/NitroMap.js +216 -76
- package/lib/module/components/NitroMap.js.map +1 -1
- package/lib/module/components/NitroPolygon.js +135 -0
- package/lib/module/components/NitroPolygon.js.map +1 -0
- package/lib/module/components/NitroPolyline.js +115 -0
- package/lib/module/components/NitroPolyline.js.map +1 -0
- package/lib/module/components/PriceMarker.js +16 -29
- package/lib/module/components/PriceMarker.js.map +1 -1
- package/lib/module/context/NitroMapContext.js.map +1 -1
- package/lib/module/hooks/useNitroCircle.js +18 -0
- package/lib/module/hooks/useNitroCircle.js.map +1 -0
- package/lib/module/hooks/useNitroMarker.js +26 -9
- package/lib/module/hooks/useNitroMarker.js.map +1 -1
- package/lib/module/hooks/useNitroOverlay.js +59 -0
- package/lib/module/hooks/useNitroOverlay.js.map +1 -0
- package/lib/module/hooks/useNitroPolygon.js +18 -0
- package/lib/module/hooks/useNitroPolygon.js.map +1 -0
- package/lib/module/hooks/useNitroPolyline.js +18 -0
- package/lib/module/hooks/useNitroPolyline.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/overlay.js +4 -0
- package/lib/module/types/overlay.js.map +1 -0
- package/lib/module/types/theme.js +4 -0
- package/lib/module/types/theme.js.map +1 -0
- package/lib/module/utils/colors.js +41 -13
- package/lib/module/utils/colors.js.map +1 -1
- package/lib/module/utils/validation.js +45 -0
- package/lib/module/utils/validation.js.map +1 -0
- package/lib/typescript/src/components/ImageMarker.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.d.ts +34 -0
- package/lib/typescript/src/components/Marker.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroCircle.d.ts +70 -0
- package/lib/typescript/src/components/NitroCircle.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroMap.d.ts +60 -3
- package/lib/typescript/src/components/NitroMap.d.ts.map +1 -1
- package/lib/typescript/src/components/NitroPolygon.d.ts +86 -0
- package/lib/typescript/src/components/NitroPolygon.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroPolyline.d.ts +84 -0
- package/lib/typescript/src/components/NitroPolyline.d.ts.map +1 -0
- package/lib/typescript/src/components/PriceMarker.d.ts +0 -5
- package/lib/typescript/src/components/PriceMarker.d.ts.map +1 -1
- package/lib/typescript/src/context/NitroMapContext.d.ts +2 -0
- package/lib/typescript/src/context/NitroMapContext.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useNitroCircle.d.ts +7 -0
- package/lib/typescript/src/hooks/useNitroCircle.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNitroMarker.d.ts +20 -0
- package/lib/typescript/src/hooks/useNitroMarker.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useNitroOverlay.d.ts +26 -0
- package/lib/typescript/src/hooks/useNitroOverlay.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNitroPolygon.d.ts +7 -0
- package/lib/typescript/src/hooks/useNitroPolygon.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNitroPolyline.d.ts +7 -0
- package/lib/typescript/src/hooks/useNitroPolyline.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +15 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/NitroMap.nitro.d.ts +248 -6
- package/lib/typescript/src/specs/NitroMap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types/map.d.ts +34 -4
- package/lib/typescript/src/types/map.d.ts.map +1 -1
- package/lib/typescript/src/types/marker.d.ts +24 -36
- package/lib/typescript/src/types/marker.d.ts.map +1 -1
- package/lib/typescript/src/types/overlay.d.ts +75 -0
- package/lib/typescript/src/types/overlay.d.ts.map +1 -0
- package/lib/typescript/src/types/theme.d.ts +93 -0
- package/lib/typescript/src/types/theme.d.ts.map +1 -0
- package/lib/typescript/src/utils/colors.d.ts +6 -8
- package/lib/typescript/src/utils/colors.d.ts.map +1 -1
- package/lib/typescript/src/utils/validation.d.ts +12 -0
- package/lib/typescript/src/utils/validation.d.ts.map +1 -0
- package/nitrogen/generated/android/c++/JCircleData.hpp +94 -0
- package/nitrogen/generated/android/c++/JClusterConfig.hpp +5 -7
- package/nitrogen/generated/android/c++/JFunc_void_UserLocationChangeEvent.hpp +79 -0
- package/nitrogen/generated/android/c++/JFunc_void_UserTrackingMode.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridNitroMapSpec.cpp +328 -21
- package/nitrogen/generated/android/c++/JHybridNitroMapSpec.hpp +53 -2
- package/nitrogen/generated/android/c++/JMarkerAnimation.hpp +3 -6
- package/nitrogen/generated/android/c++/JMarkerData.hpp +15 -3
- package/nitrogen/generated/android/c++/JPolygonData.hpp +149 -0
- package/nitrogen/generated/android/c++/JPolylineData.hpp +113 -0
- package/nitrogen/generated/android/c++/JUserLocationChangeEvent.hpp +70 -0
- package/nitrogen/generated/android/c++/JUserTrackingMode.hpp +62 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroMapStateUpdater.cpp +72 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/CircleData.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ClusterConfig.kt +4 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_UserLocationChangeEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_UserTrackingMode.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/HybridNitroMapSpec.kt +228 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerAnimation.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerData.kt +12 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/PolygonData.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/PolylineData.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/UserLocationChangeEvent.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/{ClusterAnimationStyle.kt → UserTrackingMode.kt} +6 -8
- package/nitrogen/generated/android/nitromapOnLoad.cpp +6 -0
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Bridge.cpp +24 -0
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Bridge.hpp +175 -17
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Umbrella.hpp +15 -3
- package/nitrogen/generated/ios/c++/HybridNitroMapSpecSwift.hpp +249 -16
- package/nitrogen/generated/ios/c++/views/HybridNitroMapComponent.mm +90 -5
- package/nitrogen/generated/ios/swift/CircleData.swift +143 -0
- package/nitrogen/generated/ios/swift/ClusterConfig.swift +22 -15
- package/nitrogen/generated/ios/swift/Func_void_UserLocationChangeEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_UserTrackingMode.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridNitroMapSpec.swift +35 -1
- package/nitrogen/generated/ios/swift/HybridNitroMapSpec_cxx.swift +582 -8
- package/nitrogen/generated/ios/swift/MarkerAnimation.swift +4 -8
- package/nitrogen/generated/ios/swift/MarkerData.swift +54 -2
- package/nitrogen/generated/ios/swift/PolygonData.swift +179 -0
- package/nitrogen/generated/ios/swift/PolylineData.swift +155 -0
- package/nitrogen/generated/ios/swift/UserLocationChangeEvent.swift +69 -0
- package/nitrogen/generated/ios/swift/UserTrackingMode.swift +44 -0
- package/nitrogen/generated/shared/c++/CircleData.hpp +113 -0
- package/nitrogen/generated/shared/c++/ClusterConfig.hpp +5 -8
- package/nitrogen/generated/shared/c++/HybridNitroMapSpec.cpp +53 -2
- package/nitrogen/generated/shared/c++/HybridNitroMapSpec.hpp +75 -6
- package/nitrogen/generated/shared/c++/MarkerAnimation.hpp +4 -8
- package/nitrogen/generated/shared/c++/MarkerData.hpp +14 -2
- package/nitrogen/generated/shared/c++/PolygonData.hpp +114 -0
- package/nitrogen/generated/shared/c++/PolylineData.hpp +114 -0
- package/nitrogen/generated/shared/c++/UserLocationChangeEvent.hpp +88 -0
- package/nitrogen/generated/shared/c++/UserTrackingMode.hpp +80 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroMapComponent.cpp +216 -12
- package/nitrogen/generated/shared/c++/views/HybridNitroMapComponent.hpp +23 -1
- package/nitrogen/generated/shared/json/NitroMapConfig.json +18 -1
- package/package.json +36 -5
- package/src/components/ImageMarker.tsx +58 -42
- package/src/components/Marker.tsx +161 -0
- package/src/components/NitroCircle.tsx +183 -0
- package/src/components/NitroMap.tsx +328 -78
- package/src/components/NitroPolygon.tsx +229 -0
- package/src/components/NitroPolyline.tsx +208 -0
- package/src/components/PriceMarker.tsx +23 -48
- package/src/context/NitroMapContext.tsx +4 -0
- package/src/hooks/useNitroCircle.ts +25 -0
- package/src/hooks/useNitroMarker.ts +49 -10
- package/src/hooks/useNitroOverlay.ts +68 -0
- package/src/hooks/useNitroPolygon.ts +25 -0
- package/src/hooks/useNitroPolyline.ts +25 -0
- package/src/index.tsx +23 -2
- package/src/specs/NitroMap.nitro.ts +294 -5
- package/src/types/map.ts +36 -4
- package/src/types/marker.ts +24 -44
- package/src/types/overlay.ts +77 -0
- package/src/types/theme.ts +101 -0
- package/src/utils/colors.ts +48 -16
- package/src/utils/validation.ts +69 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/ClusterIconGenerator.kt +0 -108
- package/android/src/main/java/com/margelo/nitro/nitromap/ColorUtils.kt +0 -63
- package/android/src/main/java/com/margelo/nitro/nitromap/HybridNitroMap.kt +0 -408
- package/android/src/main/java/com/margelo/nitro/nitromap/HybridNitroMapConfig.kt +0 -68
- package/android/src/main/java/com/margelo/nitro/nitromap/MarkerIconCache.kt +0 -176
- package/android/src/main/java/com/margelo/nitro/nitromap/MarkerIconFactory.kt +0 -252
- package/android/src/main/java/com/margelo/nitro/nitromap/clustering/NitroClusterEngine.kt +0 -252
- package/android/src/main/java/com/margelo/nitro/nitromap/clustering/QuadTree.kt +0 -195
- package/android/src/main/java/com/margelo/nitro/nitromap/providers/GoogleMapProvider.kt +0 -912
- package/android/src/main/java/com/margelo/nitro/nitromap/providers/MapProviderInterface.kt +0 -70
- package/cpp/QuadTree.hpp +0 -246
- package/ios/NitroMapConfig/HybridNitroMapConfig.swift +0 -33
- package/ios/Providers/GoogleMapProvider+Camera.swift +0 -164
- package/ios/Providers/GoogleMapProvider.swift +0 -924
- package/nitrogen/generated/android/c++/JClusterAnimationStyle.hpp +0 -68
- package/nitrogen/generated/ios/swift/ClusterAnimationStyle.swift +0 -52
- package/nitrogen/generated/shared/c++/ClusterAnimationStyle.hpp +0 -88
|
@@ -19,7 +19,7 @@ public extension MarkerData {
|
|
|
19
19
|
/**
|
|
20
20
|
* Create a new instance of `MarkerData`.
|
|
21
21
|
*/
|
|
22
|
-
init(id: String, coordinate: Coordinate, title: String?, description: String?, draggable: Bool, opacity: Double, rotation: Double, zIndex: Double, anchor: Point, config: MarkerConfig, clusteringEnabled: Bool, animation: MarkerAnimation) {
|
|
22
|
+
init(id: String, coordinate: Coordinate, title: String?, description: String?, draggable: Bool, opacity: Double, rotation: Double, zIndex: Double, anchor: Point, config: MarkerConfig, accessibilityLabel: String?, clusteringEnabled: Bool, animation: MarkerAnimation, animationDuration: Double, animateOnReappear: Bool) {
|
|
23
23
|
self.init(std.string(id), coordinate, { () -> bridge.std__optional_std__string_ in
|
|
24
24
|
if let __unwrappedValue = title {
|
|
25
25
|
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
@@ -32,7 +32,13 @@ public extension MarkerData {
|
|
|
32
32
|
} else {
|
|
33
33
|
return .init()
|
|
34
34
|
}
|
|
35
|
-
}(), draggable, opacity, rotation, zIndex, anchor, config,
|
|
35
|
+
}(), draggable, opacity, rotation, zIndex, anchor, config, { () -> bridge.std__optional_std__string_ in
|
|
36
|
+
if let __unwrappedValue = accessibilityLabel {
|
|
37
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
38
|
+
} else {
|
|
39
|
+
return .init()
|
|
40
|
+
}
|
|
41
|
+
}(), clusteringEnabled, animation, animationDuration, animateOnReappear)
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
var id: String {
|
|
@@ -171,6 +177,30 @@ public extension MarkerData {
|
|
|
171
177
|
}
|
|
172
178
|
}
|
|
173
179
|
|
|
180
|
+
var accessibilityLabel: String? {
|
|
181
|
+
@inline(__always)
|
|
182
|
+
get {
|
|
183
|
+
return { () -> String? in
|
|
184
|
+
if bridge.has_value_std__optional_std__string_(self.__accessibilityLabel) {
|
|
185
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__accessibilityLabel)
|
|
186
|
+
return String(__unwrapped)
|
|
187
|
+
} else {
|
|
188
|
+
return nil
|
|
189
|
+
}
|
|
190
|
+
}()
|
|
191
|
+
}
|
|
192
|
+
@inline(__always)
|
|
193
|
+
set {
|
|
194
|
+
self.__accessibilityLabel = { () -> bridge.std__optional_std__string_ in
|
|
195
|
+
if let __unwrappedValue = newValue {
|
|
196
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
197
|
+
} else {
|
|
198
|
+
return .init()
|
|
199
|
+
}
|
|
200
|
+
}()
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
174
204
|
var clusteringEnabled: Bool {
|
|
175
205
|
@inline(__always)
|
|
176
206
|
get {
|
|
@@ -192,4 +222,26 @@ public extension MarkerData {
|
|
|
192
222
|
self.__animation = newValue
|
|
193
223
|
}
|
|
194
224
|
}
|
|
225
|
+
|
|
226
|
+
var animationDuration: Double {
|
|
227
|
+
@inline(__always)
|
|
228
|
+
get {
|
|
229
|
+
return self.__animationDuration
|
|
230
|
+
}
|
|
231
|
+
@inline(__always)
|
|
232
|
+
set {
|
|
233
|
+
self.__animationDuration = newValue
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
var animateOnReappear: Bool {
|
|
238
|
+
@inline(__always)
|
|
239
|
+
get {
|
|
240
|
+
return self.__animateOnReappear
|
|
241
|
+
}
|
|
242
|
+
@inline(__always)
|
|
243
|
+
set {
|
|
244
|
+
self.__animateOnReappear = newValue
|
|
245
|
+
}
|
|
246
|
+
}
|
|
195
247
|
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PolygonData.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an instance of `PolygonData`, backed by a C++ struct.
|
|
13
|
+
*/
|
|
14
|
+
public typealias PolygonData = margelo.nitro.nitromap.PolygonData
|
|
15
|
+
|
|
16
|
+
public extension PolygonData {
|
|
17
|
+
private typealias bridge = margelo.nitro.nitromap.bridge.swift
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of `PolygonData`.
|
|
21
|
+
*/
|
|
22
|
+
init(id: String, coordinates: [Coordinate], holes: [[Coordinate]], fillColor: MarkerColor, strokeColor: MarkerColor, strokeWidth: Double, zIndex: Double, tappable: Bool, accessibilityLabel: String?) {
|
|
23
|
+
self.init(std.string(id), { () -> bridge.std__vector_Coordinate_ in
|
|
24
|
+
var __vector = bridge.create_std__vector_Coordinate_(coordinates.count)
|
|
25
|
+
for __item in coordinates {
|
|
26
|
+
__vector.push_back(__item)
|
|
27
|
+
}
|
|
28
|
+
return __vector
|
|
29
|
+
}(), { () -> bridge.std__vector_std__vector_Coordinate__ in
|
|
30
|
+
var __vector = bridge.create_std__vector_std__vector_Coordinate__(holes.count)
|
|
31
|
+
for __item in holes {
|
|
32
|
+
__vector.push_back({ () -> bridge.std__vector_Coordinate_ in
|
|
33
|
+
var __vector = bridge.create_std__vector_Coordinate_(__item.count)
|
|
34
|
+
for __item in __item {
|
|
35
|
+
__vector.push_back(__item)
|
|
36
|
+
}
|
|
37
|
+
return __vector
|
|
38
|
+
}())
|
|
39
|
+
}
|
|
40
|
+
return __vector
|
|
41
|
+
}(), fillColor, strokeColor, strokeWidth, zIndex, tappable, { () -> bridge.std__optional_std__string_ in
|
|
42
|
+
if let __unwrappedValue = accessibilityLabel {
|
|
43
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
44
|
+
} else {
|
|
45
|
+
return .init()
|
|
46
|
+
}
|
|
47
|
+
}())
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var id: String {
|
|
51
|
+
@inline(__always)
|
|
52
|
+
get {
|
|
53
|
+
return String(self.__id)
|
|
54
|
+
}
|
|
55
|
+
@inline(__always)
|
|
56
|
+
set {
|
|
57
|
+
self.__id = std.string(newValue)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var coordinates: [Coordinate] {
|
|
62
|
+
@inline(__always)
|
|
63
|
+
get {
|
|
64
|
+
return self.__coordinates.map({ __item in __item })
|
|
65
|
+
}
|
|
66
|
+
@inline(__always)
|
|
67
|
+
set {
|
|
68
|
+
self.__coordinates = { () -> bridge.std__vector_Coordinate_ in
|
|
69
|
+
var __vector = bridge.create_std__vector_Coordinate_(newValue.count)
|
|
70
|
+
for __item in newValue {
|
|
71
|
+
__vector.push_back(__item)
|
|
72
|
+
}
|
|
73
|
+
return __vector
|
|
74
|
+
}()
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
var holes: [[Coordinate]] {
|
|
79
|
+
@inline(__always)
|
|
80
|
+
get {
|
|
81
|
+
return self.__holes.map({ __item in __item.map({ __item in __item }) })
|
|
82
|
+
}
|
|
83
|
+
@inline(__always)
|
|
84
|
+
set {
|
|
85
|
+
self.__holes = { () -> bridge.std__vector_std__vector_Coordinate__ in
|
|
86
|
+
var __vector = bridge.create_std__vector_std__vector_Coordinate__(newValue.count)
|
|
87
|
+
for __item in newValue {
|
|
88
|
+
__vector.push_back({ () -> bridge.std__vector_Coordinate_ in
|
|
89
|
+
var __vector = bridge.create_std__vector_Coordinate_(__item.count)
|
|
90
|
+
for __item in __item {
|
|
91
|
+
__vector.push_back(__item)
|
|
92
|
+
}
|
|
93
|
+
return __vector
|
|
94
|
+
}())
|
|
95
|
+
}
|
|
96
|
+
return __vector
|
|
97
|
+
}()
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
var fillColor: MarkerColor {
|
|
102
|
+
@inline(__always)
|
|
103
|
+
get {
|
|
104
|
+
return self.__fillColor
|
|
105
|
+
}
|
|
106
|
+
@inline(__always)
|
|
107
|
+
set {
|
|
108
|
+
self.__fillColor = newValue
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
var strokeColor: MarkerColor {
|
|
113
|
+
@inline(__always)
|
|
114
|
+
get {
|
|
115
|
+
return self.__strokeColor
|
|
116
|
+
}
|
|
117
|
+
@inline(__always)
|
|
118
|
+
set {
|
|
119
|
+
self.__strokeColor = newValue
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
var strokeWidth: Double {
|
|
124
|
+
@inline(__always)
|
|
125
|
+
get {
|
|
126
|
+
return self.__strokeWidth
|
|
127
|
+
}
|
|
128
|
+
@inline(__always)
|
|
129
|
+
set {
|
|
130
|
+
self.__strokeWidth = newValue
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
var zIndex: Double {
|
|
135
|
+
@inline(__always)
|
|
136
|
+
get {
|
|
137
|
+
return self.__zIndex
|
|
138
|
+
}
|
|
139
|
+
@inline(__always)
|
|
140
|
+
set {
|
|
141
|
+
self.__zIndex = newValue
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var tappable: Bool {
|
|
146
|
+
@inline(__always)
|
|
147
|
+
get {
|
|
148
|
+
return self.__tappable
|
|
149
|
+
}
|
|
150
|
+
@inline(__always)
|
|
151
|
+
set {
|
|
152
|
+
self.__tappable = newValue
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
var accessibilityLabel: String? {
|
|
157
|
+
@inline(__always)
|
|
158
|
+
get {
|
|
159
|
+
return { () -> String? in
|
|
160
|
+
if bridge.has_value_std__optional_std__string_(self.__accessibilityLabel) {
|
|
161
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__accessibilityLabel)
|
|
162
|
+
return String(__unwrapped)
|
|
163
|
+
} else {
|
|
164
|
+
return nil
|
|
165
|
+
}
|
|
166
|
+
}()
|
|
167
|
+
}
|
|
168
|
+
@inline(__always)
|
|
169
|
+
set {
|
|
170
|
+
self.__accessibilityLabel = { () -> bridge.std__optional_std__string_ in
|
|
171
|
+
if let __unwrappedValue = newValue {
|
|
172
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
173
|
+
} else {
|
|
174
|
+
return .init()
|
|
175
|
+
}
|
|
176
|
+
}()
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PolylineData.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an instance of `PolylineData`, backed by a C++ struct.
|
|
13
|
+
*/
|
|
14
|
+
public typealias PolylineData = margelo.nitro.nitromap.PolylineData
|
|
15
|
+
|
|
16
|
+
public extension PolylineData {
|
|
17
|
+
private typealias bridge = margelo.nitro.nitromap.bridge.swift
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of `PolylineData`.
|
|
21
|
+
*/
|
|
22
|
+
init(id: String, coordinates: [Coordinate], strokeColor: MarkerColor, strokeWidth: Double, geodesic: Bool, dashed: Bool, zIndex: Double, tappable: Bool, accessibilityLabel: String?) {
|
|
23
|
+
self.init(std.string(id), { () -> bridge.std__vector_Coordinate_ in
|
|
24
|
+
var __vector = bridge.create_std__vector_Coordinate_(coordinates.count)
|
|
25
|
+
for __item in coordinates {
|
|
26
|
+
__vector.push_back(__item)
|
|
27
|
+
}
|
|
28
|
+
return __vector
|
|
29
|
+
}(), strokeColor, strokeWidth, geodesic, dashed, zIndex, tappable, { () -> bridge.std__optional_std__string_ in
|
|
30
|
+
if let __unwrappedValue = accessibilityLabel {
|
|
31
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
32
|
+
} else {
|
|
33
|
+
return .init()
|
|
34
|
+
}
|
|
35
|
+
}())
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var id: String {
|
|
39
|
+
@inline(__always)
|
|
40
|
+
get {
|
|
41
|
+
return String(self.__id)
|
|
42
|
+
}
|
|
43
|
+
@inline(__always)
|
|
44
|
+
set {
|
|
45
|
+
self.__id = std.string(newValue)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var coordinates: [Coordinate] {
|
|
50
|
+
@inline(__always)
|
|
51
|
+
get {
|
|
52
|
+
return self.__coordinates.map({ __item in __item })
|
|
53
|
+
}
|
|
54
|
+
@inline(__always)
|
|
55
|
+
set {
|
|
56
|
+
self.__coordinates = { () -> bridge.std__vector_Coordinate_ in
|
|
57
|
+
var __vector = bridge.create_std__vector_Coordinate_(newValue.count)
|
|
58
|
+
for __item in newValue {
|
|
59
|
+
__vector.push_back(__item)
|
|
60
|
+
}
|
|
61
|
+
return __vector
|
|
62
|
+
}()
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var strokeColor: MarkerColor {
|
|
67
|
+
@inline(__always)
|
|
68
|
+
get {
|
|
69
|
+
return self.__strokeColor
|
|
70
|
+
}
|
|
71
|
+
@inline(__always)
|
|
72
|
+
set {
|
|
73
|
+
self.__strokeColor = newValue
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var strokeWidth: Double {
|
|
78
|
+
@inline(__always)
|
|
79
|
+
get {
|
|
80
|
+
return self.__strokeWidth
|
|
81
|
+
}
|
|
82
|
+
@inline(__always)
|
|
83
|
+
set {
|
|
84
|
+
self.__strokeWidth = newValue
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var geodesic: Bool {
|
|
89
|
+
@inline(__always)
|
|
90
|
+
get {
|
|
91
|
+
return self.__geodesic
|
|
92
|
+
}
|
|
93
|
+
@inline(__always)
|
|
94
|
+
set {
|
|
95
|
+
self.__geodesic = newValue
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
var dashed: Bool {
|
|
100
|
+
@inline(__always)
|
|
101
|
+
get {
|
|
102
|
+
return self.__dashed
|
|
103
|
+
}
|
|
104
|
+
@inline(__always)
|
|
105
|
+
set {
|
|
106
|
+
self.__dashed = newValue
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
var zIndex: Double {
|
|
111
|
+
@inline(__always)
|
|
112
|
+
get {
|
|
113
|
+
return self.__zIndex
|
|
114
|
+
}
|
|
115
|
+
@inline(__always)
|
|
116
|
+
set {
|
|
117
|
+
self.__zIndex = newValue
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
var tappable: Bool {
|
|
122
|
+
@inline(__always)
|
|
123
|
+
get {
|
|
124
|
+
return self.__tappable
|
|
125
|
+
}
|
|
126
|
+
@inline(__always)
|
|
127
|
+
set {
|
|
128
|
+
self.__tappable = newValue
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
var accessibilityLabel: String? {
|
|
133
|
+
@inline(__always)
|
|
134
|
+
get {
|
|
135
|
+
return { () -> String? in
|
|
136
|
+
if bridge.has_value_std__optional_std__string_(self.__accessibilityLabel) {
|
|
137
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__accessibilityLabel)
|
|
138
|
+
return String(__unwrapped)
|
|
139
|
+
} else {
|
|
140
|
+
return nil
|
|
141
|
+
}
|
|
142
|
+
}()
|
|
143
|
+
}
|
|
144
|
+
@inline(__always)
|
|
145
|
+
set {
|
|
146
|
+
self.__accessibilityLabel = { () -> bridge.std__optional_std__string_ in
|
|
147
|
+
if let __unwrappedValue = newValue {
|
|
148
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
149
|
+
} else {
|
|
150
|
+
return .init()
|
|
151
|
+
}
|
|
152
|
+
}()
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// UserLocationChangeEvent.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an instance of `UserLocationChangeEvent`, backed by a C++ struct.
|
|
13
|
+
*/
|
|
14
|
+
public typealias UserLocationChangeEvent = margelo.nitro.nitromap.UserLocationChangeEvent
|
|
15
|
+
|
|
16
|
+
public extension UserLocationChangeEvent {
|
|
17
|
+
private typealias bridge = margelo.nitro.nitromap.bridge.swift
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of `UserLocationChangeEvent`.
|
|
21
|
+
*/
|
|
22
|
+
init(coordinate: Coordinate, accuracy: Double, heading: Double, speed: Double) {
|
|
23
|
+
self.init(coordinate, accuracy, heading, speed)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var coordinate: Coordinate {
|
|
27
|
+
@inline(__always)
|
|
28
|
+
get {
|
|
29
|
+
return self.__coordinate
|
|
30
|
+
}
|
|
31
|
+
@inline(__always)
|
|
32
|
+
set {
|
|
33
|
+
self.__coordinate = newValue
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var accuracy: Double {
|
|
38
|
+
@inline(__always)
|
|
39
|
+
get {
|
|
40
|
+
return self.__accuracy
|
|
41
|
+
}
|
|
42
|
+
@inline(__always)
|
|
43
|
+
set {
|
|
44
|
+
self.__accuracy = newValue
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var heading: Double {
|
|
49
|
+
@inline(__always)
|
|
50
|
+
get {
|
|
51
|
+
return self.__heading
|
|
52
|
+
}
|
|
53
|
+
@inline(__always)
|
|
54
|
+
set {
|
|
55
|
+
self.__heading = newValue
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var speed: Double {
|
|
60
|
+
@inline(__always)
|
|
61
|
+
get {
|
|
62
|
+
return self.__speed
|
|
63
|
+
}
|
|
64
|
+
@inline(__always)
|
|
65
|
+
set {
|
|
66
|
+
self.__speed = newValue
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// UserTrackingMode.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS union `UserTrackingMode`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias UserTrackingMode = margelo.nitro.nitromap.UserTrackingMode
|
|
12
|
+
|
|
13
|
+
public extension UserTrackingMode {
|
|
14
|
+
/**
|
|
15
|
+
* Get a UserTrackingMode for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "none":
|
|
21
|
+
self = .none
|
|
22
|
+
case "follow":
|
|
23
|
+
self = .follow
|
|
24
|
+
case "followWithHeading":
|
|
25
|
+
self = .followwithheading
|
|
26
|
+
default:
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the String value this UserTrackingMode represents.
|
|
33
|
+
*/
|
|
34
|
+
var stringValue: String {
|
|
35
|
+
switch self {
|
|
36
|
+
case .none:
|
|
37
|
+
return "none"
|
|
38
|
+
case .follow:
|
|
39
|
+
return "follow"
|
|
40
|
+
case .followwithheading:
|
|
41
|
+
return "followWithHeading"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CircleData.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 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
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `Coordinate` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::nitromap { struct Coordinate; }
|
|
28
|
+
// Forward declaration of `MarkerColor` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::nitromap { struct MarkerColor; }
|
|
30
|
+
|
|
31
|
+
#include <string>
|
|
32
|
+
#include "Coordinate.hpp"
|
|
33
|
+
#include "MarkerColor.hpp"
|
|
34
|
+
#include <optional>
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::nitromap {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (CircleData).
|
|
40
|
+
*/
|
|
41
|
+
struct CircleData {
|
|
42
|
+
public:
|
|
43
|
+
std::string id SWIFT_PRIVATE;
|
|
44
|
+
Coordinate center SWIFT_PRIVATE;
|
|
45
|
+
double radius SWIFT_PRIVATE;
|
|
46
|
+
MarkerColor fillColor SWIFT_PRIVATE;
|
|
47
|
+
MarkerColor strokeColor SWIFT_PRIVATE;
|
|
48
|
+
double strokeWidth SWIFT_PRIVATE;
|
|
49
|
+
double zIndex SWIFT_PRIVATE;
|
|
50
|
+
bool tappable SWIFT_PRIVATE;
|
|
51
|
+
std::optional<std::string> accessibilityLabel SWIFT_PRIVATE;
|
|
52
|
+
|
|
53
|
+
public:
|
|
54
|
+
CircleData() = default;
|
|
55
|
+
explicit CircleData(std::string id, Coordinate center, double radius, MarkerColor fillColor, MarkerColor strokeColor, double strokeWidth, double zIndex, bool tappable, std::optional<std::string> accessibilityLabel): id(id), center(center), radius(radius), fillColor(fillColor), strokeColor(strokeColor), strokeWidth(strokeWidth), zIndex(zIndex), tappable(tappable), accessibilityLabel(accessibilityLabel) {}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro::nitromap
|
|
59
|
+
|
|
60
|
+
namespace margelo::nitro {
|
|
61
|
+
|
|
62
|
+
// C++ CircleData <> JS CircleData (object)
|
|
63
|
+
template <>
|
|
64
|
+
struct JSIConverter<margelo::nitro::nitromap::CircleData> final {
|
|
65
|
+
static inline margelo::nitro::nitromap::CircleData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
67
|
+
return margelo::nitro::nitromap::CircleData(
|
|
68
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
69
|
+
JSIConverter<margelo::nitro::nitromap::Coordinate>::fromJSI(runtime, obj.getProperty(runtime, "center")),
|
|
70
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "radius")),
|
|
71
|
+
JSIConverter<margelo::nitro::nitromap::MarkerColor>::fromJSI(runtime, obj.getProperty(runtime, "fillColor")),
|
|
72
|
+
JSIConverter<margelo::nitro::nitromap::MarkerColor>::fromJSI(runtime, obj.getProperty(runtime, "strokeColor")),
|
|
73
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "strokeWidth")),
|
|
74
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
75
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "tappable")),
|
|
76
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "accessibilityLabel"))
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::CircleData& arg) {
|
|
80
|
+
jsi::Object obj(runtime);
|
|
81
|
+
obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
82
|
+
obj.setProperty(runtime, "center", JSIConverter<margelo::nitro::nitromap::Coordinate>::toJSI(runtime, arg.center));
|
|
83
|
+
obj.setProperty(runtime, "radius", JSIConverter<double>::toJSI(runtime, arg.radius));
|
|
84
|
+
obj.setProperty(runtime, "fillColor", JSIConverter<margelo::nitro::nitromap::MarkerColor>::toJSI(runtime, arg.fillColor));
|
|
85
|
+
obj.setProperty(runtime, "strokeColor", JSIConverter<margelo::nitro::nitromap::MarkerColor>::toJSI(runtime, arg.strokeColor));
|
|
86
|
+
obj.setProperty(runtime, "strokeWidth", JSIConverter<double>::toJSI(runtime, arg.strokeWidth));
|
|
87
|
+
obj.setProperty(runtime, "zIndex", JSIConverter<double>::toJSI(runtime, arg.zIndex));
|
|
88
|
+
obj.setProperty(runtime, "tappable", JSIConverter<bool>::toJSI(runtime, arg.tappable));
|
|
89
|
+
obj.setProperty(runtime, "accessibilityLabel", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accessibilityLabel));
|
|
90
|
+
return obj;
|
|
91
|
+
}
|
|
92
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
93
|
+
if (!value.isObject()) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
jsi::Object obj = value.getObject(runtime);
|
|
97
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
101
|
+
if (!JSIConverter<margelo::nitro::nitromap::Coordinate>::canConvert(runtime, obj.getProperty(runtime, "center"))) return false;
|
|
102
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "radius"))) return false;
|
|
103
|
+
if (!JSIConverter<margelo::nitro::nitromap::MarkerColor>::canConvert(runtime, obj.getProperty(runtime, "fillColor"))) return false;
|
|
104
|
+
if (!JSIConverter<margelo::nitro::nitromap::MarkerColor>::canConvert(runtime, obj.getProperty(runtime, "strokeColor"))) return false;
|
|
105
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "strokeWidth"))) return false;
|
|
106
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
107
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "tappable"))) return false;
|
|
108
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "accessibilityLabel"))) return false;
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
} // namespace margelo::nitro
|