react-native-google-maps-plus 1.7.0-dev.6 → 1.7.0-dev.8
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 +354 -487
- package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +2 -1
- package/android/src/main/java/com/rngooglemapsplus/MapHeatmapBuilder.kt +1 -1
- package/android/src/main/java/com/rngooglemapsplus/MapHelper.kt +22 -0
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +4 -2
- package/android/src/main/java/com/rngooglemapsplus/MapPolygonBuilder.kt +2 -1
- package/android/src/main/java/com/rngooglemapsplus/MapPolylineBuilder.kt.kt +2 -1
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +11 -22
- package/ios/GoogleMapViewImpl.swift +8 -2
- package/ios/MapCircleBuilder.swift +2 -0
- package/ios/MapHeatmapBuilder.swift +2 -1
- package/ios/MapMarkerBuilder.swift +4 -0
- package/ios/MapPolygonBuilder.swift +2 -0
- package/ios/MapPolylineBuilder.swift +2 -0
- package/ios/MapUrlTileOverlayBuilder.swift +1 -0
- package/ios/RNGoogleMapsPlusView.swift +5 -5
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.cpp +2 -0
- package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera.hpp +83 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +19 -18
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNRegion_RNCamera.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +3 -3
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +29 -7
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +8 -8
- package/nitrogen/generated/ios/swift/Func_void_RNRegion_RNCamera.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +12 -12
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +8 -8
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +2 -2
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +3 -3
- package/package.json +4 -2
- package/src/RNGoogleMapsPlusView.nitro.ts +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_RNRegion_RNCamera.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.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.*
|
|
14
|
+
import dalvik.annotation.optimization.FastNative
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Represents the JavaScript callback `(region: struct, camera: struct) => void`.
|
|
19
|
+
* This can be either implemented in C++ (in which case it might be a callback coming from JS),
|
|
20
|
+
* or in Kotlin/Java (in which case it is a native callback).
|
|
21
|
+
*/
|
|
22
|
+
@DoNotStrip
|
|
23
|
+
@Keep
|
|
24
|
+
@Suppress("ClassName", "RedundantUnitReturnType")
|
|
25
|
+
fun interface Func_void_RNRegion_RNCamera: (RNRegion, RNCamera) -> Unit {
|
|
26
|
+
/**
|
|
27
|
+
* Call the given JS callback.
|
|
28
|
+
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
|
|
29
|
+
*/
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
override fun invoke(region: RNRegion, camera: RNCamera): Unit
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Represents the JavaScript callback `(region: struct, camera: struct) => void`.
|
|
37
|
+
* This is implemented in C++, via a `std::function<...>`.
|
|
38
|
+
* The callback might be coming from JS.
|
|
39
|
+
*/
|
|
40
|
+
@DoNotStrip
|
|
41
|
+
@Keep
|
|
42
|
+
@Suppress(
|
|
43
|
+
"KotlinJniMissingFunction", "unused",
|
|
44
|
+
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
45
|
+
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
46
|
+
)
|
|
47
|
+
class Func_void_RNRegion_RNCamera_cxx: Func_void_RNRegion_RNCamera {
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
private val mHybridData: HybridData
|
|
51
|
+
|
|
52
|
+
@DoNotStrip
|
|
53
|
+
@Keep
|
|
54
|
+
private constructor(hybridData: HybridData) {
|
|
55
|
+
mHybridData = hybridData
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@DoNotStrip
|
|
59
|
+
@Keep
|
|
60
|
+
override fun invoke(region: RNRegion, camera: RNCamera): Unit
|
|
61
|
+
= invoke_cxx(region,camera)
|
|
62
|
+
|
|
63
|
+
@FastNative
|
|
64
|
+
private external fun invoke_cxx(region: RNRegion, camera: RNCamera): Unit
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Represents the JavaScript callback `(region: struct, camera: struct) => void`.
|
|
69
|
+
* This is implemented in Java/Kotlin, via a `(RNRegion, RNCamera) -> Unit`.
|
|
70
|
+
* The callback is always coming from native.
|
|
71
|
+
*/
|
|
72
|
+
@DoNotStrip
|
|
73
|
+
@Keep
|
|
74
|
+
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
|
|
75
|
+
class Func_void_RNRegion_RNCamera_java(private val function: (RNRegion, RNCamera) -> Unit): Func_void_RNRegion_RNCamera {
|
|
76
|
+
@DoNotStrip
|
|
77
|
+
@Keep
|
|
78
|
+
override fun invoke(region: RNRegion, camera: RNCamera): Unit {
|
|
79
|
+
return this.function(region, camera)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -180,13 +180,13 @@ abstract class HybridRNGoogleMapsPlusViewSpec: HybridView() {
|
|
|
180
180
|
onMapReady = value?.let { it }
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
abstract var onMapLoaded: ((
|
|
183
|
+
abstract var onMapLoaded: ((region: RNRegion, camera: RNCamera) -> Unit)?
|
|
184
184
|
|
|
185
|
-
private var onMapLoaded_cxx:
|
|
185
|
+
private var onMapLoaded_cxx: Func_void_RNRegion_RNCamera?
|
|
186
186
|
@Keep
|
|
187
187
|
@DoNotStrip
|
|
188
188
|
get() {
|
|
189
|
-
return onMapLoaded?.let {
|
|
189
|
+
return onMapLoaded?.let { Func_void_RNRegion_RNCamera_java(it) }
|
|
190
190
|
}
|
|
191
191
|
@Keep
|
|
192
192
|
@DoNotStrip
|
|
@@ -62,6 +62,14 @@ namespace margelo::nitro::rngooglemapsplus::bridge::swift {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
// pragma MARK: std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>
|
|
66
|
+
Func_void_RNRegion_RNCamera create_Func_void_RNRegion_RNCamera(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
67
|
+
auto swiftClosure = RNGoogleMapsPlus::Func_void_RNRegion_RNCamera::fromUnsafe(swiftClosureWrapper);
|
|
68
|
+
return [swiftClosure = std::move(swiftClosure)](const RNRegion& region, const RNCamera& camera) mutable -> void {
|
|
69
|
+
swiftClosure.call(region, camera);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
65
73
|
// pragma MARK: std::function<void(const RNLocation& /* location */)>
|
|
66
74
|
Func_void_RNLocation create_Func_void_RNLocation(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
67
75
|
auto swiftClosure = RNGoogleMapsPlus::Func_void_RNLocation::fromUnsafe(swiftClosureWrapper);
|
|
@@ -926,18 +926,40 @@ namespace margelo::nitro::rngooglemapsplus::bridge::swift {
|
|
|
926
926
|
return *optional;
|
|
927
927
|
}
|
|
928
928
|
|
|
929
|
-
// pragma MARK: std::
|
|
929
|
+
// pragma MARK: std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>
|
|
930
930
|
/**
|
|
931
|
-
* Specialized version of `std::
|
|
931
|
+
* Specialized version of `std::function<void(const RNRegion&, const RNCamera&)>`.
|
|
932
932
|
*/
|
|
933
|
-
using
|
|
934
|
-
|
|
935
|
-
|
|
933
|
+
using Func_void_RNRegion_RNCamera = std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>;
|
|
934
|
+
/**
|
|
935
|
+
* Wrapper class for a `std::function<void(const RNRegion& / * region * /, const RNCamera& / * camera * /)>`, this can be used from Swift.
|
|
936
|
+
*/
|
|
937
|
+
class Func_void_RNRegion_RNCamera_Wrapper final {
|
|
938
|
+
public:
|
|
939
|
+
explicit Func_void_RNRegion_RNCamera_Wrapper(std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>&& func): _function(std::make_unique<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>(std::move(func))) {}
|
|
940
|
+
inline void call(RNRegion region, RNCamera camera) const noexcept {
|
|
941
|
+
_function->operator()(region, camera);
|
|
942
|
+
}
|
|
943
|
+
private:
|
|
944
|
+
std::unique_ptr<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>> _function;
|
|
945
|
+
} SWIFT_NONCOPYABLE;
|
|
946
|
+
Func_void_RNRegion_RNCamera create_Func_void_RNRegion_RNCamera(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
947
|
+
inline Func_void_RNRegion_RNCamera_Wrapper wrap_Func_void_RNRegion_RNCamera(Func_void_RNRegion_RNCamera value) noexcept {
|
|
948
|
+
return Func_void_RNRegion_RNCamera_Wrapper(std::move(value));
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// pragma MARK: std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>
|
|
952
|
+
/**
|
|
953
|
+
* Specialized version of `std::optional<std::function<void(const RNRegion& / * region * /, const RNCamera& / * camera * /)>>`.
|
|
954
|
+
*/
|
|
955
|
+
using std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______ = std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>;
|
|
956
|
+
inline std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>> create_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______(const std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>& value) noexcept {
|
|
957
|
+
return std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>(value);
|
|
936
958
|
}
|
|
937
|
-
inline bool
|
|
959
|
+
inline bool has_value_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>& optional) noexcept {
|
|
938
960
|
return optional.has_value();
|
|
939
961
|
}
|
|
940
|
-
inline std::function<void(
|
|
962
|
+
inline std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)> get_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>& optional) noexcept {
|
|
941
963
|
return *optional;
|
|
942
964
|
}
|
|
943
965
|
|
|
@@ -68,6 +68,10 @@ namespace margelo::nitro::rngooglemapsplus { struct RNIOSLocationConfig; }
|
|
|
68
68
|
namespace margelo::nitro::rngooglemapsplus { enum class RNIOSLocationAccuracy; }
|
|
69
69
|
// Forward declaration of `RNMapErrorCode` to properly resolve imports.
|
|
70
70
|
namespace margelo::nitro::rngooglemapsplus { enum class RNMapErrorCode; }
|
|
71
|
+
// Forward declaration of `RNRegion` to properly resolve imports.
|
|
72
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
|
|
73
|
+
// Forward declaration of `RNLatLngBounds` to properly resolve imports.
|
|
74
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLatLngBounds; }
|
|
71
75
|
// Forward declaration of `RNLocation` to properly resolve imports.
|
|
72
76
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocation; }
|
|
73
77
|
// Forward declaration of `RNLocationAndroid` to properly resolve imports.
|
|
@@ -80,10 +84,6 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNLocationErrorCode; }
|
|
|
80
84
|
namespace margelo::nitro::rngooglemapsplus { struct RNIndoorBuilding; }
|
|
81
85
|
// Forward declaration of `RNIndoorLevel` to properly resolve imports.
|
|
82
86
|
namespace margelo::nitro::rngooglemapsplus { struct RNIndoorLevel; }
|
|
83
|
-
// Forward declaration of `RNRegion` to properly resolve imports.
|
|
84
|
-
namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
|
|
85
|
-
// Forward declaration of `RNLatLngBounds` to properly resolve imports.
|
|
86
|
-
namespace margelo::nitro::rngooglemapsplus { struct RNLatLngBounds; }
|
|
87
87
|
// Forward declaration of `RNSnapshotOptions` to properly resolve imports.
|
|
88
88
|
namespace margelo::nitro::rngooglemapsplus { struct RNSnapshotOptions; }
|
|
89
89
|
// Forward declaration of `RNSize` to properly resolve imports.
|
|
@@ -131,14 +131,14 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSPermissionResult; }
|
|
|
131
131
|
#include "RNIOSLocationAccuracy.hpp"
|
|
132
132
|
#include "RNMapErrorCode.hpp"
|
|
133
133
|
#include <functional>
|
|
134
|
+
#include "RNRegion.hpp"
|
|
135
|
+
#include "RNLatLngBounds.hpp"
|
|
134
136
|
#include "RNLocation.hpp"
|
|
135
137
|
#include "RNLocationAndroid.hpp"
|
|
136
138
|
#include "RNLocationIOS.hpp"
|
|
137
139
|
#include "RNLocationErrorCode.hpp"
|
|
138
140
|
#include "RNIndoorBuilding.hpp"
|
|
139
141
|
#include "RNIndoorLevel.hpp"
|
|
140
|
-
#include "RNRegion.hpp"
|
|
141
|
-
#include "RNLatLngBounds.hpp"
|
|
142
142
|
#include <NitroModules/Promise.hpp>
|
|
143
143
|
#include "RNSnapshotOptions.hpp"
|
|
144
144
|
#include "RNSize.hpp"
|
|
@@ -332,11 +332,11 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
332
332
|
inline void setOnMapReady(const std::optional<std::function<void(bool /* ready */)>>& onMapReady) noexcept override {
|
|
333
333
|
_swiftPart.setOnMapReady(onMapReady);
|
|
334
334
|
}
|
|
335
|
-
inline std::optional<std::function<void(
|
|
335
|
+
inline std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>> getOnMapLoaded() noexcept override {
|
|
336
336
|
auto __result = _swiftPart.getOnMapLoaded();
|
|
337
337
|
return __result;
|
|
338
338
|
}
|
|
339
|
-
inline void setOnMapLoaded(const std::optional<std::function<void(
|
|
339
|
+
inline void setOnMapLoaded(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>& onMapLoaded) noexcept override {
|
|
340
340
|
_swiftPart.setOnMapLoaded(onMapLoaded);
|
|
341
341
|
}
|
|
342
342
|
inline std::optional<std::function<void(const RNLocation& /* location */)>> getOnLocationUpdate() noexcept override {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_RNRegion_RNCamera.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
|
+
/**
|
|
12
|
+
* Wraps a Swift `(_ region: RNRegion, _ camera: RNCamera) -> Void` as a class.
|
|
13
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
+
*/
|
|
15
|
+
public final class Func_void_RNRegion_RNCamera {
|
|
16
|
+
public typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
private let closure: (_ region: RNRegion, _ camera: RNCamera) -> Void
|
|
19
|
+
|
|
20
|
+
public init(_ closure: @escaping (_ region: RNRegion, _ camera: RNCamera) -> Void) {
|
|
21
|
+
self.closure = closure
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@inline(__always)
|
|
25
|
+
public func call(region: RNRegion, camera: RNCamera) -> Void {
|
|
26
|
+
self.closure(region, camera)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
+
* This acquires one additional strong reference on the object!
|
|
32
|
+
*/
|
|
33
|
+
@inline(__always)
|
|
34
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Casts an unsafe pointer to a `Func_void_RNRegion_RNCamera`.
|
|
40
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_RNRegion_RNCamera>`.
|
|
41
|
+
* This removes one strong reference from the object!
|
|
42
|
+
*/
|
|
43
|
+
@inline(__always)
|
|
44
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_RNRegion_RNCamera {
|
|
45
|
+
return Unmanaged<Func_void_RNRegion_RNCamera>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -32,7 +32,7 @@ public protocol HybridRNGoogleMapsPlusViewSpec_protocol: HybridObject, HybridVie
|
|
|
32
32
|
var locationConfig: RNLocationConfig? { get set }
|
|
33
33
|
var onMapError: ((_ error: RNMapErrorCode) -> Void)? { get set }
|
|
34
34
|
var onMapReady: ((_ ready: Bool) -> Void)? { get set }
|
|
35
|
-
var onMapLoaded: ((_
|
|
35
|
+
var onMapLoaded: ((_ region: RNRegion, _ camera: RNCamera) -> Void)? { get set }
|
|
36
36
|
var onLocationUpdate: ((_ location: RNLocation) -> Void)? { get set }
|
|
37
37
|
var onLocationError: ((_ error: RNLocationErrorCode) -> Void)? { get set }
|
|
38
38
|
var onMapPress: ((_ coordinate: RNLatLng) -> Void)? { get set }
|
|
@@ -619,14 +619,14 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
-
public final var onMapLoaded: bridge.
|
|
622
|
+
public final var onMapLoaded: bridge.std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______ {
|
|
623
623
|
@inline(__always)
|
|
624
624
|
get {
|
|
625
|
-
return { () -> bridge.
|
|
625
|
+
return { () -> bridge.std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______ in
|
|
626
626
|
if let __unwrappedValue = self.__implementation.onMapLoaded {
|
|
627
|
-
return bridge.
|
|
628
|
-
let __closureWrapper =
|
|
629
|
-
return bridge.
|
|
627
|
+
return bridge.create_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______({ () -> bridge.Func_void_RNRegion_RNCamera in
|
|
628
|
+
let __closureWrapper = Func_void_RNRegion_RNCamera(__unwrappedValue)
|
|
629
|
+
return bridge.create_Func_void_RNRegion_RNCamera(__closureWrapper.toUnsafe())
|
|
630
630
|
}())
|
|
631
631
|
} else {
|
|
632
632
|
return .init()
|
|
@@ -635,13 +635,13 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
635
635
|
}
|
|
636
636
|
@inline(__always)
|
|
637
637
|
set {
|
|
638
|
-
self.__implementation.onMapLoaded = { () -> ((_
|
|
639
|
-
if bridge.
|
|
640
|
-
let __unwrapped = bridge.
|
|
641
|
-
return { () -> (
|
|
642
|
-
let __wrappedFunction = bridge.
|
|
643
|
-
return { (
|
|
644
|
-
__wrappedFunction.call(
|
|
638
|
+
self.__implementation.onMapLoaded = { () -> ((_ region: RNRegion, _ camera: RNCamera) -> Void)? in
|
|
639
|
+
if bridge.has_value_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______(newValue) {
|
|
640
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_RNRegion_____region_____const_RNCamera_____camera______(newValue)
|
|
641
|
+
return { () -> (RNRegion, RNCamera) -> Void in
|
|
642
|
+
let __wrappedFunction = bridge.wrap_Func_void_RNRegion_RNCamera(__unwrapped)
|
|
643
|
+
return { (__region: RNRegion, __camera: RNCamera) -> Void in
|
|
644
|
+
__wrappedFunction.call(__region, __camera)
|
|
645
645
|
}
|
|
646
646
|
}()
|
|
647
647
|
} else {
|
|
@@ -43,6 +43,10 @@ namespace margelo::nitro::rngooglemapsplus { struct RNUrlTileOverlay; }
|
|
|
43
43
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocationConfig; }
|
|
44
44
|
// Forward declaration of `RNMapErrorCode` to properly resolve imports.
|
|
45
45
|
namespace margelo::nitro::rngooglemapsplus { enum class RNMapErrorCode; }
|
|
46
|
+
// Forward declaration of `RNRegion` to properly resolve imports.
|
|
47
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
|
|
48
|
+
// Forward declaration of `RNCamera` to properly resolve imports.
|
|
49
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
|
|
46
50
|
// Forward declaration of `RNLocation` to properly resolve imports.
|
|
47
51
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocation; }
|
|
48
52
|
// Forward declaration of `RNLocationErrorCode` to properly resolve imports.
|
|
@@ -53,10 +57,6 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
|
53
57
|
namespace margelo::nitro::rngooglemapsplus { struct RNIndoorBuilding; }
|
|
54
58
|
// Forward declaration of `RNIndoorLevel` to properly resolve imports.
|
|
55
59
|
namespace margelo::nitro::rngooglemapsplus { struct RNIndoorLevel; }
|
|
56
|
-
// Forward declaration of `RNRegion` to properly resolve imports.
|
|
57
|
-
namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
|
|
58
|
-
// Forward declaration of `RNCamera` to properly resolve imports.
|
|
59
|
-
namespace margelo::nitro::rngooglemapsplus { struct RNCamera; }
|
|
60
60
|
// Forward declaration of `RNLatLngBounds` to properly resolve imports.
|
|
61
61
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLngBounds; }
|
|
62
62
|
// Forward declaration of `RNSnapshotOptions` to properly resolve imports.
|
|
@@ -83,13 +83,13 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult;
|
|
|
83
83
|
#include "RNLocationConfig.hpp"
|
|
84
84
|
#include "RNMapErrorCode.hpp"
|
|
85
85
|
#include <functional>
|
|
86
|
+
#include "RNRegion.hpp"
|
|
87
|
+
#include "RNCamera.hpp"
|
|
86
88
|
#include "RNLocation.hpp"
|
|
87
89
|
#include "RNLocationErrorCode.hpp"
|
|
88
90
|
#include "RNLatLng.hpp"
|
|
89
91
|
#include "RNIndoorBuilding.hpp"
|
|
90
92
|
#include "RNIndoorLevel.hpp"
|
|
91
|
-
#include "RNRegion.hpp"
|
|
92
|
-
#include "RNCamera.hpp"
|
|
93
93
|
#include "RNLatLngBounds.hpp"
|
|
94
94
|
#include <NitroModules/Promise.hpp>
|
|
95
95
|
#include "RNSnapshotOptions.hpp"
|
|
@@ -164,8 +164,8 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
164
164
|
virtual void setOnMapError(const std::optional<std::function<void(RNMapErrorCode /* error */)>>& onMapError) = 0;
|
|
165
165
|
virtual std::optional<std::function<void(bool /* ready */)>> getOnMapReady() = 0;
|
|
166
166
|
virtual void setOnMapReady(const std::optional<std::function<void(bool /* ready */)>>& onMapReady) = 0;
|
|
167
|
-
virtual std::optional<std::function<void(
|
|
168
|
-
virtual void setOnMapLoaded(const std::optional<std::function<void(
|
|
167
|
+
virtual std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>> getOnMapLoaded() = 0;
|
|
168
|
+
virtual void setOnMapLoaded(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>& onMapLoaded) = 0;
|
|
169
169
|
virtual std::optional<std::function<void(const RNLocation& /* location */)>> getOnLocationUpdate() = 0;
|
|
170
170
|
virtual void setOnLocationUpdate(const std::optional<std::function<void(const RNLocation& /* location */)>>& onLocationUpdate) = 0;
|
|
171
171
|
virtual std::optional<std::function<void(RNLocationErrorCode /* error */)>> getOnLocationError() = 0;
|
|
@@ -235,12 +235,12 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
235
235
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapReady: ") + exc.what());
|
|
236
236
|
}
|
|
237
237
|
}()),
|
|
238
|
-
onMapLoaded([&]() -> CachedProp<std::optional<std::function<void(
|
|
238
|
+
onMapLoaded([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>> {
|
|
239
239
|
try {
|
|
240
240
|
const react::RawValue* rawValue = rawProps.at("onMapLoaded", nullptr, nullptr);
|
|
241
241
|
if (rawValue == nullptr) return sourceProps.onMapLoaded;
|
|
242
242
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
243
|
-
return CachedProp<std::optional<std::function<void(
|
|
243
|
+
return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMapLoaded);
|
|
244
244
|
} catch (const std::exception& exc) {
|
|
245
245
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapLoaded: ") + exc.what());
|
|
246
246
|
}
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
#include "RNLocationConfig.hpp"
|
|
36
36
|
#include "RNMapErrorCode.hpp"
|
|
37
37
|
#include <functional>
|
|
38
|
+
#include "RNRegion.hpp"
|
|
39
|
+
#include "RNCamera.hpp"
|
|
38
40
|
#include "RNLocation.hpp"
|
|
39
41
|
#include "RNLocationErrorCode.hpp"
|
|
40
42
|
#include "RNLatLng.hpp"
|
|
41
43
|
#include "RNIndoorBuilding.hpp"
|
|
42
44
|
#include "RNIndoorLevel.hpp"
|
|
43
|
-
#include "RNRegion.hpp"
|
|
44
|
-
#include "RNCamera.hpp"
|
|
45
45
|
#include <memory>
|
|
46
46
|
#include "HybridRNGoogleMapsPlusViewSpec.hpp"
|
|
47
47
|
|
|
@@ -87,7 +87,7 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
87
87
|
CachedProp<std::optional<RNLocationConfig>> locationConfig;
|
|
88
88
|
CachedProp<std::optional<std::function<void(RNMapErrorCode /* error */)>>> onMapError;
|
|
89
89
|
CachedProp<std::optional<std::function<void(bool /* ready */)>>> onMapReady;
|
|
90
|
-
CachedProp<std::optional<std::function<void(
|
|
90
|
+
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>> onMapLoaded;
|
|
91
91
|
CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>> onLocationUpdate;
|
|
92
92
|
CachedProp<std::optional<std::function<void(RNLocationErrorCode /* error */)>>> onLocationError;
|
|
93
93
|
CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>> onMapPress;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-google-maps-plus",
|
|
3
|
-
"version": "1.7.0-dev.
|
|
3
|
+
"version": "1.7.0-dev.8",
|
|
4
4
|
"description": "React Native wrapper for Android & iOS Google Maps SDK",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
"source": "src/index",
|
|
9
9
|
"react-native": "src/index",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"typecheck": "tsc --noEmit",
|
|
11
|
+
"typecheck:lib": "tsc --noEmit -p tsconfig.json",
|
|
12
|
+
"typecheck:example": "tsc --noEmit -p example/tsconfig.json",
|
|
13
|
+
"typecheck": "yarn typecheck:lib && yarn typecheck:example",
|
|
12
14
|
"lint": "yarn lint:js && yarn lint:android && yarn lint:ios",
|
|
13
15
|
"lint:js": "eslint . --max-warnings 0 && yarn prettier --check .",
|
|
14
16
|
"lint:android": "cd android && ktlint -F ./**/*.kt*",
|
|
@@ -53,7 +53,7 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
|
|
|
53
53
|
locationConfig?: RNLocationConfig;
|
|
54
54
|
onMapError?: (error: RNMapErrorCode) => void;
|
|
55
55
|
onMapReady?: (ready: boolean) => void;
|
|
56
|
-
onMapLoaded?: (
|
|
56
|
+
onMapLoaded?: (region: RNRegion, camera: RNCamera) => void;
|
|
57
57
|
onLocationUpdate?: (location: RNLocation) => void;
|
|
58
58
|
onLocationError?: (error: RNLocationErrorCode) => void;
|
|
59
59
|
onMapPress?: (coordinate: RNLatLng) => void;
|