react-native-google-maps-plus 1.3.0-dev.7 → 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.
Files changed (52) hide show
  1. package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +24 -78
  2. package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +38 -36
  3. package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +31 -8
  4. package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +69 -18
  5. package/android/src/main/java/com/rngooglemapsplus/MapPolygonBuilder.kt +53 -14
  6. package/android/src/main/java/com/rngooglemapsplus/MapPolylineBuilder.kt.kt +44 -11
  7. package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +4 -4
  8. package/android/src/main/java/com/rngooglemapsplus/extensions/LocationExtension.kt +59 -0
  9. package/ios/GoogleMapViewImpl.swift +17 -63
  10. package/ios/MapCircleBuilder.swift +29 -9
  11. package/ios/MapMarkerBuilder.swift +59 -18
  12. package/ios/MapPolygonBuilder.swift +50 -16
  13. package/ios/MapPolylineBuilder.swift +31 -15
  14. package/ios/RNGoogleMapsPlusView.swift +9 -3
  15. package/ios/extensions/CLLocation+Extension.swift +27 -0
  16. package/lib/module/GoogleMapsPlus.js +7 -0
  17. package/lib/module/GoogleMapsPlus.js.map +1 -0
  18. package/lib/module/index.js +3 -5
  19. package/lib/module/index.js.map +1 -1
  20. package/lib/module/types.js.map +1 -1
  21. package/lib/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +44 -0
  22. package/lib/typescript/src/GoogleMapsPlus.d.ts +5 -0
  23. package/lib/typescript/src/GoogleMapsPlus.d.ts.map +1 -0
  24. package/lib/typescript/src/index.d.ts +3 -3
  25. package/lib/typescript/src/index.d.ts.map +1 -1
  26. package/lib/typescript/src/types.d.ts +25 -0
  27. package/lib/typescript/src/types.d.ts.map +1 -1
  28. package/nitrogen/generated/android/c++/JFunc_void_RNLocation.hpp +6 -0
  29. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +8 -0
  30. package/nitrogen/generated/android/c++/JRNLocation.hpp +32 -2
  31. package/nitrogen/generated/android/c++/JRNLocationAndroid.hpp +82 -0
  32. package/nitrogen/generated/android/c++/JRNLocationIOS.hpp +77 -0
  33. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocation.kt +19 -1
  34. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationAndroid.kt +50 -0
  35. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationIOS.kt +47 -0
  36. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/views/HybridRNGoogleMapsPlusViewManager.kt +7 -2
  37. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +36 -0
  38. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +6 -0
  39. package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +6 -0
  40. package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +8 -0
  41. package/nitrogen/generated/ios/swift/RNLocation.swift +92 -2
  42. package/nitrogen/generated/ios/swift/RNLocationAndroid.swift +215 -0
  43. package/nitrogen/generated/ios/swift/RNLocationIOS.swift +185 -0
  44. package/nitrogen/generated/shared/c++/RNLocation.hpp +33 -2
  45. package/nitrogen/generated/shared/c++/RNLocationAndroid.hpp +104 -0
  46. package/nitrogen/generated/shared/c++/RNLocationIOS.hpp +99 -0
  47. package/package.json +6 -13
  48. package/src/GoogleMapsPlus.tsx +20 -0
  49. package/src/index.tsx +6 -14
  50. package/src/types.ts +27 -0
  51. package/lib/module/package.json +0 -1
  52. package/lib/typescript/package.json +0 -1
@@ -15,6 +15,12 @@
15
15
  #include "JRNLocation.hpp"
16
16
  #include "RNLatLng.hpp"
17
17
  #include "JRNLatLng.hpp"
18
+ #include "RNLocationAndroid.hpp"
19
+ #include <optional>
20
+ #include "JRNLocationAndroid.hpp"
21
+ #include <string>
22
+ #include "RNLocationIOS.hpp"
23
+ #include "JRNLocationIOS.hpp"
18
24
 
