react-native-google-maps-plus 1.3.0-dev.2 → 1.3.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +92 -8
- package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +0 -1
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +52 -9
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNLatLngBoundsExtension.kt +17 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNSize.kt +7 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNSnapshotFormat.kt +16 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNSnapshotResultType.kt +9 -0
- package/ios/GoogleMapViewImpl.swift +285 -145
- package/ios/RNGoogleMapsPlusView.swift +86 -38
- package/ios/extensions/RNLatLngBounds+Extension.swift +16 -0
- package/ios/extensions/RNSize+Extension.swift +7 -0
- package/ios/extensions/RNSnapshotFormat+Extension.swift +28 -0
- package/ios/extensions/RNSnapshotResultType+Extension.swift +12 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +6 -3
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +13 -1
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +51 -7
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +5 -2
- package/nitrogen/generated/android/c++/JRNLatLngBounds.hpp +58 -0
- package/nitrogen/generated/android/c++/JRNSize.hpp +57 -0
- package/nitrogen/generated/android/c++/JRNSnapshotFormat.hpp +62 -0
- package/nitrogen/generated/android/c++/JRNSnapshotOptions.hpp +71 -0
- package/nitrogen/generated/android/c++/JRNSnapshotResultType.hpp +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +14 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLatLngBounds.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSize.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSnapshotFormat.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSnapshotOptions.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSnapshotResultType.kt +21 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +57 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +15 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +40 -5
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +7 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +5 -2
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +58 -4
- package/nitrogen/generated/ios/swift/RNLatLngBounds.swift +46 -0
- package/nitrogen/generated/ios/swift/RNSize.swift +46 -0
- package/nitrogen/generated/ios/swift/RNSnapshotFormat.swift +44 -0
- package/nitrogen/generated/ios/swift/RNSnapshotOptions.swift +87 -0
- package/nitrogen/generated/ios/swift/RNSnapshotResultType.swift +40 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +3 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +12 -3
- package/nitrogen/generated/shared/c++/RNLatLngBounds.hpp +72 -0
- package/nitrogen/generated/shared/c++/RNSize.hpp +71 -0
- package/nitrogen/generated/shared/c++/RNSnapshotFormat.hpp +80 -0
- package/nitrogen/generated/shared/c++/RNSnapshotOptions.hpp +87 -0
- package/nitrogen/generated/shared/c++/RNSnapshotResultType.hpp +76 -0
- package/package.json +1 -1
- package/src/RNGoogleMapsPlusView.nitro.ts +15 -2
- package/src/types.ts +24 -2
|
@@ -1120,9 +1120,9 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
1120
1120
|
|
|
1121
1121
|
// Methods
|
|
1122
1122
|
@inline(__always)
|
|
1123
|
-
public final func setCamera(camera: RNCamera, animated: bridge.std__optional_bool_,
|
|
1123
|
+
public final func setCamera(camera: RNCamera, animated: bridge.std__optional_bool_, durationMs: bridge.std__optional_double_) -> bridge.Result_void_ {
|
|
1124
1124
|
do {
|
|
1125
|
-
try self.__implementation.setCamera(camera: camera, animated: animated.value,
|
|
1125
|
+
try self.__implementation.setCamera(camera: camera, animated: animated.value, durationMs: durationMs.value)
|
|
1126
1126
|
return bridge.create_Result_void_()
|
|
1127
1127
|
} catch (let __error) {
|
|
1128
1128
|
let __exceptionPtr = __error.toCpp()
|
|
@@ -1131,7 +1131,7 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
1131
1131
|
}
|
|
1132
1132
|
|
|
1133
1133
|
@inline(__always)
|
|
1134
|
-
public final func setCameraToCoordinates(coordinates: bridge.std__vector_RNLatLng_, padding: bridge.std__optional_RNMapPadding_, animated: bridge.std__optional_bool_,
|
|
1134
|
+
public final func setCameraToCoordinates(coordinates: bridge.std__vector_RNLatLng_, padding: bridge.std__optional_RNMapPadding_, animated: bridge.std__optional_bool_, durationMs: bridge.std__optional_double_) -> bridge.Result_void_ {
|
|
1135
1135
|
do {
|
|
1136
1136
|
try self.__implementation.setCameraToCoordinates(coordinates: coordinates.map({ __item in __item }), padding: { () -> RNMapPadding? in
|
|
1137
1137
|
if bridge.has_value_std__optional_RNMapPadding_(padding) {
|
|
@@ -1140,7 +1140,7 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
1140
1140
|
} else {
|
|
1141
1141
|
return nil
|
|
1142
1142
|
}
|
|
1143
|
-
}(), animated: animated.value,
|
|
1143
|
+
}(), animated: animated.value, durationMs: durationMs.value)
|
|
1144
1144
|
return bridge.create_Result_void_()
|
|
1145
1145
|
} catch (let __error) {
|
|
1146
1146
|
let __exceptionPtr = __error.toCpp()
|
|
@@ -1148,6 +1148,60 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
1148
1148
|
}
|
|
1149
1149
|
}
|
|
1150
1150
|
|
|
1151
|
+
@inline(__always)
|
|
1152
|
+
public final func setCameraBounds(bounds: bridge.std__optional_RNLatLngBounds_) -> bridge.Result_void_ {
|
|
1153
|
+
do {
|
|
1154
|
+
try self.__implementation.setCameraBounds(bounds: { () -> RNLatLngBounds? in
|
|
1155
|
+
if bridge.has_value_std__optional_RNLatLngBounds_(bounds) {
|
|
1156
|
+
let __unwrapped = bridge.get_std__optional_RNLatLngBounds_(bounds)
|
|
1157
|
+
return __unwrapped
|
|
1158
|
+
} else {
|
|
1159
|
+
return nil
|
|
1160
|
+
}
|
|
1161
|
+
}())
|
|
1162
|
+
return bridge.create_Result_void_()
|
|
1163
|
+
} catch (let __error) {
|
|
1164
|
+
let __exceptionPtr = __error.toCpp()
|
|
1165
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
@inline(__always)
|
|
1170
|
+
public final func animateToBounds(bounds: RNLatLngBounds, padding: bridge.std__optional_double_, durationMs: bridge.std__optional_double_, lockBounds: bridge.std__optional_bool_) -> bridge.Result_void_ {
|
|
1171
|
+
do {
|
|
1172
|
+
try self.__implementation.animateToBounds(bounds: bounds, padding: padding.value, durationMs: durationMs.value, lockBounds: lockBounds.value)
|
|
1173
|
+
return bridge.create_Result_void_()
|
|
1174
|
+
} catch (let __error) {
|
|
1175
|
+
let __exceptionPtr = __error.toCpp()
|
|
1176
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
@inline(__always)
|
|
1181
|
+
public final func snapshot(options: RNSnapshotOptions) -> bridge.Result_std__shared_ptr_Promise_std__optional_std__string____ {
|
|
1182
|
+
do {
|
|
1183
|
+
let __result = try self.__implementation.snapshot(options: options)
|
|
1184
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__optional_std__string___ in
|
|
1185
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__optional_std__string___()
|
|
1186
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__optional_std__string___(__promise)
|
|
1187
|
+
__result
|
|
1188
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__optional_std__string_ in
|
|
1189
|
+
if let __unwrappedValue = __result {
|
|
1190
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
1191
|
+
} else {
|
|
1192
|
+
return .init()
|
|
1193
|
+
}
|
|
1194
|
+
}()) })
|
|
1195
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
1196
|
+
return __promise
|
|
1197
|
+
}()
|
|
1198
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_std__string____(__resultCpp)
|
|
1199
|
+
} catch (let __error) {
|
|
1200
|
+
let __exceptionPtr = __error.toCpp()
|
|
1201
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_std__string____(__exceptionPtr)
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1151
1205
|
@inline(__always)
|
|
1152
1206
|
public final func showLocationDialog() -> bridge.Result_void_ {
|
|
1153
1207
|
do {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNLatLngBounds.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 `RNLatLngBounds`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNLatLngBounds = margelo.nitro.rngooglemapsplus.RNLatLngBounds
|
|
14
|
+
|
|
15
|
+
public extension RNLatLngBounds {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNLatLngBounds`.
|
|
20
|
+
*/
|
|
21
|
+
init(northEast: RNLatLng, southWest: RNLatLng) {
|
|
22
|
+
self.init(northEast, southWest)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var northEast: RNLatLng {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return self.__northEast
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__northEast = newValue
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var southWest: RNLatLng {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return self.__southWest
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__southWest = newValue
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSize.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 `RNSize`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNSize = margelo.nitro.rngooglemapsplus.RNSize
|
|
14
|
+
|
|
15
|
+
public extension RNSize {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNSize`.
|
|
20
|
+
*/
|
|
21
|
+
init(width: Double, height: Double) {
|
|
22
|
+
self.init(width, height)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var width: Double {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return self.__width
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__width = newValue
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var height: Double {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return self.__height
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__height = newValue
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSnapshotFormat.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
|
+
/**
|
|
9
|
+
* Represents the JS union `RNSnapshotFormat`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias RNSnapshotFormat = margelo.nitro.rngooglemapsplus.RNSnapshotFormat
|
|
12
|
+
|
|
13
|
+
public extension RNSnapshotFormat {
|
|
14
|
+
/**
|
|
15
|
+
* Get a RNSnapshotFormat 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 "png":
|
|
21
|
+
self = .png
|
|
22
|
+
case "jpg":
|
|
23
|
+
self = .jpg
|
|
24
|
+
case "jpeg":
|
|
25
|
+
self = .jpeg
|
|
26
|
+
default:
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the String value this RNSnapshotFormat represents.
|
|
33
|
+
*/
|
|
34
|
+
var stringValue: String {
|
|
35
|
+
switch self {
|
|
36
|
+
case .png:
|
|
37
|
+
return "png"
|
|
38
|
+
case .jpg:
|
|
39
|
+
return "jpg"
|
|
40
|
+
case .jpeg:
|
|
41
|
+
return "jpeg"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSnapshotOptions.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 `RNSnapshotOptions`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNSnapshotOptions = margelo.nitro.rngooglemapsplus.RNSnapshotOptions
|
|
14
|
+
|
|
15
|
+
public extension RNSnapshotOptions {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNSnapshotOptions`.
|
|
20
|
+
*/
|
|
21
|
+
init(size: RNSize?, format: RNSnapshotFormat, quality: Double, resultType: RNSnapshotResultType) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_RNSize_ in
|
|
23
|
+
if let __unwrappedValue = size {
|
|
24
|
+
return bridge.create_std__optional_RNSize_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), format, quality, resultType)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var size: RNSize? {
|
|
32
|
+
@inline(__always)
|
|
33
|
+
get {
|
|
34
|
+
return { () -> RNSize? in
|
|
35
|
+
if bridge.has_value_std__optional_RNSize_(self.__size) {
|
|
36
|
+
let __unwrapped = bridge.get_std__optional_RNSize_(self.__size)
|
|
37
|
+
return __unwrapped
|
|
38
|
+
} else {
|
|
39
|
+
return nil
|
|
40
|
+
}
|
|
41
|
+
}()
|
|
42
|
+
}
|
|
43
|
+
@inline(__always)
|
|
44
|
+
set {
|
|
45
|
+
self.__size = { () -> bridge.std__optional_RNSize_ in
|
|
46
|
+
if let __unwrappedValue = newValue {
|
|
47
|
+
return bridge.create_std__optional_RNSize_(__unwrappedValue)
|
|
48
|
+
} else {
|
|
49
|
+
return .init()
|
|
50
|
+
}
|
|
51
|
+
}()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
var format: RNSnapshotFormat {
|
|
56
|
+
@inline(__always)
|
|
57
|
+
get {
|
|
58
|
+
return self.__format
|
|
59
|
+
}
|
|
60
|
+
@inline(__always)
|
|
61
|
+
set {
|
|
62
|
+
self.__format = newValue
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var quality: Double {
|
|
67
|
+
@inline(__always)
|
|
68
|
+
get {
|
|
69
|
+
return self.__quality
|
|
70
|
+
}
|
|
71
|
+
@inline(__always)
|
|
72
|
+
set {
|
|
73
|
+
self.__quality = newValue
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var resultType: RNSnapshotResultType {
|
|
78
|
+
@inline(__always)
|
|
79
|
+
get {
|
|
80
|
+
return self.__resultType
|
|
81
|
+
}
|
|
82
|
+
@inline(__always)
|
|
83
|
+
set {
|
|
84
|
+
self.__resultType = newValue
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSnapshotResultType.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
|
+
/**
|
|
9
|
+
* Represents the JS union `RNSnapshotResultType`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias RNSnapshotResultType = margelo.nitro.rngooglemapsplus.RNSnapshotResultType
|
|
12
|
+
|
|
13
|
+
public extension RNSnapshotResultType {
|
|
14
|
+
/**
|
|
15
|
+
* Get a RNSnapshotResultType 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 "base64":
|
|
21
|
+
self = .base64
|
|
22
|
+
case "file":
|
|
23
|
+
self = .file
|
|
24
|
+
default:
|
|
25
|
+
return nil
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get the String value this RNSnapshotResultType represents.
|
|
31
|
+
*/
|
|
32
|
+
var stringValue: String {
|
|
33
|
+
switch self {
|
|
34
|
+
case .base64:
|
|
35
|
+
return "base64"
|
|
36
|
+
case .file:
|
|
37
|
+
return "file"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -86,6 +86,9 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
86
86
|
prototype.registerHybridSetter("onCameraChangeComplete", &HybridRNGoogleMapsPlusViewSpec::setOnCameraChangeComplete);
|
|
87
87
|
prototype.registerHybridMethod("setCamera", &HybridRNGoogleMapsPlusViewSpec::setCamera);
|
|
88
88
|
prototype.registerHybridMethod("setCameraToCoordinates", &HybridRNGoogleMapsPlusViewSpec::setCameraToCoordinates);
|
|
89
|
+
prototype.registerHybridMethod("setCameraBounds", &HybridRNGoogleMapsPlusViewSpec::setCameraBounds);
|
|
90
|
+
prototype.registerHybridMethod("animateToBounds", &HybridRNGoogleMapsPlusViewSpec::animateToBounds);
|
|
91
|
+
prototype.registerHybridMethod("snapshot", &HybridRNGoogleMapsPlusViewSpec::snapshot);
|
|
89
92
|
prototype.registerHybridMethod("showLocationDialog", &HybridRNGoogleMapsPlusViewSpec::showLocationDialog);
|
|
90
93
|
prototype.registerHybridMethod("openLocationSettings", &HybridRNGoogleMapsPlusViewSpec::openLocationSettings);
|
|
91
94
|
prototype.registerHybridMethod("requestLocationPermission", &HybridRNGoogleMapsPlusViewSpec::requestLocationPermission);
|
|
@@ -55,6 +55,10 @@ namespace margelo::nitro::rngooglemapsplus { struct RNIndoorLevel; }
|
|
|
55
55
|
namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
|
|
56
56
|
// Forward declaration of `RNCamera` to properly resolve imports.
|
|
57
57
|
namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
|
|
58
|
+
// Forward declaration of `RNLatLngBounds` to properly resolve imports.
|
|
59
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLatLngBounds; }
|
|
60
|
+
// Forward declaration of `RNSnapshotOptions` to properly resolve imports.
|
|
61
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNSnapshotOptions; }
|
|
58
62
|
// Forward declaration of `RNLocationPermissionResult` to properly resolve imports.
|
|
59
63
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult; }
|
|
60
64
|
|
|
@@ -83,8 +87,10 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult;
|
|
|
83
87
|
#include "RNIndoorLevel.hpp"
|
|
84
88
|
#include "RNRegion.hpp"
|
|
85
89
|
#include "RNCamera.hpp"
|
|
86
|
-
#include "
|
|
90
|
+
#include "RNLatLngBounds.hpp"
|
|
87
91
|
#include <NitroModules/Promise.hpp>
|
|
92
|
+
#include "RNSnapshotOptions.hpp"
|
|
93
|
+
#include "RNLocationPermissionResult.hpp"
|
|
88
94
|
|
|
89
95
|
namespace margelo::nitro::rngooglemapsplus {
|
|
90
96
|
|
|
@@ -186,8 +192,11 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
186
192
|
|
|
187
193
|
public:
|
|
188
194
|
// Methods
|
|
189
|
-
virtual void setCamera(const RNCamera& camera, std::optional<bool> animated, std::optional<double>
|
|
190
|
-
virtual void setCameraToCoordinates(const std::vector<RNLatLng>& coordinates, const std::optional<RNMapPadding>& padding, std::optional<bool> animated, std::optional<double>
|
|
195
|
+
virtual void setCamera(const RNCamera& camera, std::optional<bool> animated, std::optional<double> durationMs) = 0;
|
|
196
|
+
virtual void setCameraToCoordinates(const std::vector<RNLatLng>& coordinates, const std::optional<RNMapPadding>& padding, std::optional<bool> animated, std::optional<double> durationMs) = 0;
|
|
197
|
+
virtual void setCameraBounds(const std::optional<RNLatLngBounds>& bounds) = 0;
|
|
198
|
+
virtual void animateToBounds(const RNLatLngBounds& bounds, std::optional<double> padding, std::optional<double> durationMs, std::optional<bool> lockBounds) = 0;
|
|
199
|
+
virtual std::shared_ptr<Promise<std::optional<std::string>>> snapshot(const RNSnapshotOptions& options) = 0;
|
|
191
200
|
virtual void showLocationDialog() = 0;
|
|
192
201
|
virtual void openLocationSettings() = 0;
|
|
193
202
|
virtual std::shared_ptr<Promise<RNLocationPermissionResult>> requestLocationPermission() = 0;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNLatLngBounds.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
// Forward declaration of `RNLatLng` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
23
|
+
|
|
24
|
+
#include "RNLatLng.hpp"
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A struct which can be represented as a JavaScript object (RNLatLngBounds).
|
|
30
|
+
*/
|
|
31
|
+
struct RNLatLngBounds {
|
|
32
|
+
public:
|
|
33
|
+
RNLatLng northEast SWIFT_PRIVATE;
|
|
34
|
+
RNLatLng southWest SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
RNLatLngBounds() = default;
|
|
38
|
+
explicit RNLatLngBounds(RNLatLng northEast, RNLatLng southWest): northEast(northEast), southWest(southWest) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
// C++ RNLatLngBounds <> JS RNLatLngBounds (object)
|
|
46
|
+
template <>
|
|
47
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLngBounds> final {
|
|
48
|
+
static inline margelo::nitro::rngooglemapsplus::RNLatLngBounds fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
49
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
50
|
+
return margelo::nitro::rngooglemapsplus::RNLatLngBounds(
|
|
51
|
+
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "northEast")),
|
|
52
|
+
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "southWest"))
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNLatLngBounds& arg) {
|
|
56
|
+
jsi::Object obj(runtime);
|
|
57
|
+
obj.setProperty(runtime, "northEast", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.northEast));
|
|
58
|
+
obj.setProperty(runtime, "southWest", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.southWest));
|
|
59
|
+
return obj;
|
|
60
|
+
}
|
|
61
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
62
|
+
if (!value.isObject()) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
jsi::Object obj = value.getObject(runtime);
|
|
66
|
+
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "northEast"))) return false;
|
|
67
|
+
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "southWest"))) return false;
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSize.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (RNSize).
|
|
29
|
+
*/
|
|
30
|
+
struct RNSize {
|
|
31
|
+
public:
|
|
32
|
+
double width SWIFT_PRIVATE;
|
|
33
|
+
double height SWIFT_PRIVATE;
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
RNSize() = default;
|
|
37
|
+
explicit RNSize(double width, double height): width(width), height(height) {}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
41
|
+
|
|
42
|
+
namespace margelo::nitro {
|
|
43
|
+
|
|
44
|
+
// C++ RNSize <> JS RNSize (object)
|
|
45
|
+
template <>
|
|
46
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNSize> final {
|
|
47
|
+
static inline margelo::nitro::rngooglemapsplus::RNSize fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
48
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
49
|
+
return margelo::nitro::rngooglemapsplus::RNSize(
|
|
50
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "width")),
|
|
51
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "height"))
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNSize& arg) {
|
|
55
|
+
jsi::Object obj(runtime);
|
|
56
|
+
obj.setProperty(runtime, "width", JSIConverter<double>::toJSI(runtime, arg.width));
|
|
57
|
+
obj.setProperty(runtime, "height", JSIConverter<double>::toJSI(runtime, arg.height));
|
|
58
|
+
return obj;
|
|
59
|
+
}
|
|
60
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
61
|
+
if (!value.isObject()) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
jsi::Object obj = value.getObject(runtime);
|
|
65
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "width"))) return false;
|
|
66
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "height"))) return false;
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNSnapshotFormat.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/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (RNSnapshotFormat).
|
|
30
|
+
*/
|
|
31
|
+
enum class RNSnapshotFormat {
|
|
32
|
+
PNG SWIFT_NAME(png) = 0,
|
|
33
|
+
JPG SWIFT_NAME(jpg) = 1,
|
|
34
|
+
JPEG SWIFT_NAME(jpeg) = 2,
|
|
35
|
+
} CLOSED_ENUM;
|
|
36
|
+
|
|
37
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
38
|
+
|
|
39
|
+
namespace margelo::nitro {
|
|
40
|
+
|
|
41
|
+
// C++ RNSnapshotFormat <> JS RNSnapshotFormat (union)
|
|
42
|
+
template <>
|
|
43
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotFormat> final {
|
|
44
|
+
static inline margelo::nitro::rngooglemapsplus::RNSnapshotFormat fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
45
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
46
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
47
|
+
case hashString("png"): return margelo::nitro::rngooglemapsplus::RNSnapshotFormat::PNG;
|
|
48
|
+
case hashString("jpg"): return margelo::nitro::rngooglemapsplus::RNSnapshotFormat::JPG;
|
|
49
|
+
case hashString("jpeg"): return margelo::nitro::rngooglemapsplus::RNSnapshotFormat::JPEG;
|
|
50
|
+
default: [[unlikely]]
|
|
51
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum RNSnapshotFormat - invalid value!");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rngooglemapsplus::RNSnapshotFormat arg) {
|
|
55
|
+
switch (arg) {
|
|
56
|
+
case margelo::nitro::rngooglemapsplus::RNSnapshotFormat::PNG: return JSIConverter<std::string>::toJSI(runtime, "png");
|
|
57
|
+
case margelo::nitro::rngooglemapsplus::RNSnapshotFormat::JPG: return JSIConverter<std::string>::toJSI(runtime, "jpg");
|
|
58
|
+
case margelo::nitro::rngooglemapsplus::RNSnapshotFormat::JPEG: return JSIConverter<std::string>::toJSI(runtime, "jpeg");
|
|
59
|
+
default: [[unlikely]]
|
|
60
|
+
throw std::invalid_argument("Cannot convert RNSnapshotFormat to JS - invalid value: "
|
|
61
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
65
|
+
if (!value.isString()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
69
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
70
|
+
case hashString("png"):
|
|
71
|
+
case hashString("jpg"):
|
|
72
|
+
case hashString("jpeg"):
|
|
73
|
+
return true;
|
|
74
|
+
default:
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|