react-native-google-maps-plus 1.7.0 → 1.8.0-dev.2

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.
Files changed (66) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/gradle.properties +2 -1
  3. package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +2 -3
  4. package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +51 -54
  5. package/android/src/main/java/com/rngooglemapsplus/MapPolygonBuilder.kt +6 -23
  6. package/android/src/main/java/com/rngooglemapsplus/MapPolylineBuilder.kt.kt +12 -39
  7. package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +4 -2
  8. package/android/src/main/java/com/rngooglemapsplus/extensions/{RNCameraExtension.kt → RNCameraUpdateExtension.kt} +2 -2
  9. package/android/src/main/java/com/rngooglemapsplus/extensions/RNLineCapTypeExtension.kt +14 -0
  10. package/android/src/main/java/com/rngooglemapsplus/extensions/RNLineJoinTypeExtension.kt +12 -0
  11. package/android/src/main/java/com/rngooglemapsplus/extensions/RNMapCircleExtension.kt +7 -1
  12. package/android/src/main/java/com/rngooglemapsplus/extensions/RNMarkerExtension.kt +54 -17
  13. package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolygonExtension.kt +31 -1
  14. package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolylineExtension.kt +6 -1
  15. package/ios/GoogleMapViewImpl.swift +4 -1
  16. package/ios/LocationHandler.swift +3 -1
  17. package/ios/MapCircleBuilder.swift +2 -3
  18. package/ios/MapHelper.swift +3 -5
  19. package/ios/MapMarkerBuilder.swift +108 -105
  20. package/ios/MapPolygonBuilder.swift +6 -41
  21. package/ios/MapPolylineBuilder.swift +2 -10
  22. package/ios/RNGoogleMapsPlusView.swift +28 -22
  23. package/ios/extensions/{RNCamera+Extension.swift → RNCameraUpdate+Extension.swift} +1 -1
  24. package/ios/extensions/RNCircle+Extension.swift +14 -5
  25. package/ios/extensions/RNLatLng+Extension.swift +11 -0
  26. package/ios/extensions/RNLineCapType+Extension.swift +10 -0
  27. package/ios/extensions/RNLineJoinType+Extension.swift +11 -0
  28. package/ios/extensions/RNMarker+Extension.swift +43 -12
  29. package/ios/extensions/RNPolygon+Extension.swift.swift +50 -21
  30. package/ios/extensions/RNPolyline+Extension.swift.swift +15 -26
  31. package/ios/extensions/SVGKImage+Extension.swift +22 -0
  32. package/lib/module/types.js.map +1 -1
  33. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +2 -2
  34. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
  35. package/lib/typescript/src/types.d.ts +8 -2
  36. package/lib/typescript/src/types.d.ts.map +1 -1
  37. package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera.hpp +0 -1
  38. package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera_bool.hpp +0 -1
  39. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +11 -7
  40. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +1 -1
  41. package/nitrogen/generated/android/c++/JRNCamera.hpp +15 -16
  42. package/nitrogen/generated/android/c++/JRNCameraUpdate.hpp +71 -0
  43. package/nitrogen/generated/android/c++/JRNInitialProps.hpp +11 -7
  44. package/nitrogen/generated/android/c++/JRNMarker.hpp +1 -5
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +1 -1
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCamera.kt +5 -5
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCameraUpdate.kt +46 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNInitialProps.kt +6 -3
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +2 -5
  50. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +10 -7
  51. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +3 -0
  52. package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +7 -4
  53. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +1 -1
  54. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +1 -1
  55. package/nitrogen/generated/ios/swift/RNCamera.swift +14 -62
  56. package/nitrogen/generated/ios/swift/RNCameraUpdate.swift +116 -0
  57. package/nitrogen/generated/ios/swift/RNInitialProps.swift +36 -6
  58. package/nitrogen/generated/ios/swift/RNMarker.swift +1 -31
  59. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +4 -1
  60. package/nitrogen/generated/shared/c++/RNCamera.hpp +17 -18
  61. package/nitrogen/generated/shared/c++/RNCameraUpdate.hpp +89 -0
  62. package/nitrogen/generated/shared/c++/RNInitialProps.hpp +12 -8
  63. package/nitrogen/generated/shared/c++/RNMarker.hpp +1 -5
  64. package/package.json +1 -1
  65. package/src/RNGoogleMapsPlusView.nitro.ts +6 -1
  66. package/src/types.ts +9 -2
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// RNCameraUpdate.kt
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
+ package com.rngooglemapsplus
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import com.margelo.nitro.core.*
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "RNCameraUpdate".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class RNCameraUpdate(
21
+ @DoNotStrip
22
+ @Keep
23
+ val center: RNLatLng?,
24
+ @DoNotStrip
25
+ @Keep
26
+ val zoom: Double?,
27
+ @DoNotStrip
28
+ @Keep
29
+ val bearing: Double?,
30
+ @DoNotStrip
31
+ @Keep
32
+ val tilt: Double?
33
+ ) {
34
+ private companion object {
35
+ /**
36
+ * Constructor called from C++
37
+ */
38
+ @DoNotStrip
39
+ @Keep
40
+ @Suppress("unused")
41
+ @JvmStatic
42
+ private fun fromCpp(center: RNLatLng?, zoom: Double?, bearing: Double?, tilt: Double?): RNCameraUpdate {
43
+ return RNCameraUpdate(center, zoom, bearing, tilt)
44
+ }
45
+ }
46
+ }
@@ -26,7 +26,10 @@ data class RNInitialProps(
26
26
  val liteMode: Boolean?,
27
27
  @DoNotStrip
28
28
  @Keep
29
- val camera: RNCamera?
29
+ val camera: RNCameraUpdate?,
30
+ @DoNotStrip
31
+ @Keep
32
+ val backgroundColor: String?
30
33
  ) {
31
34
  private companion object {
32
35
  /**
@@ -36,8 +39,8 @@ data class RNInitialProps(
36
39
  @Keep
37
40
  @Suppress("unused")
38
41
  @JvmStatic
39
- private fun fromCpp(mapId: String?, liteMode: Boolean?, camera: RNCamera?): RNInitialProps {
40
- return RNInitialProps(mapId, liteMode, camera)
42
+ private fun fromCpp(mapId: String?, liteMode: Boolean?, camera: RNCameraUpdate?, backgroundColor: String?): RNInitialProps {
43
+ return RNInitialProps(mapId, liteMode, camera, backgroundColor)
41
44
  }
42
45
  }
43
46
  }
@@ -32,9 +32,6 @@ data class RNMarker(
32
32
  val anchor: RNPosition?,
33
33
  @DoNotStrip
34
34
  @Keep
35
- val showInfoWindow: Boolean?,
36
- @DoNotStrip
37
- @Keep
38
35
  val title: String?,
39
36
  @DoNotStrip
40
37
  @Keep
@@ -69,8 +66,8 @@ data class RNMarker(
69
66
  @Keep
70
67
  @Suppress("unused")
71
68
  @JvmStatic
72
- private fun fromCpp(id: String, zIndex: Double?, coordinate: RNLatLng, anchor: RNPosition?, showInfoWindow: Boolean?, title: String?, snippet: String?, opacity: Double?, flat: Boolean?, draggable: Boolean?, rotation: Double?, infoWindowAnchor: RNPosition?, iconSvg: RNMarkerSvg?, infoWindowIconSvg: RNMarkerSvg?): RNMarker {
73
- return RNMarker(id, zIndex, coordinate, anchor, showInfoWindow, title, snippet, opacity, flat, draggable, rotation, infoWindowAnchor, iconSvg, infoWindowIconSvg)
69
+ private fun fromCpp(id: String, zIndex: Double?, coordinate: RNLatLng, anchor: RNPosition?, title: String?, snippet: String?, opacity: Double?, flat: Boolean?, draggable: Boolean?, rotation: Double?, infoWindowAnchor: RNPosition?, iconSvg: RNMarkerSvg?, infoWindowIconSvg: RNMarkerSvg?): RNMarker {
70
+ return RNMarker(id, zIndex, coordinate, anchor, title, snippet, opacity, flat, draggable, rotation, infoWindowAnchor, iconSvg, infoWindowIconSvg)
74
71
  }
75
72
  }
76
73
  }
@@ -18,6 +18,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNAndroidLocationConfig; }
18
18
  namespace margelo::nitro::rngooglemapsplus { enum class RNAndroidLocationPermissionResult; }
19
19
  // Forward declaration of `RNAndroidLocationPriority` to properly resolve imports.
20
20
  namespace margelo::nitro::rngooglemapsplus { enum class RNAndroidLocationPriority; }
21
+ // Forward declaration of `RNCameraUpdate` to properly resolve imports.
22
+ namespace margelo::nitro::rngooglemapsplus { struct RNCameraUpdate; }
21
23
  // Forward declaration of `RNCamera` to properly resolve imports.
22
24
  namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
23
25
  // Forward declaration of `RNCircle` to properly resolve imports.
@@ -106,6 +108,7 @@ namespace RNGoogleMapsPlus { class HybridRNGoogleMapsPlusViewSpec_cxx; }
106
108
  #include "RNAndroidLocationPermissionResult.hpp"
107
109
  #include "RNAndroidLocationPriority.hpp"
108
110
  #include "RNCamera.hpp"
111
+ #include "RNCameraUpdate.hpp"
109
112
  #include "RNCircle.hpp"
110
113
  #include "RNHeatmap.hpp"
111
114
  #include "RNHeatmapGradient.hpp"
@@ -344,18 +347,18 @@ namespace margelo::nitro::rngooglemapsplus::bridge::swift {
344
347
  return *optional;
345
348
  }
346
349
 
347
- // pragma MARK: std::optional<RNCamera>
350
+ // pragma MARK: std::optional<RNCameraUpdate>
348
351
  /**
349
- * Specialized version of `std::optional<RNCamera>`.
352
+ * Specialized version of `std::optional<RNCameraUpdate>`.
350
353
  */
351
- using std__optional_RNCamera_ = std::optional<RNCamera>;
352
- inline std::optional<RNCamera> create_std__optional_RNCamera_(const RNCamera& value) noexcept {
353
- return std::optional<RNCamera>(value);
354
+ using std__optional_RNCameraUpdate_ = std::optional<RNCameraUpdate>;
355
+ inline std::optional<RNCameraUpdate> create_std__optional_RNCameraUpdate_(const RNCameraUpdate& value) noexcept {
356
+ return std::optional<RNCameraUpdate>(value);
354
357
  }
355
- inline bool has_value_std__optional_RNCamera_(const std::optional<RNCamera>& optional) noexcept {
358
+ inline bool has_value_std__optional_RNCameraUpdate_(const std::optional<RNCameraUpdate>& optional) noexcept {
356
359
  return optional.has_value();
357
360
  }
358
- inline RNCamera get_std__optional_RNCamera_(const std::optional<RNCamera>& optional) noexcept {
361
+ inline RNCameraUpdate get_std__optional_RNCameraUpdate_(const std::optional<RNCameraUpdate>& optional) noexcept {
359
362
  return *optional;
360
363
  }
361
364
 
@@ -18,6 +18,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNAndroidLocationConfig; }
18
18
  namespace margelo::nitro::rngooglemapsplus { enum class RNAndroidLocationPermissionResult; }
19
19
  // Forward declaration of `RNAndroidLocationPriority` to properly resolve imports.
20
20
  namespace margelo::nitro::rngooglemapsplus { enum class RNAndroidLocationPriority; }
21
+ // Forward declaration of `RNCameraUpdate` to properly resolve imports.
22
+ namespace margelo::nitro::rngooglemapsplus { struct RNCameraUpdate; }
21
23
  // Forward declaration of `RNCamera` to properly resolve imports.
22
24
  namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
23
25
  // Forward declaration of `RNCircle` to properly resolve imports.
@@ -106,6 +108,7 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNUserInterfaceStyle; }
106
108
  #include "RNAndroidLocationPermissionResult.hpp"
107
109
  #include "RNAndroidLocationPriority.hpp"
108
110
  #include "RNCamera.hpp"
111
+ #include "RNCameraUpdate.hpp"
109
112
  #include "RNCircle.hpp"
110
113
  #include "RNHeatmap.hpp"
111
114
  #include "RNHeatmapGradient.hpp"
@@ -14,8 +14,8 @@ namespace RNGoogleMapsPlus { class HybridRNGoogleMapsPlusViewSpec_cxx; }
14
14
 
15
15
  // Forward declaration of `RNInitialProps` to properly resolve imports.
16
16
  namespace margelo::nitro::rngooglemapsplus { struct RNInitialProps; }
17
- // Forward declaration of `RNCamera` to properly resolve imports.
18
- namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
17
+ // Forward declaration of `RNCameraUpdate` to properly resolve imports.
18
+ namespace margelo::nitro::rngooglemapsplus { struct RNCameraUpdate; }
19
19
  // Forward declaration of `RNLatLng` to properly resolve imports.
20
20
  namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
21
21
  // Forward declaration of `RNMapUiSettings` to properly resolve imports.
@@ -70,6 +70,8 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSLocationAccuracy; }
70
70
  namespace margelo::nitro::rngooglemapsplus { enum class RNMapErrorCode; }
71
71
  // Forward declaration of `RNRegion` to properly resolve imports.
72
72
  namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
73
+ // Forward declaration of `RNCamera` to properly resolve imports.
74
+ namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
73
75
  // Forward declaration of `RNLatLngBounds` to properly resolve imports.
74
76
  namespace margelo::nitro::rngooglemapsplus { struct RNLatLngBounds; }
75
77
  // Forward declaration of `RNLocation` to properly resolve imports.
@@ -102,7 +104,7 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSPermissionResult; }
102
104
  #include "RNInitialProps.hpp"
103
105
  #include <optional>
104
106
  #include <string>
105
- #include "RNCamera.hpp"
107
+ #include "RNCameraUpdate.hpp"
106
108
  #include "RNLatLng.hpp"
107
109
  #include "RNMapUiSettings.hpp"
108
110
  #include "RNUserInterfaceStyle.hpp"
@@ -132,6 +134,7 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSPermissionResult; }
132
134
  #include "RNMapErrorCode.hpp"