19
25
  namespace margelo::nitro::rngooglemapsplus {
20
26
 
@@ -63,6 +63,10 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSLocationAccuracy; }
63
63
  namespace margelo::nitro::rngooglemapsplus { enum class RNMapErrorCode; }
64
64
  // Forward declaration of `RNLocation` to properly resolve imports.
65
65
  namespace margelo::nitro::rngooglemapsplus { struct RNLocation; }
66
+ // Forward declaration of `RNLocationAndroid` to properly resolve imports.
67
+ namespace margelo::nitro::rngooglemapsplus { struct RNLocationAndroid; }
68
+ // Forward declaration of `RNLocationIOS` to properly resolve imports.
69
+ namespace margelo::nitro::rngooglemapsplus { struct RNLocationIOS; }
66
70
  // Forward declaration of `RNLocationErrorCode` to properly resolve imports.
67
71
  namespace margelo::nitro::rngooglemapsplus { enum class RNLocationErrorCode; }
68
72
  // Forward declaration of `RNIndoorBuilding` to properly resolve imports.
@@ -151,6 +155,10 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNSnapshotResultType; }
151
155
  #include "RNLocation.hpp"
152
156
  #include "JFunc_void_RNLocation.hpp"
153
157
  #include "JRNLocation.hpp"
158
+ #include "RNLocationAndroid.hpp"
159
+ #include "JRNLocationAndroid.hpp"
160
+ #include "RNLocationIOS.hpp"
161
+ #include "JRNLocationIOS.hpp"
154
162
  #include "RNLocationErrorCode.hpp"
155
163
  #include "JFunc_void_RNLocationErrorCode.hpp"
156
164
  #include "JRNLocationErrorCode.hpp"
@@ -11,7 +11,13 @@
11
11
  #include "RNLocation.hpp"
12
12
 
13
13
  #include "JRNLatLng.hpp"
14
+ #include "JRNLocationAndroid.hpp"
15
+ #include "JRNLocationIOS.hpp"
14
16
  #include "RNLatLng.hpp"
17
+ #include "RNLocationAndroid.hpp"
18
+ #include "RNLocationIOS.hpp"
19
+ #include <optional>
20
+ #include <string>
15
21
 
