react-native-google-maps-plus 1.6.2 → 1.7.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.
- package/android/proguard-rules.pro +29 -0
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +64 -2
- package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +2 -0
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +39 -0
- package/android/src/main/java/com/rngooglemapsplus/MapUrlTileOverlayBuilder.kt +40 -0
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +27 -3
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNMapTypeExtension.kt +13 -0
- package/ios/GoogleMapViewImpl.swift +59 -2
- package/ios/MapUrlTileOverlayBuilder.swift +23 -0
- package/ios/RNGoogleMapsPlusView.swift +34 -3
- package/ios/extensions/RNMapType+Extension.swift +18 -0
- package/lib/module/types.js.map +1 -1
- package/lib/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +3 -0
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +4 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +8 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +68 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +6 -0
- package/nitrogen/generated/android/c++/JRNUrlTileOverlay.hpp +78 -0
- package/nitrogen/generated/android/c++/views/JHybridRNGoogleMapsPlusViewStateUpdater.cpp +12 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNUrlTileOverlay.kt +52 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +44 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +24 -0
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +15 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +3 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +94 -0
- package/nitrogen/generated/ios/swift/RNUrlTileOverlay.swift +133 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +6 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +9 -0
- package/nitrogen/generated/shared/c++/RNUrlTileOverlay.hpp +96 -0
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +36 -0
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +4 -0
- package/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +3 -0
- package/package.json +5 -4
- package/src/RNGoogleMapsPlusView.nitro.ts +4 -0
- package/src/types.ts +9 -0
|
@@ -508,6 +508,36 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
|
|
511
|
+
public final var urlTileOverlays: bridge.std__optional_std__vector_RNUrlTileOverlay__ {
|
|
512
|
+
@inline(__always)
|
|
513
|
+
get {
|
|
514
|
+
return { () -> bridge.std__optional_std__vector_RNUrlTileOverlay__ in
|
|
515
|
+
if let __unwrappedValue = self.__implementation.urlTileOverlays {
|
|
516
|
+
return bridge.create_std__optional_std__vector_RNUrlTileOverlay__({ () -> bridge.std__vector_RNUrlTileOverlay_ in
|
|
517
|
+
var __vector = bridge.create_std__vector_RNUrlTileOverlay_(__unwrappedValue.count)
|
|
518
|
+
for __item in __unwrappedValue {
|
|
519
|
+
__vector.push_back(__item)
|
|
520
|
+
}
|
|
521
|
+
return __vector
|
|
522
|
+
}())
|
|
523
|
+
} else {
|
|
524
|
+
return .init()
|
|
525
|
+
}
|
|
526
|
+
}()
|
|
527
|
+
}
|
|
528
|
+
@inline(__always)
|
|
529
|
+
set {
|
|
530
|
+
self.__implementation.urlTileOverlays = { () -> [RNUrlTileOverlay]? in
|
|
531
|
+
if bridge.has_value_std__optional_std__vector_RNUrlTileOverlay__(newValue) {
|
|
532
|
+
let __unwrapped = bridge.get_std__optional_std__vector_RNUrlTileOverlay__(newValue)
|
|
533
|
+
return __unwrapped.map({ __item in __item })
|
|
534
|
+
} else {
|
|
535
|
+
return nil
|
|
536
|
+
}
|
|
537
|
+
}()
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
511
541
|
public final var locationConfig: bridge.std__optional_RNLocationConfig_ {
|
|
512
542
|
@inline(__always)
|
|
513
543
|
get {
|
|
@@ -589,6 +619,38 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
589
619
|
}
|
|
590
620
|
}
|
|
591
621
|
|
|
622
|
+
public final var onMapLoaded: bridge.std__optional_std__function_void_bool____loaded______ {
|
|
623
|
+
@inline(__always)
|
|
624
|
+
get {
|
|
625
|
+
return { () -> bridge.std__optional_std__function_void_bool____loaded______ in
|
|
626
|
+
if let __unwrappedValue = self.__implementation.onMapLoaded {
|
|
627
|
+
return bridge.create_std__optional_std__function_void_bool____loaded______({ () -> bridge.Func_void_bool in
|
|
628
|
+
let __closureWrapper = Func_void_bool(__unwrappedValue)
|
|
629
|
+
return bridge.create_Func_void_bool(__closureWrapper.toUnsafe())
|
|
630
|
+
}())
|
|
631
|
+
} else {
|
|
632
|
+
return .init()
|
|
633
|
+
}
|
|
634
|
+
}()
|
|
635
|
+
}
|
|
636
|
+
@inline(__always)
|
|
637
|
+
set {
|
|
638
|
+
self.__implementation.onMapLoaded = { () -> ((_ loaded: Bool) -> Void)? in
|
|
639
|
+
if bridge.has_value_std__optional_std__function_void_bool____loaded______(newValue) {
|
|
640
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_bool____loaded______(newValue)
|
|
641
|
+
return { () -> (Bool) -> Void in
|
|
642
|
+
let __wrappedFunction = bridge.wrap_Func_void_bool(__unwrapped)
|
|
643
|
+
return { (__loaded: Bool) -> Void in
|
|
644
|
+
__wrappedFunction.call(__loaded)
|
|
645
|
+
}
|
|
646
|
+
}()
|
|
647
|
+
} else {
|
|
648
|
+
return nil
|
|
649
|
+
}
|
|
650
|
+
}()
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
592
654
|
public final var onLocationUpdate: bridge.std__optional_std__function_void_const_RNLocation_____location______ {
|
|
593
655
|
@inline(__always)
|
|
594
656
|
get {
|
|
@@ -685,6 +747,38 @@ open class HybridRNGoogleMapsPlusViewSpec_cxx {
|
|
|
685
747
|
}
|
|
686
748
|
}
|
|
687
749
|
|
|
750
|
+
public final var onMapLongPress: bridge.std__optional_std__function_void_const_RNLatLng_____coordinate______ {
|
|
751
|
+
@inline(__always)
|
|
752
|
+
get {
|
|
753
|
+
return { () -> bridge.std__optional_std__function_void_const_RNLatLng_____coordinate______ in
|
|
754
|
+
if let __unwrappedValue = self.__implementation.onMapLongPress {
|
|
755
|
+
return bridge.create_std__optional_std__function_void_const_RNLatLng_____coordinate______({ () -> bridge.Func_void_RNLatLng in
|
|
756
|
+
let __closureWrapper = Func_void_RNLatLng(__unwrappedValue)
|
|
757
|
+
return bridge.create_Func_void_RNLatLng(__closureWrapper.toUnsafe())
|
|
758
|
+
}())
|
|
759
|
+
} else {
|
|
760
|
+
return .init()
|
|
761
|
+
}
|
|
762
|
+
}()
|
|
763
|
+
}
|
|
764
|
+
@inline(__always)
|
|
765
|
+
set {
|
|
766
|
+
self.__implementation.onMapLongPress = { () -> ((_ coordinate: RNLatLng) -> Void)? in
|
|
767
|
+
if bridge.has_value_std__optional_std__function_void_const_RNLatLng_____coordinate______(newValue) {
|
|
768
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_RNLatLng_____coordinate______(newValue)
|
|
769
|
+
return { () -> (RNLatLng) -> Void in
|
|
770
|
+
let __wrappedFunction = bridge.wrap_Func_void_RNLatLng(__unwrapped)
|
|
771
|
+
return { (__coordinate: RNLatLng) -> Void in
|
|
772
|
+
__wrappedFunction.call(__coordinate)
|
|
773
|
+
}
|
|
774
|
+
}()
|
|
775
|
+
} else {
|
|
776
|
+
return nil
|
|
777
|
+
}
|
|
778
|
+
}()
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
688
782
|
public final var onMarkerPress: bridge.std__optional_std__function_void_const_std__optional_std__string______id______ {
|
|
689
783
|
@inline(__always)
|
|
690
784
|
get {
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNUrlTileOverlay.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 `RNUrlTileOverlay`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNUrlTileOverlay = margelo.nitro.rngooglemapsplus.RNUrlTileOverlay
|
|
14
|
+
|
|
15
|
+
public extension RNUrlTileOverlay {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNUrlTileOverlay`.
|
|
20
|
+
*/
|
|
21
|
+
init(id: String, zIndex: Double?, url: String, tileSize: Double, opacity: Double?, fadeIn: Bool?) {
|
|
22
|
+
self.init(std.string(id), { () -> bridge.std__optional_double_ in
|
|
23
|
+
if let __unwrappedValue = zIndex {
|
|
24
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), std.string(url), tileSize, { () -> bridge.std__optional_double_ in
|
|
29
|
+
if let __unwrappedValue = opacity {
|
|
30
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
35
|
+
if let __unwrappedValue = fadeIn {
|
|
36
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}())
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var id: String {
|
|
44
|
+
@inline(__always)
|
|
45
|
+
get {
|
|
46
|
+
return String(self.__id)
|
|
47
|
+
}
|
|
48
|
+
@inline(__always)
|
|
49
|
+
set {
|
|
50
|
+
self.__id = std.string(newValue)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var zIndex: Double? {
|
|
55
|
+
@inline(__always)
|
|
56
|
+
get {
|
|
57
|
+
return self.__zIndex.value
|
|
58
|
+
}
|
|
59
|
+
@inline(__always)
|
|
60
|
+
set {
|
|
61
|
+
self.__zIndex = { () -> bridge.std__optional_double_ in
|
|
62
|
+
if let __unwrappedValue = newValue {
|
|
63
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
64
|
+
} else {
|
|
65
|
+
return .init()
|
|
66
|
+
}
|
|
67
|
+
}()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
var url: String {
|
|
72
|
+
@inline(__always)
|
|
73
|
+
get {
|
|
74
|
+
return String(self.__url)
|
|
75
|
+
}
|
|
76
|
+
@inline(__always)
|
|
77
|
+
set {
|
|
78
|
+
self.__url = std.string(newValue)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var tileSize: Double {
|
|
83
|
+
@inline(__always)
|
|
84
|
+
get {
|
|
85
|
+
return self.__tileSize
|
|
86
|
+
}
|
|
87
|
+
@inline(__always)
|
|
88
|
+
set {
|
|
89
|
+
self.__tileSize = newValue
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
var opacity: Double? {
|
|
94
|
+
@inline(__always)
|
|
95
|
+
get {
|
|
96
|
+
return self.__opacity.value
|
|
97
|
+
}
|
|
98
|
+
@inline(__always)
|
|
99
|
+
set {
|
|
100
|
+
self.__opacity = { () -> bridge.std__optional_double_ in
|
|
101
|
+
if let __unwrappedValue = newValue {
|
|
102
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
103
|
+
} else {
|
|
104
|
+
return .init()
|
|
105
|
+
}
|
|
106
|
+
}()
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
var fadeIn: Bool? {
|
|
111
|
+
@inline(__always)
|
|
112
|
+
get {
|
|
113
|
+
return { () -> Bool? in
|
|
114
|
+
if bridge.has_value_std__optional_bool_(self.__fadeIn) {
|
|
115
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__fadeIn)
|
|
116
|
+
return __unwrapped
|
|
117
|
+
} else {
|
|
118
|
+
return nil
|
|
119
|
+
}
|
|
120
|
+
}()
|
|
121
|
+
}
|
|
122
|
+
@inline(__always)
|
|
123
|
+
set {
|
|
124
|
+
self.__fadeIn = { () -> bridge.std__optional_bool_ in
|
|
125
|
+
if let __unwrappedValue = newValue {
|
|
126
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
127
|
+
} else {
|
|
128
|
+
return .init()
|
|
129
|
+
}
|
|
130
|
+
}()
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -48,18 +48,24 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
48
48
|
prototype.registerHybridSetter("heatmaps", &HybridRNGoogleMapsPlusViewSpec::setHeatmaps);
|
|
49
49
|
prototype.registerHybridGetter("kmlLayers", &HybridRNGoogleMapsPlusViewSpec::getKmlLayers);
|
|
50
50
|
prototype.registerHybridSetter("kmlLayers", &HybridRNGoogleMapsPlusViewSpec::setKmlLayers);
|
|
51
|
+
prototype.registerHybridGetter("urlTileOverlays", &HybridRNGoogleMapsPlusViewSpec::getUrlTileOverlays);
|
|
52
|
+
prototype.registerHybridSetter("urlTileOverlays", &HybridRNGoogleMapsPlusViewSpec::setUrlTileOverlays);
|
|
51
53
|
prototype.registerHybridGetter("locationConfig", &HybridRNGoogleMapsPlusViewSpec::getLocationConfig);
|
|
52
54
|
prototype.registerHybridSetter("locationConfig", &HybridRNGoogleMapsPlusViewSpec::setLocationConfig);
|
|
53
55
|
prototype.registerHybridGetter("onMapError", &HybridRNGoogleMapsPlusViewSpec::getOnMapError);
|
|
54
56
|
prototype.registerHybridSetter("onMapError", &HybridRNGoogleMapsPlusViewSpec::setOnMapError);
|
|
55
57
|
prototype.registerHybridGetter("onMapReady", &HybridRNGoogleMapsPlusViewSpec::getOnMapReady);
|
|
56
58
|
prototype.registerHybridSetter("onMapReady", &HybridRNGoogleMapsPlusViewSpec::setOnMapReady);
|
|
59
|
+
prototype.registerHybridGetter("onMapLoaded", &HybridRNGoogleMapsPlusViewSpec::getOnMapLoaded);
|
|
60
|
+
prototype.registerHybridSetter("onMapLoaded", &HybridRNGoogleMapsPlusViewSpec::setOnMapLoaded);
|
|
57
61
|
prototype.registerHybridGetter("onLocationUpdate", &HybridRNGoogleMapsPlusViewSpec::getOnLocationUpdate);
|
|
58
62
|
prototype.registerHybridSetter("onLocationUpdate", &HybridRNGoogleMapsPlusViewSpec::setOnLocationUpdate);
|
|
59
63
|
prototype.registerHybridGetter("onLocationError", &HybridRNGoogleMapsPlusViewSpec::getOnLocationError);
|
|
60
64
|
prototype.registerHybridSetter("onLocationError", &HybridRNGoogleMapsPlusViewSpec::setOnLocationError);
|
|
61
65
|
prototype.registerHybridGetter("onMapPress", &HybridRNGoogleMapsPlusViewSpec::getOnMapPress);
|
|
62
66
|
prototype.registerHybridSetter("onMapPress", &HybridRNGoogleMapsPlusViewSpec::setOnMapPress);
|
|
67
|
+
prototype.registerHybridGetter("onMapLongPress", &HybridRNGoogleMapsPlusViewSpec::getOnMapLongPress);
|
|
68
|
+
prototype.registerHybridSetter("onMapLongPress", &HybridRNGoogleMapsPlusViewSpec::setOnMapLongPress);
|
|
63
69
|
prototype.registerHybridGetter("onMarkerPress", &HybridRNGoogleMapsPlusViewSpec::getOnMarkerPress);
|
|
64
70
|
prototype.registerHybridSetter("onMarkerPress", &HybridRNGoogleMapsPlusViewSpec::setOnMarkerPress);
|
|
65
71
|
prototype.registerHybridGetter("onPolylinePress", &HybridRNGoogleMapsPlusViewSpec::getOnPolylinePress);
|
|
@@ -37,6 +37,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNCircle; }
|
|
|
37
37
|
namespace margelo::nitro::rngooglemapsplus { struct RNHeatmap; }
|
|
38
38
|
// Forward declaration of `RNKMLayer` to properly resolve imports.
|
|
39
39
|
namespace margelo::nitro::rngooglemapsplus { struct RNKMLayer; }
|
|
40
|
+
// Forward declaration of `RNUrlTileOverlay` to properly resolve imports.
|
|
41
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNUrlTileOverlay; }
|
|
40
42
|
// Forward declaration of `RNLocationConfig` to properly resolve imports.
|
|
41
43
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocationConfig; }
|
|
42
44
|
// Forward declaration of `RNMapErrorCode` to properly resolve imports.
|
|
@@ -77,6 +79,7 @@ namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult;
|
|
|
77
79
|
#include "RNCircle.hpp"
|
|
78
80
|
#include "RNHeatmap.hpp"
|
|
79
81
|
#include "RNKMLayer.hpp"
|
|
82
|
+
#include "RNUrlTileOverlay.hpp"
|
|
80
83
|
#include "RNLocationConfig.hpp"
|
|
81
84
|
#include "RNMapErrorCode.hpp"
|
|
82
85
|
#include <functional>
|
|
@@ -153,18 +156,24 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
153
156
|
virtual void setHeatmaps(const std::optional<std::vector<RNHeatmap>>& heatmaps) = 0;
|
|
154
157
|
virtual std::optional<std::vector<RNKMLayer>> getKmlLayers() = 0;
|
|
155
158
|
virtual void setKmlLayers(const std::optional<std::vector<RNKMLayer>>& kmlLayers) = 0;
|
|
159
|
+
virtual std::optional<std::vector<RNUrlTileOverlay>> getUrlTileOverlays() = 0;
|
|
160
|
+
virtual void setUrlTileOverlays(const std::optional<std::vector<RNUrlTileOverlay>>& urlTileOverlays) = 0;
|
|
156
161
|
virtual std::optional<RNLocationConfig> getLocationConfig() = 0;
|
|
157
162
|
virtual void setLocationConfig(const std::optional<RNLocationConfig>& locationConfig) = 0;
|
|
158
163
|
virtual std::optional<std::function<void(RNMapErrorCode /* error */)>> getOnMapError() = 0;
|
|
159
164
|
virtual void setOnMapError(const std::optional<std::function<void(RNMapErrorCode /* error */)>>& onMapError) = 0;
|
|
160
165
|
virtual std::optional<std::function<void(bool /* ready */)>> getOnMapReady() = 0;
|
|
161
166
|
virtual void setOnMapReady(const std::optional<std::function<void(bool /* ready */)>>& onMapReady) = 0;
|
|
167
|
+
virtual std::optional<std::function<void(bool /* loaded */)>> getOnMapLoaded() = 0;
|
|
168
|
+
virtual void setOnMapLoaded(const std::optional<std::function<void(bool /* loaded */)>>& onMapLoaded) = 0;
|
|
162
169
|
virtual std::optional<std::function<void(const RNLocation& /* location */)>> getOnLocationUpdate() = 0;
|
|
163
170
|
virtual void setOnLocationUpdate(const std::optional<std::function<void(const RNLocation& /* location */)>>& onLocationUpdate) = 0;
|
|
164
171
|
virtual std::optional<std::function<void(RNLocationErrorCode /* error */)>> getOnLocationError() = 0;
|
|
165
172
|
virtual void setOnLocationError(const std::optional<std::function<void(RNLocationErrorCode /* error */)>>& onLocationError) = 0;
|
|
166
173
|
virtual std::optional<std::function<void(const RNLatLng& /* coordinate */)>> getOnMapPress() = 0;
|
|
167
174
|
virtual void setOnMapPress(const std::optional<std::function<void(const RNLatLng& /* coordinate */)>>& onMapPress) = 0;
|
|
175
|
+
virtual std::optional<std::function<void(const RNLatLng& /* coordinate */)>> getOnMapLongPress() = 0;
|
|
176
|
+
virtual void setOnMapLongPress(const std::optional<std::function<void(const RNLatLng& /* coordinate */)>>& onMapLongPress) = 0;
|
|
168
177
|
virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnMarkerPress() = 0;
|
|
169
178
|
virtual void setOnMarkerPress(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onMarkerPress) = 0;
|
|
170
179
|
virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnPolylinePress() = 0;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNUrlTileOverlay.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
#include <string>
|
|
29
|
+
#include <optional>
|
|
30
|
+
|
|
31
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A struct which can be represented as a JavaScript object (RNUrlTileOverlay).
|
|
35
|
+
*/
|
|
36
|
+
struct RNUrlTileOverlay {
|
|
37
|
+
public:
|
|
38
|
+
std::string id SWIFT_PRIVATE;
|
|
39
|
+
std::optional<double> zIndex SWIFT_PRIVATE;
|
|
40
|
+
std::string url SWIFT_PRIVATE;
|
|
41
|
+
double tileSize SWIFT_PRIVATE;
|
|
42
|
+
std::optional<double> opacity SWIFT_PRIVATE;
|
|
43
|
+
std::optional<bool> fadeIn SWIFT_PRIVATE;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
RNUrlTileOverlay() = default;
|
|
47
|
+
explicit RNUrlTileOverlay(std::string id, std::optional<double> zIndex, std::string url, double tileSize, std::optional<double> opacity, std::optional<bool> fadeIn): id(id), zIndex(zIndex), url(url), tileSize(tileSize), opacity(opacity), fadeIn(fadeIn) {}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
51
|
+
|
|
52
|
+
namespace margelo::nitro {
|
|
53
|
+
|
|
54
|
+
// C++ RNUrlTileOverlay <> JS RNUrlTileOverlay (object)
|
|
55
|
+
template <>
|
|
56
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNUrlTileOverlay> final {
|
|
57
|
+
static inline margelo::nitro::rngooglemapsplus::RNUrlTileOverlay fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
58
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
59
|
+
return margelo::nitro::rngooglemapsplus::RNUrlTileOverlay(
|
|
60
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
61
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
62
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "url")),
|
|
63
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "tileSize")),
|
|
64
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "opacity")),
|
|
65
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "fadeIn"))
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNUrlTileOverlay& arg) {
|
|
69
|
+
jsi::Object obj(runtime);
|
|
70
|
+
obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
71
|
+
obj.setProperty(runtime, "zIndex", JSIConverter<std::optional<double>>::toJSI(runtime, arg.zIndex));
|
|
72
|
+
obj.setProperty(runtime, "url", JSIConverter<std::string>::toJSI(runtime, arg.url));
|
|
73
|
+
obj.setProperty(runtime, "tileSize", JSIConverter<double>::toJSI(runtime, arg.tileSize));
|
|
74
|
+
obj.setProperty(runtime, "opacity", JSIConverter<std::optional<double>>::toJSI(runtime, arg.opacity));
|
|
75
|
+
obj.setProperty(runtime, "fadeIn", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.fadeIn));
|
|
76
|
+
return obj;
|
|
77
|
+
}
|
|
78
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
79
|
+
if (!value.isObject()) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
jsi::Object obj = value.getObject(runtime);
|
|
83
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
87
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
88
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "url"))) return false;
|
|
89
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "tileSize"))) return false;
|
|
90
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "opacity"))) return false;
|
|
91
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "fadeIn"))) return false;
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
} // namespace margelo::nitro
|
|
@@ -195,6 +195,16 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
195
195
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.kmlLayers: ") + exc.what());
|
|
196
196
|
}
|
|
197
197
|
}()),
|
|
198
|
+
urlTileOverlays([&]() -> CachedProp<std::optional<std::vector<RNUrlTileOverlay>>> {
|
|
199
|
+
try {
|
|
200
|
+
const react::RawValue* rawValue = rawProps.at("urlTileOverlays", nullptr, nullptr);
|
|
201
|
+
if (rawValue == nullptr) return sourceProps.urlTileOverlays;
|
|
202
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
203
|
+
return CachedProp<std::optional<std::vector<RNUrlTileOverlay>>>::fromRawValue(*runtime, value, sourceProps.urlTileOverlays);
|
|
204
|
+
} catch (const std::exception& exc) {
|
|
205
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.urlTileOverlays: ") + exc.what());
|
|
206
|
+
}
|
|
207
|
+
}()),
|
|
198
208
|
locationConfig([&]() -> CachedProp<std::optional<RNLocationConfig>> {
|
|
199
209
|
try {
|
|
200
210
|
const react::RawValue* rawValue = rawProps.at("locationConfig", nullptr, nullptr);
|
|
@@ -225,6 +235,16 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
225
235
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapReady: ") + exc.what());
|
|
226
236
|
}
|
|
227
237
|
}()),
|
|
238
|
+
onMapLoaded([&]() -> CachedProp<std::optional<std::function<void(bool /* loaded */)>>> {
|
|
239
|
+
try {
|
|
240
|
+
const react::RawValue* rawValue = rawProps.at("onMapLoaded", nullptr, nullptr);
|
|
241
|
+
if (rawValue == nullptr) return sourceProps.onMapLoaded;
|
|
242
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
243
|
+
return CachedProp<std::optional<std::function<void(bool /* loaded */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMapLoaded);
|
|
244
|
+
} catch (const std::exception& exc) {
|
|
245
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapLoaded: ") + exc.what());
|
|
246
|
+
}
|
|
247
|
+
}()),
|
|
228
248
|
onLocationUpdate([&]() -> CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>> {
|
|
229
249
|
try {
|
|
230
250
|
const react::RawValue* rawValue = rawProps.at("onLocationUpdate", nullptr, nullptr);
|
|
@@ -255,6 +275,16 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
255
275
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapPress: ") + exc.what());
|
|
256
276
|
}
|
|
257
277
|
}()),
|
|
278
|
+
onMapLongPress([&]() -> CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>> {
|
|
279
|
+
try {
|
|
280
|
+
const react::RawValue* rawValue = rawProps.at("onMapLongPress", nullptr, nullptr);
|
|
281
|
+
if (rawValue == nullptr) return sourceProps.onMapLongPress;
|
|
282
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
283
|
+
return CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMapLongPress);
|
|
284
|
+
} catch (const std::exception& exc) {
|
|
285
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapLongPress: ") + exc.what());
|
|
286
|
+
}
|
|
287
|
+
}()),
|
|
258
288
|
onMarkerPress([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
|
|
259
289
|
try {
|
|
260
290
|
const react::RawValue* rawValue = rawProps.at("onMarkerPress", nullptr, nullptr);
|
|
@@ -405,12 +435,15 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
405
435
|
circles(other.circles),
|
|
406
436
|
heatmaps(other.heatmaps),
|
|
407
437
|
kmlLayers(other.kmlLayers),
|
|
438
|
+
urlTileOverlays(other.urlTileOverlays),
|
|
408
439
|
locationConfig(other.locationConfig),
|
|
409
440
|
onMapError(other.onMapError),
|
|
410
441
|
onMapReady(other.onMapReady),
|
|
442
|
+
onMapLoaded(other.onMapLoaded),
|
|
411
443
|
onLocationUpdate(other.onLocationUpdate),
|
|
412
444
|
onLocationError(other.onLocationError),
|
|
413
445
|
onMapPress(other.onMapPress),
|
|
446
|
+
onMapLongPress(other.onMapLongPress),
|
|
414
447
|
onMarkerPress(other.onMarkerPress),
|
|
415
448
|
onPolylinePress(other.onPolylinePress),
|
|
416
449
|
onPolygonPress(other.onPolygonPress),
|
|
@@ -444,12 +477,15 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
444
477
|
case hashString("circles"): return true;
|
|
445
478
|
case hashString("heatmaps"): return true;
|
|
446
479
|
case hashString("kmlLayers"): return true;
|
|
480
|
+
case hashString("urlTileOverlays"): return true;
|
|
447
481
|
case hashString("locationConfig"): return true;
|
|
448
482
|
case hashString("onMapError"): return true;
|
|
449
483
|
case hashString("onMapReady"): return true;
|
|
484
|
+
case hashString("onMapLoaded"): return true;
|
|
450
485
|
case hashString("onLocationUpdate"): return true;
|
|
451
486
|
case hashString("onLocationError"): return true;
|
|
452
487
|
case hashString("onMapPress"): return true;
|
|
488
|
+
case hashString("onMapLongPress"): return true;
|
|
453
489
|
case hashString("onMarkerPress"): return true;
|
|
454
490
|
case hashString("onPolylinePress"): return true;
|
|
455
491
|
case hashString("onPolygonPress"): return true;
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
#include "RNCircle.hpp"
|
|
32
32
|
#include "RNHeatmap.hpp"
|
|
33
33
|
#include "RNKMLayer.hpp"
|
|
34
|
+
#include "RNUrlTileOverlay.hpp"
|
|
34
35
|
#include "RNLocationConfig.hpp"
|
|
35
36
|
#include "RNMapErrorCode.hpp"
|
|
36
37
|
#include <functional>
|
|
@@ -82,12 +83,15 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
82
83
|
CachedProp<std::optional<std::vector<RNCircle>>> circles;
|
|
83
84
|
CachedProp<std::optional<std::vector<RNHeatmap>>> heatmaps;
|
|
84
85
|
CachedProp<std::optional<std::vector<RNKMLayer>>> kmlLayers;
|
|
86
|
+
CachedProp<std::optional<std::vector<RNUrlTileOverlay>>> urlTileOverlays;
|
|
85
87
|
CachedProp<std::optional<RNLocationConfig>> locationConfig;
|
|
86
88
|
CachedProp<std::optional<std::function<void(RNMapErrorCode /* error */)>>> onMapError;
|
|
87
89
|
CachedProp<std::optional<std::function<void(bool /* ready */)>>> onMapReady;
|
|
90
|
+
CachedProp<std::optional<std::function<void(bool /* loaded */)>>> onMapLoaded;
|
|
88
91
|
CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>> onLocationUpdate;
|
|
89
92
|
CachedProp<std::optional<std::function<void(RNLocationErrorCode /* error */)>>> onLocationError;
|
|
90
93
|
CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>> onMapPress;
|
|
94
|
+
CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>> onMapLongPress;
|
|
91
95
|
CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onMarkerPress;
|
|
92
96
|
CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onPolylinePress;
|
|
93
97
|
CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onPolygonPress;
|
|
@@ -21,12 +21,15 @@
|
|
|
21
21
|
"circles": true,
|
|
22
22
|
"heatmaps": true,
|
|
23
23
|
"kmlLayers": true,
|
|
24
|
+
"urlTileOverlays": true,
|
|
24
25
|
"locationConfig": true,
|
|
25
26
|
"onMapError": true,
|
|
26
27
|
"onMapReady": true,
|
|
28
|
+
"onMapLoaded": true,
|
|
27
29
|
"onLocationUpdate": true,
|
|
28
30
|
"onLocationError": true,
|
|
29
31
|
"onMapPress": true,
|
|
32
|
+
"onMapLongPress": true,
|
|
30
33
|
"onMarkerPress": true,
|
|
31
34
|
"onPolylinePress": true,
|
|
32
35
|
"onPolygonPress": true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-google-maps-plus",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0-dev.2",
|
|
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",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"android/fix-prefab.gradle",
|
|
53
53
|
"android/gradle.properties",
|
|
54
54
|
"android/CMakeLists.txt",
|
|
55
|
+
"android/proguard-rules.pro",
|
|
55
56
|
"android/src",
|
|
56
57
|
"ios/**/*.h",
|
|
57
58
|
"ios/**/*.m",
|
|
@@ -88,8 +89,8 @@
|
|
|
88
89
|
"@semantic-release/git": "10.0.1",
|
|
89
90
|
"@semantic-release/npm": "13.1.1",
|
|
90
91
|
"@types/jest": "30.0.0",
|
|
91
|
-
"@types/react": "19.
|
|
92
|
-
"clang-format-node": "2.0.
|
|
92
|
+
"@types/react": "19.1.1",
|
|
93
|
+
"clang-format-node": "2.0.3",
|
|
93
94
|
"conventional-changelog-conventionalcommits": "9.1.0",
|
|
94
95
|
"del-cli": "7.0.0",
|
|
95
96
|
"eslint": "9.38.0",
|
|
@@ -100,7 +101,7 @@
|
|
|
100
101
|
"lefthook": "2.0.0",
|
|
101
102
|
"nitrogen": "0.30.2",
|
|
102
103
|
"prettier": "3.6.2",
|
|
103
|
-
"react": "19.
|
|
104
|
+
"react": "19.1.1",
|
|
104
105
|
"react-native": "0.82.1",
|
|
105
106
|
"react-native-builder-bob": "0.40.13",
|
|
106
107
|
"react-native-nitro-modules": "0.30.2",
|
|
@@ -28,6 +28,7 @@ import type {
|
|
|
28
28
|
RNIndoorLevel,
|
|
29
29
|
RNLatLngBounds,
|
|
30
30
|
RNSnapshotOptions,
|
|
31
|
+
RNUrlTileOverlay,
|
|
31
32
|
} from './types';
|
|
32
33
|
|
|
33
34
|
export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
|
|
@@ -48,12 +49,15 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
|
|
|
48
49
|
circles?: RNCircle[];
|
|
49
50
|
heatmaps?: RNHeatmap[];
|
|
50
51
|
kmlLayers?: RNKMLayer[];
|
|
52
|
+
urlTileOverlays?: RNUrlTileOverlay[];
|
|
51
53
|
locationConfig?: RNLocationConfig;
|
|
52
54
|
onMapError?: (error: RNMapErrorCode) => void;
|
|
53
55
|
onMapReady?: (ready: boolean) => void;
|
|
56
|
+
onMapLoaded?: (loaded: boolean) => void;
|
|
54
57
|
onLocationUpdate?: (location: RNLocation) => void;
|
|
55
58
|
onLocationError?: (error: RNLocationErrorCode) => void;
|
|
56
59
|
onMapPress?: (coordinate: RNLatLng) => void;
|
|
60
|
+
onMapLongPress?: (coordinate: RNLatLng) => void;
|
|
57
61
|
onMarkerPress?: (id?: string | undefined) => void;
|
|
58
62
|
onPolylinePress?: (id?: string | undefined) => void;
|
|
59
63
|
onPolygonPress?: (id?: string | undefined) => void;
|
package/src/types.ts
CHANGED
|
@@ -241,6 +241,15 @@ export type RNKMLayer = {
|
|
|
241
241
|
kmlString: string;
|
|
242
242
|
};
|
|
243
243
|
|
|
244
|
+
export type RNUrlTileOverlay = {
|
|
245
|
+
id: string;
|
|
246
|
+
zIndex?: number;
|
|
247
|
+
url: string;
|
|
248
|
+
tileSize: number;
|
|
249
|
+
opacity?: number;
|
|
250
|
+
fadeIn?: boolean;
|
|
251
|
+
};
|
|
252
|
+
|
|
244
253
|
export type RNIndoorBuilding = {
|
|
245
254
|
activeLevelIndex?: number;
|
|
246
255
|
defaultLevelIndex?: number;
|