react-native-google-maps-plus 1.7.0-dev.1 → 1.7.0-dev.3
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 +52 -0
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +66 -0
- package/android/src/main/java/com/rngooglemapsplus/MapUrlTileOverlayBuilder.kt +40 -0
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +18 -4
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNMapTypeExtension.kt +13 -0
- package/ios/GoogleMapViewImpl.swift +39 -0
- package/ios/MapUrlTileOverlayBuilder.swift +23 -0
- package/ios/RNGoogleMapsPlusView.swift +26 -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 +1 -0
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +2 -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 +30 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JRNUrlTileOverlay.hpp +78 -0
- package/nitrogen/generated/android/c++/views/JHybridRNGoogleMapsPlusViewStateUpdater.cpp +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +6 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNUrlTileOverlay.kt +52 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +29 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +10 -0
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +5 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +30 -0
- package/nitrogen/generated/ios/swift/RNUrlTileOverlay.swift +133 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +5 -0
- package/nitrogen/generated/shared/c++/RNUrlTileOverlay.hpp +96 -0
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +12 -0
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +2 -0
- package/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +1 -0
- package/package.json +1 -1
- package/src/RNGoogleMapsPlusView.nitro.ts +2 -0
- package/src/types.ts +9 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JRNUrlTileOverlay.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 "RNUrlTileOverlay.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 "RNUrlTileOverlay" and the the Kotlin data class "RNUrlTileOverlay".
|
|
22
|
+
*/
|
|
23
|
+
struct JRNUrlTileOverlay final: public jni::JavaClass<JRNUrlTileOverlay> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/RNUrlTileOverlay;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct RNUrlTileOverlay by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
RNUrlTileOverlay toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldId = clazz->getField<jni::JString>("id");
|
|
36
|
+
jni::local_ref<jni::JString> id = this->getFieldValue(fieldId);
|
|
37
|
+
static const auto fieldZIndex = clazz->getField<jni::JDouble>("zIndex");
|
|
38
|
+
jni::local_ref<jni::JDouble> zIndex = this->getFieldValue(fieldZIndex);
|
|
39
|
+
static const auto fieldUrl = clazz->getField<jni::JString>("url");
|
|
40
|
+
jni::local_ref<jni::JString> url = this->getFieldValue(fieldUrl);
|
|
41
|
+
static const auto fieldTileSize = clazz->getField<double>("tileSize");
|
|
42
|
+
double tileSize = this->getFieldValue(fieldTileSize);
|
|
43
|
+
static const auto fieldOpacity = clazz->getField<jni::JDouble>("opacity");
|
|
44
|
+
jni::local_ref<jni::JDouble> opacity = this->getFieldValue(fieldOpacity);
|
|
45
|
+
static const auto fieldFadeIn = clazz->getField<jni::JBoolean>("fadeIn");
|
|
46
|
+
jni::local_ref<jni::JBoolean> fadeIn = this->getFieldValue(fieldFadeIn);
|
|
47
|
+
return RNUrlTileOverlay(
|
|
48
|
+
id->toStdString(),
|
|
49
|
+
zIndex != nullptr ? std::make_optional(zIndex->value()) : std::nullopt,
|
|
50
|
+
url->toStdString(),
|
|
51
|
+
tileSize,
|
|
52
|
+
opacity != nullptr ? std::make_optional(opacity->value()) : std::nullopt,
|
|
53
|
+
fadeIn != nullptr ? std::make_optional(static_cast<bool>(fadeIn->value())) : std::nullopt
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
/**
|
|
59
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
60
|
+
*/
|
|
61
|
+
[[maybe_unused]]
|
|
62
|
+
static jni::local_ref<JRNUrlTileOverlay::javaobject> fromCpp(const RNUrlTileOverlay& value) {
|
|
63
|
+
using JSignature = JRNUrlTileOverlay(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JString>, double, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>);
|
|
64
|
+
static const auto clazz = javaClassStatic();
|
|
65
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
66
|
+
return create(
|
|
67
|
+
clazz,
|
|
68
|
+
jni::make_jstring(value.id),
|
|
69
|
+
value.zIndex.has_value() ? jni::JDouble::valueOf(value.zIndex.value()) : nullptr,
|
|
70
|
+
jni::make_jstring(value.url),
|
|
71
|
+
value.tileSize,
|
|
72
|
+
value.opacity.has_value() ? jni::JDouble::valueOf(value.opacity.value()) : nullptr,
|
|
73
|
+
value.fadeIn.has_value() ? jni::JBoolean::valueOf(value.fadeIn.value()) : nullptr
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -104,6 +104,10 @@ void JHybridRNGoogleMapsPlusViewStateUpdater::updateViewProps(jni::alias_ref<jni
|
|
|
104
104
|
view->setKmlLayers(props.kmlLayers.value);
|
|
105
105
|
// TODO: Set isDirty = false
|
|
106
106
|
}
|
|
107
|
+
if (props.urlTileOverlays.isDirty) {
|
|
108
|
+
view->setUrlTileOverlays(props.urlTileOverlays.value);
|
|
109
|
+
// TODO: Set isDirty = false
|
|
110
|
+
}
|
|
107
111
|
if (props.locationConfig.isDirty) {
|
|
108
112
|
view->setLocationConfig(props.locationConfig.value);
|
|
109
113
|
// TODO: Set isDirty = false
|
|
@@ -140,6 +140,12 @@ abstract class HybridRNGoogleMapsPlusViewSpec: HybridView() {
|
|
|
140
140
|
@set:Keep
|
|
141
141
|
abstract var kmlLayers: Array<RNKMLayer>?
|
|
142
142
|
|
|
143
|
+
@get:DoNotStrip
|
|
144
|
+
@get:Keep
|
|
145
|
+
@set:DoNotStrip
|
|
146
|
+
@set:Keep
|
|
147
|
+
abstract var urlTileOverlays: Array<RNUrlTileOverlay>?
|
|
148
|
+
|
|
143
149
|
@get:DoNotStrip
|
|
144
150
|
@get:Keep
|
|
145
151
|
@set:DoNotStrip
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNUrlTileOverlay.kt
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNUrlTileOverlay.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 "RNUrlTileOverlay".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class RNUrlTileOverlay(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val id: String,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val zIndex: Double?,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val url: String,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val tileSize: Double,
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
val opacity: Double?,
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
val fadeIn: Boolean?
|
|
39
|
+
) {
|
|
40
|
+
private companion object {
|
|
41
|
+
/**
|
|
42
|
+
* Constructor called from C++
|
|
43
|
+
*/
|
|
44
|
+
@DoNotStrip
|
|
45
|
+
@Keep
|
|
46
|
+
@Suppress("unused")
|
|
47
|
+
@JvmStatic
|
|
48
|
+
private fun fromCpp(id: String, zIndex: Double?, url: String, tileSize: Double, opacity: Double?, fadeIn: Boolean?): RNUrlTileOverlay {
|
|
49
|
+
return RNUrlTileOverlay(id, zIndex, url, tileSize, opacity, fadeIn)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -88,6 +88,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNPosition; }
|
|
|
88
88
|
namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
|
|
89
89
|
// Forward declaration of `RNSize` to properly resolve imports.
|
|
90
90
|
namespace margelo::nitro::rngooglemapsplus { struct RNSize; }
|
|
91
|
+
// Forward declaration of `RNUrlTileOverlay` to properly resolve imports.
|
|
92
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNUrlTileOverlay; }
|
|
91
93
|
// Forward declaration of `RNUserInterfaceStyle` to properly resolve imports.
|
|
92
94
|
namespace margelo::nitro::rngooglemapsplus { enum class RNUserInterfaceStyle; }
|
|
93
95
|
|
|
@@ -138,6 +140,7 @@ namespace RNGoogleMapsPlus { class HybridRNGoogleMapsPlusViewSpec_cxx; }
|
|
|
138
140
|
#include "RNPosition.hpp"
|
|
139
141
|
#include "RNRegion.hpp"
|
|
140
142
|
#include "RNSize.hpp"
|
|
143
|
+
#include "RNUrlTileOverlay.hpp"
|
|
141
144
|
#include "RNUserInterfaceStyle.hpp"
|
|
142
145
|
#include <NitroModules/FastVectorCopy.hpp>
|
|
143
146
|
#include <NitroModules/Promise.hpp>
|
|
@@ -748,6 +751,32 @@ namespace margelo::nitro::rngooglemapsplus::bridge::swift {
|
|
|
748
751
|
return *optional;
|
|
749
752
|
}
|
|
750
753
|
|
|
754
|
+
// pragma MARK: std::vector<RNUrlTileOverlay>
|
|
755
|
+
/**
|
|
756
|
+
* Specialized version of `std::vector<RNUrlTileOverlay>`.
|
|
757
|
+
*/
|
|
758
|
+
using std__vector_RNUrlTileOverlay_ = std::vector<RNUrlTileOverlay>;
|
|
759
|
+
inline std::vector<RNUrlTileOverlay> create_std__vector_RNUrlTileOverlay_(size_t size) noexcept {
|
|
760
|
+
std::vector<RNUrlTileOverlay> vector;
|
|
761
|
+
vector.reserve(size);
|
|
762
|
+
return vector;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
// pragma MARK: std::optional<std::vector<RNUrlTileOverlay>>
|
|
766
|
+
/**
|
|
767
|
+
* Specialized version of `std::optional<std::vector<RNUrlTileOverlay>>`.
|
|
768
|
+
*/
|
|
769
|
+
using std__optional_std__vector_RNUrlTileOverlay__ = std::optional<std::vector<RNUrlTileOverlay>>;
|
|
770
|
+
inline std::optional<std::vector<RNUrlTileOverlay>> create_std__optional_std__vector_RNUrlTileOverlay__(const std::vector<RNUrlTileOverlay>& value) noexcept {
|
|
771
|
+
return std::optional<std::vector<RNUrlTileOverlay>>(value);
|
|
772
|
+
}
|
|
773
|
+
inline bool has_value_std__optional_std__vector_RNUrlTileOverlay__(const std::optional<std::vector<RNUrlTileOverlay>>& optional) noexcept {
|
|
774
|
+
return optional.has_value();
|
|
775
|
+
}
|
|
776
|
+
inline std::vector<RNUrlTileOverlay> get_std__optional_std__vector_RNUrlTileOverlay__(const std::optional<std::vector<RNUrlTileOverlay>>& optional) noexcept {
|
|
777
|
+
return *optional;
|
|
778
|
+
}
|
|
779
|
+
|
|
751
780
|
// pragma MARK: std::optional<RNAndroidLocationPriority>
|
|
752
781
|
/**
|
|
753
782
|
* Specialized version of `std::optional<RNAndroidLocationPriority>`.
|
|
@@ -94,6 +94,8 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNSnapshotFormat; }
|
|
|
94
94
|
namespace margelo::nitro::rngooglemapsplus { struct RNSnapshotOptions; }
|
|
95
95
|
// Forward declaration of `RNSnapshotResultType` to properly resolve imports.
|
|
96
96
|
namespace margelo::nitro::rngooglemapsplus { enum class RNSnapshotResultType; }
|
|
97
|
+
// Forward declaration of `RNUrlTileOverlay` to properly resolve imports.
|
|
98
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNUrlTileOverlay; }
|
|
97
99
|
// Forward declaration of `RNUserInterfaceStyle` to properly resolve imports.
|
|
98
100
|
namespace margelo::nitro::rngooglemapsplus { enum class RNUserInterfaceStyle; }
|
|
99
101
|
|
|
@@ -141,6 +143,7 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNUserInterfaceStyle; }
|
|
|
141
143
|
#include "RNSnapshotFormat.hpp"
|
|
142
144
|
#include "RNSnapshotOptions.hpp"
|
|
143
145
|
#include "RNSnapshotResultType.hpp"
|
|
146
|
+
#include "RNUrlTileOverlay.hpp"
|
|
144
147
|
#include "RNUserInterfaceStyle.hpp"
|
|
145
148
|
#include <NitroModules/Promise.hpp>
|
|
146
149
|
#include <NitroModules/Result.hpp>
|
|
@@ -54,6 +54,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNHeatmapPoint; }
|
|
|
54
54
|
namespace margelo::nitro::rngooglemapsplus { struct RNHeatmapGradient; }
|
|
55
55
|
// Forward declaration of `RNKMLayer` to properly resolve imports.
|
|
56
56
|
namespace margelo::nitro::rngooglemapsplus { struct RNKMLayer; }
|
|
57
|
+
// Forward declaration of `RNUrlTileOverlay` to properly resolve imports.
|
|
58
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNUrlTileOverlay; }
|
|
57
59
|
// Forward declaration of `RNLocationConfig` to properly resolve imports.
|
|
58
60
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocationConfig; }
|
|
59
61
|
// Forward declaration of `RNAndroidLocationConfig` to properly resolve imports.
|
|
@@ -121,6 +123,7 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSPermissionResult; }
|
|
|
121
123
|
#include "RNHeatmapPoint.hpp"
|
|
122
124
|
#include "RNHeatmapGradient.hpp"
|
|
123
125
|
#include "RNKMLayer.hpp"
|
|
126
|
+
#include "RNUrlTileOverlay.hpp"
|
|
124
127
|
#include "RNLocationConfig.hpp"
|
|
125
128
|
#include "RNAndroidLocationConfig.hpp"
|
|
126
129
|
#include "RNAndroidLocationPriority.hpp"
|
|
@@ -301,6 +304,13 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
301
304
|
inline void setKmlLayers(const std::optional<std::vector<RNKMLayer>>& kmlLayers) noexcept override {
|
|
302
305
|
_swiftPart.setKmlLayers(kmlLayers);
|
|
303
306
|
}
|
|
307
|
+
inline std::optional<std::vector<RNUrlTileOverlay>> getUrlTileOverlays() noexcept override {
|
|
308
|
+
auto __result = _swiftPart.getUrlTileOverlays();
|
|
309
|
+
return __result;
|
|
310
|
+
}
|
|
311
|
+
inline void setUrlTileOverlays(const std::optional<std::vector<RNUrlTileOverlay>>& urlTileOverlays) noexcept override {
|
|
312
|
+
_swiftPart.setUrlTileOverlays(urlTileOverlays);
|
|
313
|
+
}
|
|
304
314
|
inline std::optional<RNLocationConfig> getLocationConfig() noexcept override {
|
|
305
315
|
auto __result = _swiftPart.getLocationConfig();
|
|
306
316
|
return __result;
|
|
@@ -171,6 +171,11 @@ using namespace margelo::nitro::rngooglemapsplus::views;
|
|
|
171
171
|
swiftPart.setKmlLayers(newViewProps.kmlLayers.value);
|
|
172
172
|
newViewProps.kmlLayers.isDirty = false;
|
|
173
173
|
}
|
|
174
|
+
// urlTileOverlays: optional
|
|
175
|
+
if (newViewProps.urlTileOverlays.isDirty) {
|
|
176
|
+
swiftPart.setUrlTileOverlays(newViewProps.urlTileOverlays.value);
|
|
177
|
+
newViewProps.urlTileOverlays.isDirty = false;
|
|
178
|
+
}
|
|
174
179
|
// locationConfig: optional
|
|
175
180
|
if (newViewProps.locationConfig.isDirty) {
|
|
176
181
|
swiftPart.setLocationConfig(newViewProps.locationConfig.value);
|
|
@@ -28,6 +28,7 @@ public protocol HybridRNGoogleMapsPlusViewSpec_protocol: HybridObject, HybridVie
|
|
|
28
28
|
var circles: [RNCircle]? { get set }
|
|
29
29
|
var heatmaps: [RNHeatmap]? { get set }
|
|
30
30
|
var kmlLayers: [RNKMLayer]? { get set }
|
|
31
|
+
var urlTileOverlays: [RNUrlTileOverlay]? { get set }
|
|
31
32
|
var locationConfig: RNLocationConfig? { get set }
|
|
32
33
|
var onMapError: ((_ error: RNMapErrorCode) -> Void)? { get set }
|
|
33
34
|
var onMapReady: ((_ ready: Bool) -> Void)? { get set }
|
|
@@ -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 {
|
|
@@ -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,6 +48,8 @@ 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);
|
|
@@ -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,6 +156,8 @@ 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;
|
|
@@ -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);
|
|
@@ -425,6 +435,7 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
425
435
|
circles(other.circles),
|
|
426
436
|
heatmaps(other.heatmaps),
|
|
427
437
|
kmlLayers(other.kmlLayers),
|
|
438
|
+
urlTileOverlays(other.urlTileOverlays),
|
|
428
439
|
locationConfig(other.locationConfig),
|
|
429
440
|
onMapError(other.onMapError),
|
|
430
441
|
onMapReady(other.onMapReady),
|
|
@@ -466,6 +477,7 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
466
477
|
case hashString("circles"): return true;
|
|
467
478
|
case hashString("heatmaps"): return true;
|
|
468
479
|
case hashString("kmlLayers"): return true;
|
|
480
|
+
case hashString("urlTileOverlays"): return true;
|
|
469
481
|
case hashString("locationConfig"): return true;
|
|
470
482
|
case hashString("onMapError"): return true;
|
|
471
483
|
case hashString("onMapReady"): 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,6 +83,7 @@ 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;
|
package/package.json
CHANGED
|
@@ -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,6 +49,7 @@ 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;
|