16
22
  namespace margelo::nitro::rngooglemapsplus {
17
23
 
@@ -34,11 +40,29 @@ namespace margelo::nitro::rngooglemapsplus {
34
40
  static const auto clazz = javaClassStatic();
35
41
  static const auto fieldCenter = clazz->getField<JRNLatLng>("center");
36
42
  jni::local_ref<JRNLatLng> center = this->getFieldValue(fieldCenter);
43
+ static const auto fieldAltitude = clazz->getField<double>("altitude");
44
+ double altitude = this->getFieldValue(fieldAltitude);
45
+ static const auto fieldAccuracy = clazz->getField<double>("accuracy");
46
+ double accuracy = this->getFieldValue(fieldAccuracy);
37
47
  static const auto fieldBearing = clazz->getField<double>("bearing");
38
48
  double bearing = this->getFieldValue(fieldBearing);
49
+ static const auto fieldSpeed = clazz->getField<double>("speed");
50
+ double speed = this->getFieldValue(fieldSpeed);
51
+ static const auto fieldTime = clazz->getField<double>("time");
52
+ double time = this->getFieldValue(fieldTime);
53
+ static const auto fieldAndroid = clazz->getField<JRNLocationAndroid>("android");
54
+ jni::local_ref<JRNLocationAndroid> android = this->getFieldValue(fieldAndroid);
55
+ static const auto fieldIos = clazz->getField<JRNLocationIOS>("ios");
56
+ jni::local_ref<JRNLocationIOS> ios = this->getFieldValue(fieldIos);
39
57
  return RNLocation(
40
58
  center->toCpp(),
41
- bearing
59
+ altitude,
60
+ accuracy,
61
+ bearing,
62
+ speed,
63
+ time,
64
+ android != nullptr ? std::make_optional(android->toCpp()) : std::nullopt,
65
+ ios != nullptr ? std::make_optional(ios->toCpp()) : std::nullopt
42
66
  );
43
67
  }
44
68
 
@@ -50,7 +74,13 @@ namespace margelo::nitro::rngooglemapsplus {
50
74
  static jni::local_ref<JRNLocation::javaobject> fromCpp(const RNLocation& value) {
51
75
  return newInstance(
52
76
  JRNLatLng::fromCpp(value.center),
53
- value.bearing
77
+ value.altitude,
78
+ value.accuracy,
79
+ value.bearing,
80
+ value.speed,
81
+ value.time,
82
+ value.android.has_value() ? JRNLocationAndroid::fromCpp(value.android.value()) : nullptr,
83
+ value.ios.has_value() ? JRNLocationIOS::fromCpp(value.ios.value()) : nullptr
54
84
  );
55
85
  }
56
86
  };
@@ -0,0 +1,82 @@
1
+ ///
2
+ /// JRNLocationAndroid.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include "RNLocationAndroid.hpp"
12
+
13
+ #include <optional>
14
+ #include <string>
15
+
16
+ namespace margelo::nitro::rngooglemapsplus {
17
+
18
+ using namespace facebook;
19
+
20
+ /**
21
+ * The C++ JNI bridge between the C++ struct "RNLocationAndroid" and the the Kotlin data class "RNLocationAndroid".
22
+ */
23
+ struct JRNLocationAndroid final: public jni::JavaClass<JRNLocationAndroid> {
24
+ public:
25
+ static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/RNLocationAndroid;";
26
+
27
+ public:
28
+ /**
29
+ * Convert this Java/Kotlin-based struct to the C++ struct RNLocationAndroid by copying all values to C++.
30
+ */
31
+ [[maybe_unused]]
32
+ [[nodiscard]]
33
+ RNLocationAndroid toCpp() const {
34
+ static const auto clazz = javaClassStatic();
35
+ static const auto fieldProvider = clazz->getField<jni::JString>("provider");
36
+ jni::local_ref<jni::JString> provider = this->getFieldValue(fieldProvider);
37
+ static const auto fieldElapsedRealtimeNanos = clazz->getField<jni::JDouble>("elapsedRealtimeNanos");
38
+ jni::local_ref<jni::JDouble> elapsedRealtimeNanos = this->getFieldValue(fieldElapsedRealtimeNanos);
39
+ static const auto fieldBearingAccuracyDegrees = clazz->getField<jni::JDouble>("bearingAccuracyDegrees");
40
+ jni::local_ref<jni::JDouble> bearingAccuracyDegrees = this->getFieldValue(fieldBearingAccuracyDegrees);
41
+ static const auto fieldSpeedAccuracyMetersPerSecond = clazz->getField<jni::JDouble>("speedAccuracyMetersPerSecond");
42
+ jni::local_ref<jni::JDouble> speedAccuracyMetersPerSecond = this->getFieldValue(fieldSpeedAccuracyMetersPerSecond);
43
+ static const auto fieldVerticalAccuracyMeters = clazz->getField<jni::JDouble>("verticalAccuracyMeters");
44
+ jni::local_ref<jni::JDouble> verticalAccuracyMeters = this->getFieldValue(fieldVerticalAccuracyMeters);
45
+ static const auto fieldMslAltitudeMeters = clazz->getField<jni::JDouble>("mslAltitudeMeters");
46
+ jni::local_ref<jni::JDouble> mslAltitudeMeters = this->getFieldValue(fieldMslAltitudeMeters);
47
+ static const auto fieldMslAltitudeAccuracyMeters = clazz->getField<jni::JDouble>("mslAltitudeAccuracyMeters");
48
+ jni::local_ref<jni::JDouble> mslAltitudeAccuracyMeters = this->getFieldValue(fieldMslAltitudeAccuracyMeters);
49
+ static const auto fieldIsMock = clazz->getField<jni::JBoolean>("isMock");
50
+ jni::local_ref<jni::JBoolean> isMock = this->getFieldValue(fieldIsMock);
51
+ return RNLocationAndroid(
52
+ provider != nullptr ? std::make_optional(provider->toStdString()) : std::nullopt,
53
+ elapsedRealtimeNanos != nullptr ? std::make_optional(elapsedRealtimeNanos->value()) : std::nullopt,
54
+ bearingAccuracyDegrees != nullptr ? std::make_optional(bearingAccuracyDegrees->value()) : std::nullopt,
55
+ speedAccuracyMetersPerSecond != nullptr ? std::make_optional(speedAccuracyMetersPerSecond->value()) : std::nullopt,
56
+ verticalAccuracyMeters != nullptr ? std::make_optional(verticalAccuracyMeters->value()) : std::nullopt,
57
+ mslAltitudeMeters != nullptr ? std::make_optional(mslAltitudeMeters->value()) : std::nullopt,
58
+ mslAltitudeAccuracyMeters != nullptr ? std::make_optional(mslAltitudeAccuracyMeters->value()) : std::nullopt,
59
+ isMock != nullptr ? std::make_optional(static_cast<bool>(isMock->value())) : std::nullopt
60
+ );
61
+ }
62
+
63
+ public:
64
+ /**
65
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
66
+ */
67
+ [[maybe_unused]]
68
+ static jni::local_ref<JRNLocationAndroid::javaobject> fromCpp(const RNLocationAndroid& value) {
69
+ return newInstance(
70
+ value.provider.has_value() ? jni::make_jstring(value.provider.value()) : nullptr,
71
+ value.elapsedRealtimeNanos.has_value() ? jni::JDouble::valueOf(value.elapsedRealtimeNanos.value()) : nullptr,
72
+ value.bearingAccuracyDegrees.has_value() ? jni::JDouble::valueOf(value.bearingAccuracyDegrees.value()) : nullptr,
73
+ value.speedAccuracyMetersPerSecond.has_value() ? jni::JDouble::valueOf(value.speedAccuracyMetersPerSecond.value()) : nullptr,
74
+ value.verticalAccuracyMeters.has_value() ? jni::JDouble::valueOf(value.verticalAccuracyMeters.value()) : nullptr,
75
+ value.mslAltitudeMeters.has_value() ? jni::JDouble::valueOf(value.mslAltitudeMeters.value()) : nullptr,
76
+ value.mslAltitudeAccuracyMeters.has_value() ? jni::JDouble::valueOf(value.mslAltitudeAccuracyMeters.value()) : nullptr,
77
+ value.isMock.has_value() ? jni::JBoolean::valueOf(value.isMock.value()) : nullptr
78
+ );
79
+ }
80
+ };
81
+
82
+ } // namespace margelo::nitro::rngooglemapsplus
@@ -0,0 +1,77 @@
1
+ ///
2
+ /// JRNLocationIOS.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #include <fbjni/fbjni.h>
11
+ #include "RNLocationIOS.hpp"
12
+
13
+ #include <optional>
14
+
15
+ namespace margelo::nitro::rngooglemapsplus {
16
+
17
+ using namespace facebook;
18
+
19
+ /**
20
+ * The C++ JNI bridge between the C++ struct "RNLocationIOS" and the the Kotlin data class "RNLocationIOS".
21
+ */
22
+ struct JRNLocationIOS final: public jni::JavaClass<JRNLocationIOS> {
23
+ public:
24
+ static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/RNLocationIOS;";
25
+
26
+ public:
27
+ /**
28
+ * Convert this Java/Kotlin-based struct to the C++ struct RNLocationIOS by copying all values to C++.
29
+ */
30
+ [[maybe_unused]]
31
+ [[nodiscard]]
32
+ RNLocationIOS toCpp() const {
33
+ static const auto clazz = javaClassStatic();
34
+ static const auto fieldHorizontalAccuracy = clazz->getField<jni::JDouble>("horizontalAccuracy");
35
+ jni::local_ref<jni::JDouble> horizontalAccuracy = this->getFieldValue(fieldHorizontalAccuracy);
36
+ static const auto fieldVerticalAccuracy = clazz->getField<jni::JDouble>("verticalAccuracy");
37
+ jni::local_ref<jni::JDouble> verticalAccuracy = this->getFieldValue(fieldVerticalAccuracy);
38
+ static const auto fieldSpeedAccuracy = clazz->getField<jni::JDouble>("speedAccuracy");
39
+ jni::local_ref<jni::JDouble> speedAccuracy = this->getFieldValue(fieldSpeedAccuracy);
40
+ static const auto fieldCourseAccuracy = clazz->getField<jni::JDouble>("courseAccuracy");
41
+ jni::local_ref<jni::JDouble> courseAccuracy = this->getFieldValue(fieldCourseAccuracy);
42
+ static const auto fieldFloor = clazz->getField<jni::JDouble>("floor");
43
+ jni::local_ref<jni::JDouble> floor = this->getFieldValue(fieldFloor);
44
+ static const auto fieldIsFromMockProvider = clazz->getField<jni::JBoolean>("isFromMockProvider");
45
+ jni::local_ref<jni::JBoolean> isFromMockProvider = this->getFieldValue(fieldIsFromMockProvider);
46
+ static const auto fieldTimestamp = clazz->getField<jni::JDouble>("timestamp");
47
+ jni::local_ref<jni::JDouble> timestamp = this->getFieldValue(fieldTimestamp);
48
+ return RNLocationIOS(
49
+ horizontalAccuracy != nullptr ? std::make_optional(horizontalAccuracy->value()) : std::nullopt,
50
+ verticalAccuracy != nullptr ? std::make_optional(verticalAccuracy->value()) : std::nullopt,
51
+ speedAccuracy != nullptr ? std::make_optional(speedAccuracy->value()) : std::nullopt,
52
+ courseAccuracy != nullptr ? std::make_optional(courseAccuracy->value()) : std::nullopt,
53
+ floor != nullptr ? std::make_optional(floor->value()) : std::nullopt,
54
+ isFromMockProvider != nullptr ? std::make_optional(static_cast<bool>(isFromMockProvider->value())) : std::nullopt,
55
+ timestamp != nullptr ? std::make_optional(timestamp->value()) : std::nullopt
56
+ );
57
+ }
58
+
59
+ public:
60
+ /**
61
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
62
+ */
63
+ [[maybe_unused]]
64
+ static jni::local_ref<JRNLocationIOS::javaobject> fromCpp(const RNLocationIOS& value) {
65
+ return newInstance(
66
+ value.horizontalAccuracy.has_value() ? jni::JDouble::valueOf(value.horizontalAccuracy.value()) : nullptr,
67
+ value.verticalAccuracy.has_value() ? jni::JDouble::valueOf(value.verticalAccuracy.value()) : nullptr,
68
+ value.speedAccuracy.has_value() ? jni::JDouble::valueOf(value.speedAccuracy.value()) : nullptr,
69
+ value.courseAccuracy.has_value() ? jni::JDouble::valueOf(value.courseAccuracy.value()) : nullptr,
70
+ value.floor.has_value() ? jni::JDouble::valueOf(value.floor.value()) : nullptr,
71
+ value.isFromMockProvider.has_value() ? jni::JBoolean::valueOf(value.isFromMockProvider.value()) : nullptr,
72
+ value.timestamp.has_value() ? jni::JDouble::valueOf(value.timestamp.value()) : nullptr
73
+ );
74
+ }
75
+ };
76
+
77
+ } // namespace margelo::nitro::rngooglemapsplus
@@ -26,7 +26,25 @@ data class RNLocation
26
26
  val center: RNLatLng,
27
27
  @DoNotStrip
28
28
  @Keep
29
- val bearing: Double
29
+ val altitude: Double,
30
+ @DoNotStrip
31
+ @Keep
32
+ val accuracy: Double,
33
+ @DoNotStrip
34
+ @Keep
35
+ val bearing: Double,
36
+ @DoNotStrip
37
+ @Keep
38
+ val speed: Double,
39
+ @DoNotStrip
40
+ @Keep
41
+ val time: Double,
42
+ @DoNotStrip
43
+ @Keep
44
+ val android: RNLocationAndroid?,
45
+ @DoNotStrip
46
+ @Keep
47
+ val ios: RNLocationIOS?
30
48
  ) {
31
49
  /* main constructor */
32
50
  }
