react-native-google-maps-plus 1.3.0-dev.8 → 1.3.0-dev.9
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 +24 -78
- package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +38 -36
- package/android/src/main/java/com/rngooglemapsplus/extensions/LocationExtension.kt +59 -0
- package/ios/GoogleMapViewImpl.swift +17 -63
- package/ios/MapMarkerBuilder.swift +2 -2
- package/ios/RNGoogleMapsPlusView.swift +6 -0
- package/ios/extensions/CLLocation+Extension.swift +27 -0
- package/lib/module/GoogleMapsPlus.js +7 -0
- package/lib/module/GoogleMapsPlus.js.map +1 -0
- package/lib/module/index.js +3 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +44 -0
- package/lib/typescript/src/GoogleMapsPlus.d.ts +5 -0
- package/lib/typescript/src/GoogleMapsPlus.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +25 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_RNLocation.hpp +6 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +8 -0
- package/nitrogen/generated/android/c++/JRNLocation.hpp +32 -2
- package/nitrogen/generated/android/c++/JRNLocationAndroid.hpp +82 -0
- package/nitrogen/generated/android/c++/JRNLocationIOS.hpp +77 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocation.kt +19 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationAndroid.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationIOS.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/views/HybridRNGoogleMapsPlusViewManager.kt +7 -2
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +36 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +6 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +6 -0
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +8 -0
- package/nitrogen/generated/ios/swift/RNLocation.swift +92 -2
- package/nitrogen/generated/ios/swift/RNLocationAndroid.swift +215 -0
- package/nitrogen/generated/ios/swift/RNLocationIOS.swift +185 -0
- package/nitrogen/generated/shared/c++/RNLocation.hpp +33 -2
- package/nitrogen/generated/shared/c++/RNLocationAndroid.hpp +104 -0
- package/nitrogen/generated/shared/c++/RNLocationIOS.hpp +99 -0
- package/package.json +6 -13
- package/src/GoogleMapsPlus.tsx +20 -0
- package/src/index.tsx +6 -14
- package/src/types.ts +27 -0
- package/lib/module/package.json +0 -1
- package/lib/typescript/package.json +0 -1
|
@@ -18,8 +18,20 @@ public extension RNLocation {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `RNLocation`.
|
|
20
20
|
*/
|
|
21
|
-
init(center: RNLatLng, bearing: Double) {
|
|
22
|
-
self.init(center, bearing)
|
|
21
|
+
init(center: RNLatLng, altitude: Double, accuracy: Double, bearing: Double, speed: Double, time: Double, android: RNLocationAndroid?, ios: RNLocationIOS?) {
|
|
22
|
+
self.init(center, altitude, accuracy, bearing, speed, time, { () -> bridge.std__optional_RNLocationAndroid_ in
|
|
23
|
+
if let __unwrappedValue = android {
|
|
24
|
+
return bridge.create_std__optional_RNLocationAndroid_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_RNLocationIOS_ in
|
|
29
|
+
if let __unwrappedValue = ios {
|
|
30
|
+
return bridge.create_std__optional_RNLocationIOS_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}())
|
|
23
35
|
}
|
|
24
36
|
|
|
25
37
|
var center: RNLatLng {
|
|
@@ -33,6 +45,28 @@ public extension RNLocation {
|
|
|
33
45
|
}
|
|
34
46
|
}
|
|
35
47
|
|
|
48
|
+
var altitude: Double {
|
|
49
|
+
@inline(__always)
|
|
50
|
+
get {
|
|
51
|
+
return self.__altitude
|
|
52
|
+
}
|
|
53
|
+
@inline(__always)
|
|
54
|
+
set {
|
|
55
|
+
self.__altitude = newValue
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var accuracy: Double {
|
|
60
|
+
@inline(__always)
|
|
61
|
+
get {
|
|
62
|
+
return self.__accuracy
|
|
63
|
+
}
|
|
64
|
+
@inline(__always)
|
|
65
|
+
set {
|
|
66
|
+
self.__accuracy = newValue
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
36
70
|
var bearing: Double {
|
|
37
71
|
@inline(__always)
|
|
38
72
|
get {
|
|
@@ -43,4 +77,60 @@ public extension RNLocation {
|
|
|
43
77
|
self.__bearing = newValue
|
|
44
78
|
}
|
|
45
79
|
}
|
|
80
|
+
|
|
81
|
+
var speed: Double {
|
|
82
|
+
@inline(__always)
|
|
83
|
+
get {
|
|
84
|
+
return self.__speed
|
|
85
|
+
}
|
|
86
|
+
@inline(__always)
|
|
87
|
+
set {
|
|
88
|
+
self.__speed = newValue
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
var time: Double {
|
|
93
|
+
@inline(__always)
|
|
94
|
+
get {
|
|
95
|
+
return self.__time
|
|
96
|
+
}
|
|
97
|
+
@inline(__always)
|
|
98
|
+
set {
|
|
99
|
+
self.__time = newValue
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
var android: RNLocationAndroid? {
|
|
104
|
+
@inline(__always)
|
|
105
|
+
get {
|
|
106
|
+
return self.__android.value
|
|
107
|
+
}
|
|
108
|
+
@inline(__always)
|
|
109
|
+
set {
|
|
110
|
+
self.__android = { () -> bridge.std__optional_RNLocationAndroid_ in
|
|
111
|
+
if let __unwrappedValue = newValue {
|
|
112
|
+
return bridge.create_std__optional_RNLocationAndroid_(__unwrappedValue)
|
|
113
|
+
} else {
|
|
114
|
+
return .init()
|
|
115
|
+
}
|
|
116
|
+
}()
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
var ios: RNLocationIOS? {
|
|
121
|
+
@inline(__always)
|
|
122
|
+
get {
|
|
123
|
+
return self.__ios.value
|
|
124
|
+
}
|
|
125
|
+
@inline(__always)
|
|
126
|
+
set {
|
|
127
|
+
self.__ios = { () -> bridge.std__optional_RNLocationIOS_ in
|
|
128
|
+
if let __unwrappedValue = newValue {
|
|
129
|
+
return bridge.create_std__optional_RNLocationIOS_(__unwrappedValue)
|
|
130
|
+
} else {
|
|
131
|
+
return .init()
|
|
132
|
+
}
|
|
133
|
+
}()
|
|
134
|
+
}
|
|
135
|
+
}
|
|
46
136
|
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNLocationAndroid.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 `RNLocationAndroid`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNLocationAndroid = margelo.nitro.rngooglemapsplus.RNLocationAndroid
|
|
14
|
+
|
|
15
|
+
public extension RNLocationAndroid {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNLocationAndroid`.
|
|
20
|
+
*/
|
|
21
|
+
init(provider: String?, elapsedRealtimeNanos: Double?, bearingAccuracyDegrees: Double?, speedAccuracyMetersPerSecond: Double?, verticalAccuracyMeters: Double?, mslAltitudeMeters: Double?, mslAltitudeAccuracyMeters: Double?, isMock: Bool?) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_std__string_ in
|
|
23
|
+
if let __unwrappedValue = provider {
|
|
24
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
29
|
+
if let __unwrappedValue = elapsedRealtimeNanos {
|
|
30
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
35
|
+
if let __unwrappedValue = bearingAccuracyDegrees {
|
|
36
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
41
|
+
if let __unwrappedValue = speedAccuracyMetersPerSecond {
|
|
42
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
47
|
+
if let __unwrappedValue = verticalAccuracyMeters {
|
|
48
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
49
|
+
} else {
|
|
50
|
+
return .init()
|
|
51
|
+
}
|
|
52
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
53
|
+
if let __unwrappedValue = mslAltitudeMeters {
|
|
54
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
58
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
59
|
+
if let __unwrappedValue = mslAltitudeAccuracyMeters {
|
|
60
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
61
|
+
} else {
|
|
62
|
+
return .init()
|
|
63
|
+
}
|
|
64
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
65
|
+
if let __unwrappedValue = isMock {
|
|
66
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
67
|
+
} else {
|
|
68
|
+
return .init()
|
|
69
|
+
}
|
|
70
|
+
}())
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
var provider: String? {
|
|
74
|
+
@inline(__always)
|
|
75
|
+
get {
|
|
76
|
+
return { () -> String? in
|
|
77
|
+
if bridge.has_value_std__optional_std__string_(self.__provider) {
|
|
78
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__provider)
|
|
79
|
+
return String(__unwrapped)
|
|
80
|
+
} else {
|
|
81
|
+
return nil
|
|
82
|
+
}
|
|
83
|
+
}()
|
|
84
|
+
}
|
|
85
|
+
@inline(__always)
|
|
86
|
+
set {
|
|
87
|
+
self.__provider = { () -> bridge.std__optional_std__string_ in
|
|
88
|
+
if let __unwrappedValue = newValue {
|
|
89
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
90
|
+
} else {
|
|
91
|
+
return .init()
|
|
92
|
+
}
|
|
93
|
+
}()
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var elapsedRealtimeNanos: Double? {
|
|
98
|
+
@inline(__always)
|
|
99
|
+
get {
|
|
100
|
+
return self.__elapsedRealtimeNanos.value
|
|
101
|
+
}
|
|
102
|
+
@inline(__always)
|
|
103
|
+
set {
|
|
104
|
+
self.__elapsedRealtimeNanos = { () -> bridge.std__optional_double_ in
|
|
105
|
+
if let __unwrappedValue = newValue {
|
|
106
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
107
|
+
} else {
|
|
108
|
+
return .init()
|
|
109
|
+
}
|
|
110
|
+
}()
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
var bearingAccuracyDegrees: Double? {
|
|
115
|
+
@inline(__always)
|
|
116
|
+
get {
|
|
117
|
+
return self.__bearingAccuracyDegrees.value
|
|
118
|
+
}
|
|
119
|
+
@inline(__always)
|
|
120
|
+
set {
|
|
121
|
+
self.__bearingAccuracyDegrees = { () -> bridge.std__optional_double_ in
|
|
122
|
+
if let __unwrappedValue = newValue {
|
|
123
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
124
|
+
} else {
|
|
125
|
+
return .init()
|
|
126
|
+
}
|
|
127
|
+
}()
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
var speedAccuracyMetersPerSecond: Double? {
|
|
132
|
+
@inline(__always)
|
|
133
|
+
get {
|
|
134
|
+
return self.__speedAccuracyMetersPerSecond.value
|
|
135
|
+
}
|
|
136
|
+
@inline(__always)
|
|
137
|
+
set {
|
|
138
|
+
self.__speedAccuracyMetersPerSecond = { () -> bridge.std__optional_double_ in
|
|
139
|
+
if let __unwrappedValue = newValue {
|
|
140
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
141
|
+
} else {
|
|
142
|
+
return .init()
|
|
143
|
+
}
|
|
144
|
+
}()
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
var verticalAccuracyMeters: Double? {
|
|
149
|
+
@inline(__always)
|
|
150
|
+
get {
|
|
151
|
+
return self.__verticalAccuracyMeters.value
|
|
152
|
+
}
|
|
153
|
+
@inline(__always)
|
|
154
|
+
set {
|
|
155
|
+
self.__verticalAccuracyMeters = { () -> bridge.std__optional_double_ in
|
|
156
|
+
if let __unwrappedValue = newValue {
|
|
157
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
158
|
+
} else {
|
|
159
|
+
return .init()
|
|
160
|
+
}
|
|
161
|
+
}()
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
var mslAltitudeMeters: Double? {
|
|
166
|
+
@inline(__always)
|
|
167
|
+
get {
|
|
168
|
+
return self.__mslAltitudeMeters.value
|
|
169
|
+
}
|
|
170
|
+
@inline(__always)
|
|
171
|
+
set {
|
|
172
|
+
self.__mslAltitudeMeters = { () -> bridge.std__optional_double_ in
|
|
173
|
+
if let __unwrappedValue = newValue {
|
|
174
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
175
|
+
} else {
|
|
176
|
+
return .init()
|
|
177
|
+
}
|
|
178
|
+
}()
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
var mslAltitudeAccuracyMeters: Double? {
|
|
183
|
+
@inline(__always)
|
|
184
|
+
get {
|
|
185
|
+
return self.__mslAltitudeAccuracyMeters.value
|
|
186
|
+
}
|
|
187
|
+
@inline(__always)
|
|
188
|
+
set {
|
|
189
|
+
self.__mslAltitudeAccuracyMeters = { () -> bridge.std__optional_double_ in
|
|
190
|
+
if let __unwrappedValue = newValue {
|
|
191
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
192
|
+
} else {
|
|
193
|
+
return .init()
|
|
194
|
+
}
|
|
195
|
+
}()
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
var isMock: Bool? {
|
|
200
|
+
@inline(__always)
|
|
201
|
+
get {
|
|
202
|
+
return self.__isMock.value
|
|
203
|
+
}
|
|
204
|
+
@inline(__always)
|
|
205
|
+
set {
|
|
206
|
+
self.__isMock = { () -> bridge.std__optional_bool_ in
|
|
207
|
+
if let __unwrappedValue = newValue {
|
|
208
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
209
|
+
} else {
|
|
210
|
+
return .init()
|
|
211
|
+
}
|
|
212
|
+
}()
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNLocationIOS.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 `RNLocationIOS`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNLocationIOS = margelo.nitro.rngooglemapsplus.RNLocationIOS
|
|
14
|
+
|
|
15
|
+
public extension RNLocationIOS {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNLocationIOS`.
|
|
20
|
+
*/
|
|
21
|
+
init(horizontalAccuracy: Double?, verticalAccuracy: Double?, speedAccuracy: Double?, courseAccuracy: Double?, floor: Double?, isFromMockProvider: Bool?, timestamp: Double?) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_double_ in
|
|
23
|
+
if let __unwrappedValue = horizontalAccuracy {
|
|
24
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
29
|
+
if let __unwrappedValue = verticalAccuracy {
|
|
30
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
35
|
+
if let __unwrappedValue = speedAccuracy {
|
|
36
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
41
|
+
if let __unwrappedValue = courseAccuracy {
|
|
42
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
47
|
+
if let __unwrappedValue = floor {
|
|
48
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
49
|
+
} else {
|
|
50
|
+
return .init()
|
|
51
|
+
}
|
|
52
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
53
|
+
if let __unwrappedValue = isFromMockProvider {
|
|
54
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
58
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
59
|
+
if let __unwrappedValue = timestamp {
|
|
60
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
61
|
+
} else {
|
|
62
|
+
return .init()
|
|
63
|
+
}
|
|
64
|
+
}())
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
var horizontalAccuracy: Double? {
|
|
68
|
+
@inline(__always)
|
|
69
|
+
get {
|
|
70
|
+
return self.__horizontalAccuracy.value
|
|
71
|
+
}
|
|
72
|
+
@inline(__always)
|
|
73
|
+
set {
|
|
74
|
+
self.__horizontalAccuracy = { () -> bridge.std__optional_double_ in
|
|
75
|
+
if let __unwrappedValue = newValue {
|
|
76
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
77
|
+
} else {
|
|
78
|
+
return .init()
|
|
79
|
+
}
|
|
80
|
+
}()
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
var verticalAccuracy: Double? {
|
|
85
|
+
@inline(__always)
|
|
86
|
+
get {
|
|
87
|
+
return self.__verticalAccuracy.value
|
|
88
|
+
}
|
|
89
|
+
@inline(__always)
|
|
90
|
+
set {
|
|
91
|
+
self.__verticalAccuracy = { () -> bridge.std__optional_double_ in
|
|
92
|
+
if let __unwrappedValue = newValue {
|
|
93
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
94
|
+
} else {
|
|
95
|
+
return .init()
|
|
96
|
+
}
|
|
97
|
+
}()
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
var speedAccuracy: Double? {
|
|
102
|
+
@inline(__always)
|
|
103
|
+
get {
|
|
104
|
+
return self.__speedAccuracy.value
|
|
105
|
+
}
|
|
106
|
+
@inline(__always)
|
|
107
|
+
set {
|
|
108
|
+
self.__speedAccuracy = { () -> bridge.std__optional_double_ in
|
|
109
|
+
if let __unwrappedValue = newValue {
|
|
110
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
111
|
+
} else {
|
|
112
|
+
return .init()
|
|
113
|
+
}
|
|
114
|
+
}()
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
var courseAccuracy: Double? {
|
|
119
|
+
@inline(__always)
|
|
120
|
+
get {
|
|
121
|
+
return self.__courseAccuracy.value
|
|
122
|
+
}
|
|
123
|
+
@inline(__always)
|
|
124
|
+
set {
|
|
125
|
+
self.__courseAccuracy = { () -> bridge.std__optional_double_ in
|
|
126
|
+
if let __unwrappedValue = newValue {
|
|
127
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
128
|
+
} else {
|
|
129
|
+
return .init()
|
|
130
|
+
}
|
|
131
|
+
}()
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
var floor: Double? {
|
|
136
|
+
@inline(__always)
|
|
137
|
+
get {
|
|
138
|
+
return self.__floor.value
|
|
139
|
+
}
|
|
140
|
+
@inline(__always)
|
|
141
|
+
set {
|
|
142
|
+
self.__floor = { () -> bridge.std__optional_double_ in
|
|
143
|
+
if let __unwrappedValue = newValue {
|
|
144
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
145
|
+
} else {
|
|
146
|
+
return .init()
|
|
147
|
+
}
|
|
148
|
+
}()
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
var isFromMockProvider: Bool? {
|
|
153
|
+
@inline(__always)
|
|
154
|
+
get {
|
|
155
|
+
return self.__isFromMockProvider.value
|
|
156
|
+
}
|
|
157
|
+
@inline(__always)
|
|
158
|
+
set {
|
|
159
|
+
self.__isFromMockProvider = { () -> bridge.std__optional_bool_ in
|
|
160
|
+
if let __unwrappedValue = newValue {
|
|
161
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
162
|
+
} else {
|
|
163
|
+
return .init()
|
|
164
|
+
}
|
|
165
|
+
}()
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
var timestamp: Double? {
|
|
170
|
+
@inline(__always)
|
|
171
|
+
get {
|
|
172
|
+
return self.__timestamp.value
|
|
173
|
+
}
|
|
174
|
+
@inline(__always)
|
|
175
|
+
set {
|
|
176
|
+
self.__timestamp = { () -> bridge.std__optional_double_ in
|
|
177
|
+
if let __unwrappedValue = newValue {
|
|
178
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
179
|
+
} else {
|
|
180
|
+
return .init()
|
|
181
|
+
}
|
|
182
|
+
}()
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
@@ -25,8 +25,15 @@
|
|
|
25
25
|
|
|
26
26
|
// Forward declaration of `RNLatLng` to properly resolve imports.
|
|
27
27
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
28
|
+
// Forward declaration of `RNLocationAndroid` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLocationAndroid; }
|
|
30
|
+
// Forward declaration of `RNLocationIOS` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLocationIOS; }
|
|
28
32
|
|
|
29
33
|
#include "RNLatLng.hpp"
|
|
34
|
+
#include "RNLocationAndroid.hpp"
|
|
35
|
+
#include <optional>
|
|
36
|
+
#include "RNLocationIOS.hpp"
|
|
30
37
|
|
|
31
38
|
namespace margelo::nitro::rngooglemapsplus {
|
|
32
39
|
|
|
@@ -36,11 +43,17 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
36
43
|
struct RNLocation {
|
|
37
44
|
public:
|
|
38
45
|
RNLatLng center SWIFT_PRIVATE;
|
|
46
|
+
double altitude SWIFT_PRIVATE;
|
|
47
|
+
double accuracy SWIFT_PRIVATE;
|
|
39
48
|
double bearing SWIFT_PRIVATE;
|
|
49
|
+
double speed SWIFT_PRIVATE;
|
|
50
|
+
double time SWIFT_PRIVATE;
|
|
51
|
+
std::optional<RNLocationAndroid> android SWIFT_PRIVATE;
|
|
52
|
+
std::optional<RNLocationIOS> ios SWIFT_PRIVATE;
|
|
40
53
|
|
|
41
54
|
public:
|
|
42
55
|
RNLocation() = default;
|
|
43
|
-
explicit RNLocation(RNLatLng center, double bearing): center(center), bearing(bearing) {}
|
|
56
|
+
explicit RNLocation(RNLatLng center, double altitude, double accuracy, double bearing, double speed, double time, std::optional<RNLocationAndroid> android, std::optional<RNLocationIOS> ios): center(center), altitude(altitude), accuracy(accuracy), bearing(bearing), speed(speed), time(time), android(android), ios(ios) {}
|
|
44
57
|
};
|
|
45
58
|
|
|
46
59
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -54,13 +67,25 @@ namespace margelo::nitro {
|
|
|
54
67
|
jsi::Object obj = arg.asObject(runtime);
|
|
55
68
|
return margelo::nitro::rngooglemapsplus::RNLocation(
|
|
56
69
|
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "center")),
|
|
57
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
70
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "altitude")),
|
|
71
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "accuracy")),
|
|
72
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "bearing")),
|
|
73
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "speed")),
|
|
74
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "time")),
|
|
75
|
+
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationAndroid>>::fromJSI(runtime, obj.getProperty(runtime, "android")),
|
|
76
|
+
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationIOS>>::fromJSI(runtime, obj.getProperty(runtime, "ios"))
|
|
58
77
|
);
|
|
59
78
|
}
|
|
60
79
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNLocation& arg) {
|
|
61
80
|
jsi::Object obj(runtime);
|
|
62
81
|
obj.setProperty(runtime, "center", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.center));
|
|
82
|
+
obj.setProperty(runtime, "altitude", JSIConverter<double>::toJSI(runtime, arg.altitude));
|
|
83
|
+
obj.setProperty(runtime, "accuracy", JSIConverter<double>::toJSI(runtime, arg.accuracy));
|
|
63
84
|
obj.setProperty(runtime, "bearing", JSIConverter<double>::toJSI(runtime, arg.bearing));
|
|
85
|
+
obj.setProperty(runtime, "speed", JSIConverter<double>::toJSI(runtime, arg.speed));
|
|
86
|
+
obj.setProperty(runtime, "time", JSIConverter<double>::toJSI(runtime, arg.time));
|
|
87
|
+
obj.setProperty(runtime, "android", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationAndroid>>::toJSI(runtime, arg.android));
|
|
88
|
+
obj.setProperty(runtime, "ios", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationIOS>>::toJSI(runtime, arg.ios));
|
|
64
89
|
return obj;
|
|
65
90
|
}
|
|
66
91
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -72,7 +97,13 @@ namespace margelo::nitro {
|
|
|
72
97
|
return false;
|
|
73
98
|
}
|
|
74
99
|
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "center"))) return false;
|
|
100
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "altitude"))) return false;
|
|
101
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "accuracy"))) return false;
|
|
75
102
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "bearing"))) return false;
|
|
103
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "speed"))) return false;
|
|
104
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "time"))) return false;
|
|
105
|
+
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationAndroid>>::canConvert(runtime, obj.getProperty(runtime, "android"))) return false;
|
|
106
|
+
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLocationIOS>>::canConvert(runtime, obj.getProperty(runtime, "ios"))) return false;
|
|
76
107
|
return true;
|
|
77
108
|
}
|
|
78
109
|
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNLocationAndroid.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
|
+
#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
|
+
|
|
27
|
+
|
|
28
|
+
#include <string>
|
|
29
|
+
#include <optional>
|
|
30
|
+
|
|
31
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A struct which can be represented as a JavaScript object (RNLocationAndroid).
|
|
35
|
+
*/
|
|
36
|
+
struct RNLocationAndroid {
|
|
37
|
+
public:
|
|
38
|
+
std::optional<std::string> provider SWIFT_PRIVATE;
|
|
39
|
+
std::optional<double> elapsedRealtimeNanos SWIFT_PRIVATE;
|
|
40
|
+
std::optional<double> bearingAccuracyDegrees SWIFT_PRIVATE;
|
|
41
|
+
std::optional<double> speedAccuracyMetersPerSecond SWIFT_PRIVATE;
|
|
42
|
+
std::optional<double> verticalAccuracyMeters SWIFT_PRIVATE;
|
|
43
|
+
std::optional<double> mslAltitudeMeters SWIFT_PRIVATE;
|
|
44
|
+
std::optional<double> mslAltitudeAccuracyMeters SWIFT_PRIVATE;
|
|
45
|
+
std::optional<bool> isMock SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
RNLocationAndroid() = default;
|
|
49
|
+
explicit RNLocationAndroid(std::optional<std::string> provider, std::optional<double> elapsedRealtimeNanos, std::optional<double> bearingAccuracyDegrees, std::optional<double> speedAccuracyMetersPerSecond, std::optional<double> verticalAccuracyMeters, std::optional<double> mslAltitudeMeters, std::optional<double> mslAltitudeAccuracyMeters, std::optional<bool> isMock): provider(provider), elapsedRealtimeNanos(elapsedRealtimeNanos), bearingAccuracyDegrees(bearingAccuracyDegrees), speedAccuracyMetersPerSecond(speedAccuracyMetersPerSecond), verticalAccuracyMeters(verticalAccuracyMeters), mslAltitudeMeters(mslAltitudeMeters), mslAltitudeAccuracyMeters(mslAltitudeAccuracyMeters), isMock(isMock) {}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
53
|
+
|
|
54
|
+
namespace margelo::nitro {
|
|
55
|
+
|
|
56
|
+
// C++ RNLocationAndroid <> JS RNLocationAndroid (object)
|
|
57
|
+
template <>
|
|
58
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNLocationAndroid> final {
|
|
59
|
+
static inline margelo::nitro::rngooglemapsplus::RNLocationAndroid fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
60
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
61
|
+
return margelo::nitro::rngooglemapsplus::RNLocationAndroid(
|
|
62
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "provider")),
|
|
63
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "elapsedRealtimeNanos")),
|
|
64
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "bearingAccuracyDegrees")),
|
|
65
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "speedAccuracyMetersPerSecond")),
|
|
66
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "verticalAccuracyMeters")),
|
|
67
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "mslAltitudeMeters")),
|
|
68
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "mslAltitudeAccuracyMeters")),
|
|
69
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isMock"))
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNLocationAndroid& arg) {
|
|
73
|
+
jsi::Object obj(runtime);
|
|
74
|
+
obj.setProperty(runtime, "provider", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.provider));
|
|
75
|
+
obj.setProperty(runtime, "elapsedRealtimeNanos", JSIConverter<std::optional<double>>::toJSI(runtime, arg.elapsedRealtimeNanos));
|
|
76
|
+
obj.setProperty(runtime, "bearingAccuracyDegrees", JSIConverter<std::optional<double>>::toJSI(runtime, arg.bearingAccuracyDegrees));
|
|
77
|
+
obj.setProperty(runtime, "speedAccuracyMetersPerSecond", JSIConverter<std::optional<double>>::toJSI(runtime, arg.speedAccuracyMetersPerSecond));
|
|
78
|
+
obj.setProperty(runtime, "verticalAccuracyMeters", JSIConverter<std::optional<double>>::toJSI(runtime, arg.verticalAccuracyMeters));
|
|
79
|
+
obj.setProperty(runtime, "mslAltitudeMeters", JSIConverter<std::optional<double>>::toJSI(runtime, arg.mslAltitudeMeters));
|
|
80
|
+
obj.setProperty(runtime, "mslAltitudeAccuracyMeters", JSIConverter<std::optional<double>>::toJSI(runtime, arg.mslAltitudeAccuracyMeters));
|
|
81
|
+
obj.setProperty(runtime, "isMock", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.isMock));
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
85
|
+
if (!value.isObject()) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
jsi::Object obj = value.getObject(runtime);
|
|
89
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "provider"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "elapsedRealtimeNanos"))) return false;
|
|
94
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "bearingAccuracyDegrees"))) return false;
|
|
95
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "speedAccuracyMetersPerSecond"))) return false;
|
|
96
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "verticalAccuracyMeters"))) return false;
|
|
97
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "mslAltitudeMeters"))) return false;
|
|
98
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "mslAltitudeAccuracyMeters"))) return false;
|
|
99
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isMock"))) return false;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
} // namespace margelo::nitro
|