133
135
  #include <functional>
134
136
  #include "RNRegion.hpp"
137
+ #include "RNCamera.hpp"
135
138
  #include "RNLatLngBounds.hpp"
136
139
  #include "RNLocation.hpp"
137
140
  #include "RNLocationAndroid.hpp"
@@ -508,7 +511,7 @@ namespace margelo::nitro::rngooglemapsplus {
508
511
  std::rethrow_exception(__result.error());
509
512
  }
510
513
  }
511
- inline void setCamera(const RNCamera& camera, std::optional<bool> animated, std::optional<double> durationMs) override {
514
+ inline void setCamera(const RNCameraUpdate& camera, std::optional<bool> animated, std::optional<double> durationMs) override {
512
515
  auto __result = _swiftPart.setCamera(std::forward<decltype(camera)>(camera), animated, durationMs);
513
516
  if (__result.hasError()) [[unlikely]] {
514
517
  std::rethrow_exception(__result.error());
@@ -59,7 +59,7 @@ public protocol HybridRNGoogleMapsPlusViewSpec_protocol: HybridObject, HybridVie
59
59
  // Methods
60
60
  func showMarkerInfoWindow(id: String) throws -> Void
61
61
  func hideMarkerInfoWindow(id: String) throws -> Void
62
- func setCamera(camera: RNCamera, animated: Bool?, durationMs: Double?) throws -> Void
62
+ func setCamera(camera: RNCameraUpdate, animated: Bool?, durationMs: Double?) throws -> Void
63
63
  func setCameraToCoordinates(coordinates: [RNLatLng], padding: RNMapPadding?, animated: Bool?, durationMs: Double?) throws -> Void
64
64
  func setCameraBounds(bounds: RNLatLngBounds?) throws -> Void
65
65
  func animateToBounds(bounds: RNLatLngBounds, padding: Double?, durationMs: Double?, lockBounds: Bool?) throws -> Void
@@ -1379,7 +1379,7 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
1379
1379
  }
1380
1380
 
1381
1381
  @inline(__always)
1382
- public final func setCamera(camera: RNCamera, animated: bridge.std__optional_bool_, durationMs: bridge.std__optional_double_) -> bridge.Result_void_ {
1382
+ public final func setCamera(camera: RNCameraUpdate, animated: bridge.std__optional_bool_, durationMs: bridge.std__optional_double_) -> bridge.Result_void_ {
1383
1383
  do {
1384
1384
  try self.__implementation.setCamera(camera: camera, animated: { () -> Bool? in
1385
1385
  if bridge.has_value_std__optional_bool_(animated) {
@@ -18,99 +18,51 @@ public extension RNCamera {
18
18
  /**
19
19
  * Create a new instance of `RNCamera`.
20
20
  */
21
- init(center: RNLatLng?, zoom: Double?, bearing: Double?, tilt: Double?) {
22
- self.init({ () -> bridge.std__optional_RNLatLng_ in
23
- if let __unwrappedValue = center {
24
- return bridge.create_std__optional_RNLatLng_(__unwrappedValue)
25
- } else {
26
- return .init()
27
- }
28
- }(), { () -> bridge.std__optional_double_ in
29
- if let __unwrappedValue = zoom {
30
- return bridge.create_std__optional_double_(__unwrappedValue)
31
- } else {
32
- return .init()
33
- }
34
- }(), { () -> bridge.std__optional_double_ in
35
- if let __unwrappedValue = bearing {
36
- return bridge.create_std__optional_double_(__unwrappedValue)
37
- } else {
38
- return .init()
39
- }
40
- }(), { () -> bridge.std__optional_double_ in
41
- if let __unwrappedValue = tilt {
42
- return bridge.create_std__optional_double_(__unwrappedValue)
43
- } else {
44
- return .init()
45
- }
46
- }())
21
+ init(center: RNLatLng, zoom: Double, bearing: Double, tilt: Double) {
22
+ self.init(center, zoom, bearing, tilt)
47
23
  }
48
24
 
49
- var center: RNLatLng? {
25
+ var center: RNLatLng {
50
26
  @inline(__always)
51
27
  get {
52
- return self.__center.value
28
+ return self.__center
53
29
  }
54
30
  @inline(__always)
55
31
  set {
56
- self.__center = { () -> bridge.std__optional_RNLatLng_ in
57
- if let __unwrappedValue = newValue {
58
- return bridge.create_std__optional_RNLatLng_(__unwrappedValue)
59
- } else {
60
- return .init()
61
- }
62
- }()
32
+ self.__center = newValue
63
33
  }
64
34
  }
65
35
 
66
- var zoom: Double? {
36
+ var zoom: Double {
67
37
  @inline(__always)
68
38
  get {
69
- return self.__zoom.value
39
+ return self.__zoom
70
40
  }
71
41
  @inline(__always)
72
42
  set {
73
- self.__zoom = { () -> bridge.std__optional_double_ in
74
- if let __unwrappedValue = newValue {
75
- return bridge.create_std__optional_double_(__unwrappedValue)
76
- } else {
77
- return .init()
78
- }
79
- }()
43
+ self.__zoom = newValue
80
44
  }
81
45
  }
82
46
 
83
- var bearing: Double? {
47
+ var bearing: Double {
84
48
  @inline(__always)
85
49
  get {
86
- return self.__bearing.value
50
+ return self.__bearing
87
51
  }
88
52
  @inline(__always)
89
53
  set {
90
- self.__bearing = { () -> bridge.std__optional_double_ in
91
- if let __unwrappedValue = newValue {
92
- return bridge.create_std__optional_double_(__unwrappedValue)
93
- } else {
94
- return .init()
95
- }
96
- }()
54
+ self.__bearing = newValue
97
55
  }
98
56
  }
99
57
 
100
- var tilt: Double? {
58
+ var tilt: Double {
101
59
  @inline(__always)
102
60
  get {
103
- return self.__tilt.value
61
+ return self.__tilt
104
62
  }
105
63
  @inline(__always)
106
64
  set {
107
- self.__tilt = { () -> bridge.std__optional_double_ in
108
- if let __unwrappedValue = newValue {
109
- return bridge.create_std__optional_double_(__unwrappedValue)
110
- } else {
111
- return .init()
112
- }
113
- }()
65
+ self.__tilt = newValue
114
66
  }
115
67
  }
116
68
  }
@@ -0,0 +1,116 @@
1
+ ///
2
+ /// RNCameraUpdate.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 `RNCameraUpdate`, backed by a C++ struct.
12
+ */
13
+ public typealias RNCameraUpdate = margelo.nitro.rngooglemapsplus.RNCameraUpdate
14
+
15
+ public extension RNCameraUpdate {
16
+ private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
17
+
18
+ /**
19
+ * Create a new instance of `RNCameraUpdate`.
20
+ */
21
+ init(center: RNLatLng?, zoom: Double?, bearing: Double?, tilt: Double?) {
22
+ self.init({ () -> bridge.std__optional_RNLatLng_ in
23
+ if let __unwrappedValue = center {
24
+ return bridge.create_std__optional_RNLatLng_(__unwrappedValue)
25
+ } else {
26
+ return .init()
27
+ }
28
+ }(), { () -> bridge.std__optional_double_ in
29
+ if let __unwrappedValue = zoom {
30
+ return bridge.create_std__optional_double_(__unwrappedValue)
31
+ } else {
32
+ return .init()
33
+ }
34
+ }(), { () -> bridge.std__optional_double_ in
35
+ if let __unwrappedValue = bearing {
36
+ return bridge.create_std__optional_double_(__unwrappedValue)
37
+ } else {
38
+ return .init()
39
+ }
40
+ }(), { () -> bridge.std__optional_double_ in
41
+ if let __unwrappedValue = tilt {
42
+ return bridge.create_std__optional_double_(__unwrappedValue)
43
+ } else {
44
+ return .init()
45
+ }
46
+ }())
47
+ }
48
+
49
+ var center: RNLatLng? {
50
+ @inline(__always)
51
+ get {
52
+ return self.__center.value
53
+ }
54
+ @inline(__always)
55
+ set {
56
+ self.__center = { () -> bridge.std__optional_RNLatLng_ in
57
+ if let __unwrappedValue = newValue {
58
+ return bridge.create_std__optional_RNLatLng_(__unwrappedValue)
59
+ } else {
60
+ return .init()
61
+ }
62
+ }()
63
+ }
64
+ }
65
+
66
+ var zoom: Double? {
67
+ @inline(__always)
68
+ get {
69
+ return self.__zoom.value
70
+ }
71
+ @inline(__always)
72
+ set {
73
+ self.__zoom = { () -> bridge.std__optional_double_ in
74
+ if let __unwrappedValue = newValue {
75
+ return bridge.create_std__optional_double_(__unwrappedValue)
76
+ } else {
77
+ return .init()
78
+ }
79
+ }()
80
+ }
81
+ }
82
+
83
+ var bearing: Double? {
84
+ @inline(__always)
85
+ get {
86
+ return self.__bearing.value
87
+ }
88
+ @inline(__always)
89
+ set {
90
+ self.__bearing = { () -> bridge.std__optional_double_ in
91
+ if let __unwrappedValue = newValue {
92
+ return bridge.create_std__optional_double_(__unwrappedValue)
93
+ } else {
94
+ return .init()
95
+ }
96
+ }()
97
+ }
98
+ }
99
+
100
+ var tilt: Double? {
101
+ @inline(__always)
102
+ get {
103
+ return self.__tilt.value
104
+ }
105
+ @inline(__always)
106
+ set {
107
+ self.__tilt = { () -> bridge.std__optional_double_ in
108
+ if let __unwrappedValue = newValue {
109
+ return bridge.create_std__optional_double_(__unwrappedValue)
110
+ } else {
111
+ return .init()
112
+ }
113
+ }()
114
+ }
115
+ }
116
+ }
@@ -18,7 +18,7 @@ public extension RNInitialProps {
18
18
  /**
19
19
  * Create a new instance of `RNInitialProps`.
20
20
  */
21
- init(mapId: String?, liteMode: Bool?, camera: RNCamera?) {
21
+ init(mapId: String?, liteMode: Bool?, camera: RNCameraUpdate?, backgroundColor: String?) {
22
22
  self.init({ () -> bridge.std__optional_std__string_ in
23
23
  if let __unwrappedValue = mapId {
24
24
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
@@ -31,9 +31,15 @@ public extension RNInitialProps {
31
31
  } else {
32
32
  return .init()
33
33
  }
34
- }(), { () -> bridge.std__optional_RNCamera_ in
34
+ }(), { () -> bridge.std__optional_RNCameraUpdate_ in
35
35
  if let __unwrappedValue = camera {
36
- return bridge.create_std__optional_RNCamera_(__unwrappedValue)
36
+ return bridge.create_std__optional_RNCameraUpdate_(__unwrappedValue)
37
+ } else {
38
+ return .init()
39
+ }
40
+ }(), { () -> bridge.std__optional_std__string_ in
41
+ if let __unwrappedValue = backgroundColor {
42
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
37
43
  } else {
38
44
  return .init()
39
45
  }
@@ -88,16 +94,40 @@ public extension RNInitialProps {
88
94
  }
89
95
  }
90
96
 
91
- var camera: RNCamera? {
97
+ var camera: RNCameraUpdate? {
92
98
  @inline(__always)
93
99
  get {
94
100
  return self.__camera.value
95
101
  }
96
102
  @inline(__always)
97
103
  set {
98
- self.__camera = { () -> bridge.std__optional_RNCamera_ in
104
+ self.__camera = { () -> bridge.std__optional_RNCameraUpdate_ in
105
+ if let __unwrappedValue = newValue {
106
+ return bridge.create_std__optional_RNCameraUpdate_(__unwrappedValue)
107
+ } else {
108
+ return .init()
109
+ }
110
+ }()
111
+ }
112
+ }
113
+
114
+ var backgroundColor: String? {
115
+ @inline(__always)
116
+ get {
117
+ return { () -> String? in
118
+ if bridge.has_value_std__optional_std__string_(self.__backgroundColor) {
119
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__backgroundColor)
120
+ return String(__unwrapped)
121
+ } else {
122
+ return nil
123
+ }
124
+ }()
125
+ }
126
+ @inline(__always)
127
+ set {
128
+ self.__backgroundColor = { () -> bridge.std__optional_std__string_ in
99
129
  if let __unwrappedValue = newValue {
100
- return bridge.create_std__optional_RNCamera_(__unwrappedValue)
130
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
101
131
  } else {
102
132
  return .init()
103
133
  }
@@ -18,7 +18,7 @@ public extension RNMarker {
18
18
  /**
19
19
  * Create a new instance of `RNMarker`.
20
20
  */
21
- init(id: String, zIndex: Double?, coordinate: RNLatLng, anchor: RNPosition?, showInfoWindow: Bool?, title: String?, snippet: String?, opacity: Double?, flat: Bool?, draggable: Bool?, rotation: Double?, infoWindowAnchor: RNPosition?, iconSvg: RNMarkerSvg?, infoWindowIconSvg: RNMarkerSvg?) {
21
+ init(id: String, zIndex: Double?, coordinate: RNLatLng, anchor: RNPosition?, title: String?, snippet: String?, opacity: Double?, flat: Bool?, draggable: Bool?, rotation: Double?, infoWindowAnchor: RNPosition?, iconSvg: RNMarkerSvg?, infoWindowIconSvg: RNMarkerSvg?) {
22
22
  self.init(std.string(id), { () -> bridge.std__optional_double_ in
23
23
  if let __unwrappedValue = zIndex {
24
24
  return bridge.create_std__optional_double_(__unwrappedValue)
@@ -31,12 +31,6 @@ public extension RNMarker {
31
31
  } else {
32
32
  return .init()
33
33
  }
34
- }(), { () -> bridge.std__optional_bool_ in
35
- if let __unwrappedValue = showInfoWindow {
36
- return bridge.create_std__optional_bool_(__unwrappedValue)
37
- } else {
38
- return .init()
39
- }
40
34
  }(), { () -> bridge.std__optional_std__string_ in
41
35
  if let __unwrappedValue = title {
42
36
  return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
@@ -150,30 +144,6 @@ public extension RNMarker {
150
144
  }
151
145
  }
152
146
 
153
- var showInfoWindow: Bool? {
154
- @inline(__always)
155
- get {
156
- return { () -> Bool? in
157
- if bridge.has_value_std__optional_bool_(self.__showInfoWindow) {
158
- let __unwrapped = bridge.get_std__optional_bool_(self.__showInfoWindow)
159
- return __unwrapped
160
- } else {
161
- return nil
162
- }
163
- }()
164
- }
165
- @inline(__always)
166
- set {
167
- self.__showInfoWindow = { () -> bridge.std__optional_bool_ in
168
- if let __unwrappedValue = newValue {
169
- return bridge.create_std__optional_bool_(__unwrappedValue)
170
- } else {
171
- return .init()
172
- }
173
- }()
174
- }
175
- }
176
-
177
147
  var title: String? {
178
148
  @inline(__always)
179
149
  get {
@@ -57,6 +57,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
57
57
  namespace margelo::nitro::rngooglemapsplus { struct RNIndoorBuilding; }
58
58
  // Forward declaration of `RNIndoorLevel` to properly resolve imports.
59
59
  namespace margelo::nitro::rngooglemapsplus { struct RNIndoorLevel; }
60
+ // Forward declaration of `RNCameraUpdate` to properly resolve imports.
61
+ namespace margelo::nitro::rngooglemapsplus { struct RNCameraUpdate; }
60
62
  // Forward declaration of `RNLatLngBounds` to properly resolve imports.
61
63
  namespace margelo::nitro::rngooglemapsplus { struct RNLatLngBounds; }
62
64
  // Forward declaration of `RNSnapshotOptions` to properly resolve imports.
@@ -90,6 +92,7 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult;
90
92
  #include "RNLatLng.hpp"
91
93
  #include "RNIndoorBuilding.hpp"
92
94
  #include "RNIndoorLevel.hpp"
95
+ #include "RNCameraUpdate.hpp"
93
96
  #include "RNLatLngBounds.hpp"
94
97
  #include <NitroModules/Promise.hpp>
95
98
  #include "RNSnapshotOptions.hpp"
@@ -215,7 +218,7 @@ namespace margelo::nitro::rngooglemapsplus {
215
218
  // Methods
216
219
  virtual void showMarkerInfoWindow(const std::string& id) = 0;
217
220
  virtual void hideMarkerInfoWindow(const std::string& id) = 0;
218
- virtual void setCamera(const RNCamera& camera, std::optional<bool> animated, std::optional<double> durationMs) = 0;
221
+ virtual void setCamera(const RNCameraUpdate& camera, std::optional<bool> animated, std::optional<double> durationMs) = 0;
219
222
  virtual void setCameraToCoordinates(const std::vector<RNLatLng>& coordinates, const std::optional<RNMapPadding>& padding, std::optional<bool> animated, std::optional<double> durationMs) = 0;
220
223
  virtual void setCameraBounds(const std::optional<RNLatLngBounds>& bounds) = 0;
221
224
  virtual void animateToBounds(const RNLatLngBounds& bounds, std::optional<double> padding, std::optional<double> durationMs, std::optional<bool> lockBounds) = 0;
@@ -27,7 +27,6 @@
27
27
  namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
28
28
 
29
29
  #include "RNLatLng.hpp"
30
- #include <optional>
31
30
 
32
31
  namespace margelo::nitro::rngooglemapsplus {
33
32
 
@@ -36,14 +35,14 @@ namespace margelo::nitro::rngooglemapsplus {
36
35
  */
37
36
  struct RNCamera {
38
37
  public:
39
- std::optional<RNLatLng> center SWIFT_PRIVATE;
40
- std::optional<double> zoom SWIFT_PRIVATE;
41
- std::optional<double> bearing SWIFT_PRIVATE;
42
- std::optional<double> tilt SWIFT_PRIVATE;
38
+ RNLatLng center SWIFT_PRIVATE;
39
+ double zoom SWIFT_PRIVATE;
40
+ double bearing SWIFT_PRIVATE;
41
+ double tilt SWIFT_PRIVATE;
43
42
 
44
43
  public:
45
44
  RNCamera() = default;
46
- explicit RNCamera(std::optional<RNLatLng> center, std::optional<double> zoom, std::optional<double> bearing, std::optional<double> tilt): center(center), zoom(zoom), bearing(bearing), tilt(tilt) {}
45
+ explicit RNCamera(RNLatLng center, double zoom, double bearing, double tilt): center(center), zoom(zoom), bearing(bearing), tilt(tilt) {}
47
46
  };
48
47
 
49
48
  } // namespace margelo::nitro::rngooglemapsplus
@@ -56,18 +55,18 @@ namespace margelo::nitro {
56
55
  static inline margelo::nitro::rngooglemapsplus::RNCamera fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
57
56
  jsi::Object obj = arg.asObject(runtime);
58
57
  return margelo::nitro::rngooglemapsplus::RNCamera(
59
- JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLatLng>>::fromJSI(runtime, obj.getProperty(runtime, "center")),
60
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "zoom")),
61
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "bearing")),
62
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "tilt"))
58
+ JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "center")),
59
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "zoom")),
60
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "bearing")),
61
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "tilt"))
63
62
  );
64
63
  }
65
64
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNCamera& arg) {
66
65
  jsi::Object obj(runtime);
67
- obj.setProperty(runtime, "center", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLatLng>>::toJSI(runtime, arg.center));
68
- obj.setProperty(runtime, "zoom", JSIConverter<std::optional<double>>::toJSI(runtime, arg.zoom));
69
- obj.setProperty(runtime, "bearing", JSIConverter<std::optional<double>>::toJSI(runtime, arg.bearing));
70
- obj.setProperty(runtime, "tilt", JSIConverter<std::optional<double>>::toJSI(runtime, arg.tilt));
66
+ obj.setProperty(runtime, "center", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.center));
67
+ obj.setProperty(runtime, "zoom", JSIConverter<double>::toJSI(runtime, arg.zoom));
68
+ obj.setProperty(runtime, "bearing", JSIConverter<double>::toJSI(runtime, arg.bearing));
69
+ obj.setProperty(runtime, "tilt", JSIConverter<double>::toJSI(runtime, arg.tilt));
71
70
  return obj;
72
71
  }
73
72
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -78,10 +77,10 @@ namespace margelo::nitro {
78
77
  if (!nitro::isPlainObject(runtime, obj)) {
79
78
  return false;
80
79
  }
81
- if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNLatLng>>::canConvert(runtime, obj.getProperty(runtime, "center"))) return false;
82
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zoom"))) return false;
83
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "bearing"))) return false;
84
- if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "tilt"))) return false;
80
+ if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "center"))) return false;
81
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "zoom"))) return false;
82
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "bearing"))) return false;
83
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "tilt"))) return false;
85
84
  return true;
86
85
  }
87
86
  };