@@ -0,0 +1,50 @@
1
+ ///
2
+ /// RNLocationAndroid.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 "RNLocationAndroid".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class RNLocationAndroid
21
+ @DoNotStrip
22
+ @Keep
23
+ constructor(
24
+ @DoNotStrip
25
+ @Keep
26
+ val provider: String?,
27
+ @DoNotStrip
28
+ @Keep
29
+ val elapsedRealtimeNanos: Double?,
30
+ @DoNotStrip
31
+ @Keep
32
+ val bearingAccuracyDegrees: Double?,
33
+ @DoNotStrip
34
+ @Keep
35
+ val speedAccuracyMetersPerSecond: Double?,
36
+ @DoNotStrip
37
+ @Keep
38
+ val verticalAccuracyMeters: Double?,
39
+ @DoNotStrip
40
+ @Keep
41
+ val mslAltitudeMeters: Double?,
42
+ @DoNotStrip
43
+ @Keep
44
+ val mslAltitudeAccuracyMeters: Double?,
45
+ @DoNotStrip
46
+ @Keep
47
+ val isMock: Boolean?
48
+ ) {
49
+ /* main constructor */
50
+ }
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// RNLocationIOS.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 "RNLocationIOS".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class RNLocationIOS
21
+ @DoNotStrip
22
+ @Keep
23
+ constructor(
24
+ @DoNotStrip
25
+ @Keep
26
+ val horizontalAccuracy: Double?,
27
+ @DoNotStrip
28
+ @Keep
29
+ val verticalAccuracy: Double?,
30
+ @DoNotStrip
31
+ @Keep
32
+ val speedAccuracy: Double?,
33
+ @DoNotStrip
34
+ @Keep
35
+ val courseAccuracy: Double?,
36
+ @DoNotStrip
37
+ @Keep
38
+ val floor: Double?,
39
+ @DoNotStrip
40
+ @Keep
41
+ val isFromMockProvider: Boolean?,
42
+ @DoNotStrip
43
+ @Keep
44
+ val timestamp: Double?
45
+ ) {
46
+ /* main constructor */
47
+ }
@@ -31,18 +31,23 @@ open class HybridRNGoogleMapsPlusViewManager: SimpleViewManager<View>() {
31
31
  return view
32
32
  }
33
33
 
34
+
34
35
  override fun onDropViewInstance(view: View) {
35
36
  super.onDropViewInstance(view)
36
37
  views.remove(view)
38
+ /// added by nitrogen-patch.js
39
+ if (view is GoogleMapsViewImpl) {
40
+ view.destroyInternal()
41
+ }
37
42
  }
38
43
 
39
-
40
44
  /// added by nitrogen-patch.js
41
45
  override fun prepareToRecycleView(reactContext: ThemedReactContext, view: View): View? {
42
46
  return null
43
47
  }
44
48
 
45
- override fun updateState(view: View, props: ReactStylesDiffMap, stateWrapper: StateWrapper): Any? {
49
+
50
+ override fun updateState(view: View, props: ReactStylesDiffMap, stateWrapper: StateWrapper): Any? {
46
51
  val hybridView = views[view] ?: throw Error("Couldn't find view $view in local views table!")
47
52
 
48
53
  // 1. Update each prop individually
@@ -50,10 +50,14 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
50
50
  namespace margelo::nitro::rngooglemapsplus { enum class RNLineCapType; }
51
51
  // Forward declaration of `RNLineJoinType` to properly resolve imports.
52
52
  namespace margelo::nitro::rngooglemapsplus { enum class RNLineJoinType; }
53
+ // Forward declaration of `RNLocationAndroid` to properly resolve imports.
54
+ namespace margelo::nitro::rngooglemapsplus { struct RNLocationAndroid; }
53
55
  // Forward declaration of `RNLocationConfig` to properly resolve imports.
54
56
  namespace margelo::nitro::rngooglemapsplus { struct RNLocationConfig; }
55
57
  // Forward declaration of `RNLocationErrorCode` to properly resolve imports.
56
58
  namespace margelo::nitro::rngooglemapsplus { enum class RNLocationErrorCode; }
59
+ // Forward declaration of `RNLocationIOS` to properly resolve imports.
60
+ namespace margelo::nitro::rngooglemapsplus { struct RNLocationIOS; }
57
61
  // Forward declaration of `RNLocationPermissionResult` to properly resolve imports.
58
62
  namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult; }
59
63
  // Forward declaration of `RNLocation` to properly resolve imports.
@@ -116,8 +120,10 @@ namespace RNGoogleMapsPlus { class HybridRNGoogleMapsPlusViewSpec_cxx; }
116
120
  #include "RNLineCapType.hpp"
117
121
  #include "RNLineJoinType.hpp"
118
122
  #include "RNLocation.hpp"
123
+ #include "RNLocationAndroid.hpp"
119
124
  #include "RNLocationConfig.hpp"
120
125
  #include "RNLocationErrorCode.hpp"
126
+ #include "RNLocationIOS.hpp"
121
127
  #include "RNLocationPermissionResult.hpp"
122
128
  #include "RNMapErrorCode.hpp"
123
129
  #include "RNMapPadding.hpp"
@@ -891,6 +897,36 @@ namespace margelo::nitro::rngooglemapsplus::bridge::swift {
891
897
  return *optional;
892
898
  }
893
899
 
900
+ // pragma MARK: std::optional<RNLocationAndroid>
901
+ /**
902
+ * Specialized version of `std::optional<RNLocationAndroid>`.
903
+ */
904
+ using std__optional_RNLocationAndroid_ = std::optional<RNLocationAndroid>;
905
+ inline std::optional<RNLocationAndroid> create_std__optional_RNLocationAndroid_(const RNLocationAndroid& value) noexcept {
906
+ return std::optional<RNLocationAndroid>(value);
907
+ }
908
+ inline bool has_value_std__optional_RNLocationAndroid_(const std::optional<RNLocationAndroid>& optional) noexcept {
909
+ return optional.has_value();
910
+ }
911
+ inline RNLocationAndroid get_std__optional_RNLocationAndroid_(const std::optional<RNLocationAndroid>& optional) noexcept {
912
+ return *optional;
913
+ }
914
+
915
+ // pragma MARK: std::optional<RNLocationIOS>
916
+ /**
917
+ * Specialized version of `std::optional<RNLocationIOS>`.
918
+ */
919
+ using std__optional_RNLocationIOS_ = std::optional<RNLocationIOS>;
920
+ inline std::optional<RNLocationIOS> create_std__optional_RNLocationIOS_(const RNLocationIOS& value) noexcept {
921
+ return std::optional<RNLocationIOS>(value);
922
+ }
923
+ inline bool has_value_std__optional_RNLocationIOS_(const std::optional<RNLocationIOS>& optional) noexcept {
924
+ return optional.has_value();
925
+ }
926
+ inline RNLocationIOS get_std__optional_RNLocationIOS_(const std::optional<RNLocationIOS>& optional) noexcept {
927
+ return *optional;
928
+ }
929
+
894
930
  // pragma MARK: std::function<void(const RNLocation& /* location */)>
895
931
  /**
896
932
  * Specialized version of `std::function<void(const RNLocation&)>`.
@@ -50,10 +50,14 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
50
50
  namespace margelo::nitro::rngooglemapsplus { enum class RNLineCapType; }
51
51
  // Forward declaration of `RNLineJoinType` to properly resolve imports.
52
52
  namespace margelo::nitro::rngooglemapsplus { enum class RNLineJoinType; }
53
+ // Forward declaration of `RNLocationAndroid` to properly resolve imports.
54
+ namespace margelo::nitro::rngooglemapsplus { struct RNLocationAndroid; }
53
55
  // Forward declaration of `RNLocationConfig` to properly resolve imports.
54
56
  namespace margelo::nitro::rngooglemapsplus { struct RNLocationConfig; }
55
57
  // Forward declaration of `RNLocationErrorCode` to properly resolve imports.
56
58
  namespace margelo::nitro::rngooglemapsplus { enum class RNLocationErrorCode; }
59
+ // Forward declaration of `RNLocationIOS` to properly resolve imports.
60
+ namespace margelo::nitro::rngooglemapsplus { struct RNLocationIOS; }
57
61
  // Forward declaration of `RNLocationPermissionResult` to properly resolve imports.
58
62
  namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult; }
59
63
  // Forward declaration of `RNLocation` to properly resolve imports.
@@ -116,8 +120,10 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNUserInterfaceStyle; }
116
120
  #include "RNLineCapType.hpp"
117
121
  #include "RNLineJoinType.hpp"
118
122
  #include "RNLocation.hpp"
123
+ #include "RNLocationAndroid.hpp"
119
124
  #include "RNLocationConfig.hpp"
120
125
  #include "RNLocationErrorCode.hpp"
126
+ #include "RNLocationIOS.hpp"
121
127
  #include "RNLocationPermissionResult.hpp"
122
128
  #include "RNMapErrorCode.hpp"
123
129
  #include "RNMapPadding.hpp"
@@ -68,6 +68,10 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSLocationAccuracy; }
68
68
  namespace margelo::nitro::rngooglemapsplus { enum class RNMapErrorCode; }
69
69
  // Forward declaration of `RNLocation` to properly resolve imports.
70
70
  namespace margelo::nitro::rngooglemapsplus { struct RNLocation; }
71
+ // Forward declaration of `RNLocationAndroid` to properly resolve imports.
72
+ namespace margelo::nitro::rngooglemapsplus { struct RNLocationAndroid; }
73
+ // Forward declaration of `RNLocationIOS` to properly resolve imports.
74
+ namespace margelo::nitro::rngooglemapsplus { struct RNLocationIOS; }
71
75
  // Forward declaration of `RNLocationErrorCode` to properly resolve imports.
72
76
  namespace margelo::nitro::rngooglemapsplus { enum class RNLocationErrorCode; }
73
77
  // Forward declaration of `RNIndoorBuilding` to properly resolve imports.
@@ -125,6 +129,8 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSPermissionResult; }
125
129
  #include "RNMapErrorCode.hpp"
126
130
  #include <functional>
127
131
  #include "RNLocation.hpp"
132
+ #include "RNLocationAndroid.hpp"
133
+ #include "RNLocationIOS.hpp"
128
134
  #include "RNLocationErrorCode.hpp"
129
135
  #include "RNIndoorBuilding.hpp"
130
136
  #include "RNIndoorLevel.hpp"
@@ -55,6 +55,14 @@ using namespace margelo::nitro::rngooglemapsplus::views;
55
55
  return NO;
56
56
  }
57
57
 
58
+ /// added by nitrogen-patch.js
59
+ - (void)dealloc {
60
+ if (_hybridView) {
61
+ RNGoogleMapsPlus::HybridRNGoogleMapsPlusViewSpec_cxx& swiftPart = _hybridView->getSwiftPart();
62
+ swiftPart.dispose();
63
+ _hybridView.reset();
64
+ }
65
+ }
58
66
 
59
67
  - (void) updateView {
60
68
  // 1. Get Swift part
@@ -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
  }