@maydon_tech/react-native-nitro-maps 0.1.4 → 0.2.1
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/LICENSE +1 -1
- package/NitroMap.podspec +1 -1
- package/README.md +82 -9
- package/android/CMakeLists.txt +4 -1
- package/android/build.gradle +6 -2
- package/android/gradle.properties +4 -4
- package/android/src/main/cpp/ClusterEngineJNI.cpp +198 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/NitroMap.kt +397 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/NitroMapConfig.kt +53 -0
- package/android/src/main/{java → kotlin}/com/margelo/nitro/nitromap/NitroMapPackage.kt +4 -4
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/NitroMapView.kt +73 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/UserLocationManager.kt +295 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/clustering/ClusterIconRenderer.kt +111 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/clustering/ClusteringManager.kt +104 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/clustering/NitroClusterEngine.kt +166 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/markers/MarkerIconFactory.kt +303 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/markers/MarkerSelectionHandler.kt +72 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/markers/PriceMarkerRenderer.kt +159 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/MapProviderFactory.kt +24 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/MapProviderInterface.kt +128 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapDelegate.kt +317 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+Clustering.kt +524 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+Markers.kt +358 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+Overlays.kt +272 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+UserLocation.kt +296 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider.kt +815 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/MarkerTagData.kt +19 -0
- package/ios/Location/NitroLocationManager.swift +116 -0
- package/ios/MarkerRenderer/MarkerIconFactory.swift +1 -3
- package/ios/MarkerRenderer/PriceMarkerRenderer.swift +10 -6
- package/ios/NitroMap.swift +279 -13
- package/ios/NitroMapConfig/NitroMapConfig.swift +45 -0
- package/ios/Providers/{GoogleMapDelegate.swift → Google/GoogleMapDelegate.swift} +48 -23
- package/ios/Providers/Google/GoogleMapProvider+Camera.swift +180 -0
- package/ios/Providers/Google/GoogleMapProvider+Clustering.swift +541 -0
- package/ios/Providers/Google/GoogleMapProvider+Markers.swift +270 -0
- package/ios/Providers/Google/GoogleMapProvider+Overlays.swift +245 -0
- package/ios/Providers/Google/GoogleMapProvider+UserLocation.swift +180 -0
- package/ios/Providers/Google/GoogleMapProvider.swift +342 -0
- package/ios/Providers/MapProviderFactory.swift +17 -0
- package/ios/Providers/MapProviderProtocol.swift +48 -1
- package/ios/Shared/ClusterConfig+Factory.swift +2 -2
- package/ios/Shared/MapStyleProvider.swift +6 -4
- package/ios/Shared/MarkerSelectionHandler.swift +4 -1
- package/ios/Utils/ColorValueExtension.swift +46 -67
- package/lib/module/components/ImageMarker.js +39 -29
- package/lib/module/components/ImageMarker.js.map +1 -1
- package/lib/module/components/Marker.js +118 -0
- package/lib/module/components/Marker.js.map +1 -0
- package/lib/module/components/NitroCircle.js +92 -0
- package/lib/module/components/NitroCircle.js.map +1 -0
- package/lib/module/components/NitroMap.js +216 -76
- package/lib/module/components/NitroMap.js.map +1 -1
- package/lib/module/components/NitroPolygon.js +137 -0
- package/lib/module/components/NitroPolygon.js.map +1 -0
- package/lib/module/components/NitroPolyline.js +115 -0
- package/lib/module/components/NitroPolyline.js.map +1 -0
- package/lib/module/components/PriceMarker.js +16 -29
- package/lib/module/components/PriceMarker.js.map +1 -1
- package/lib/module/context/NitroMapContext.js.map +1 -1
- package/lib/module/hooks/useNitroCircle.js +18 -0
- package/lib/module/hooks/useNitroCircle.js.map +1 -0
- package/lib/module/hooks/useNitroMarker.js +26 -9
- package/lib/module/hooks/useNitroMarker.js.map +1 -1
- package/lib/module/hooks/useNitroOverlay.js +59 -0
- package/lib/module/hooks/useNitroOverlay.js.map +1 -0
- package/lib/module/hooks/useNitroPolygon.js +18 -0
- package/lib/module/hooks/useNitroPolygon.js.map +1 -0
- package/lib/module/hooks/useNitroPolyline.js +18 -0
- package/lib/module/hooks/useNitroPolyline.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/overlay.js +4 -0
- package/lib/module/types/overlay.js.map +1 -0
- package/lib/module/types/theme.js +4 -0
- package/lib/module/types/theme.js.map +1 -0
- package/lib/module/utils/colors.js +41 -13
- package/lib/module/utils/colors.js.map +1 -1
- package/lib/module/utils/validation.js +45 -0
- package/lib/module/utils/validation.js.map +1 -0
- package/lib/typescript/src/components/ImageMarker.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.d.ts +34 -0
- package/lib/typescript/src/components/Marker.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroCircle.d.ts +70 -0
- package/lib/typescript/src/components/NitroCircle.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroMap.d.ts +60 -3
- package/lib/typescript/src/components/NitroMap.d.ts.map +1 -1
- package/lib/typescript/src/components/NitroPolygon.d.ts +86 -0
- package/lib/typescript/src/components/NitroPolygon.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroPolyline.d.ts +84 -0
- package/lib/typescript/src/components/NitroPolyline.d.ts.map +1 -0
- package/lib/typescript/src/components/PriceMarker.d.ts +0 -5
- package/lib/typescript/src/components/PriceMarker.d.ts.map +1 -1
- package/lib/typescript/src/context/NitroMapContext.d.ts +2 -0
- package/lib/typescript/src/context/NitroMapContext.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useNitroCircle.d.ts +7 -0
- package/lib/typescript/src/hooks/useNitroCircle.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNitroMarker.d.ts +20 -0
- package/lib/typescript/src/hooks/useNitroMarker.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useNitroOverlay.d.ts +26 -0
- package/lib/typescript/src/hooks/useNitroOverlay.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNitroPolygon.d.ts +7 -0
- package/lib/typescript/src/hooks/useNitroPolygon.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNitroPolyline.d.ts +7 -0
- package/lib/typescript/src/hooks/useNitroPolyline.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +15 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/NitroMap.nitro.d.ts +248 -6
- package/lib/typescript/src/specs/NitroMap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types/map.d.ts +34 -4
- package/lib/typescript/src/types/map.d.ts.map +1 -1
- package/lib/typescript/src/types/marker.d.ts +24 -36
- package/lib/typescript/src/types/marker.d.ts.map +1 -1
- package/lib/typescript/src/types/overlay.d.ts +84 -0
- package/lib/typescript/src/types/overlay.d.ts.map +1 -0
- package/lib/typescript/src/types/theme.d.ts +93 -0
- package/lib/typescript/src/types/theme.d.ts.map +1 -0
- package/lib/typescript/src/utils/colors.d.ts +6 -8
- package/lib/typescript/src/utils/colors.d.ts.map +1 -1
- package/lib/typescript/src/utils/validation.d.ts +12 -0
- package/lib/typescript/src/utils/validation.d.ts.map +1 -0
- package/nitrogen/generated/android/c++/JCircleData.hpp +94 -0
- package/nitrogen/generated/android/c++/JClusterConfig.hpp +5 -7
- package/nitrogen/generated/android/c++/JCoordinateRing.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_UserLocationChangeEvent.hpp +79 -0
- package/nitrogen/generated/android/c++/JFunc_void_UserTrackingMode.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridNitroMapSpec.cpp +332 -21
- package/nitrogen/generated/android/c++/JHybridNitroMapSpec.hpp +53 -2
- package/nitrogen/generated/android/c++/JMarkerAnimation.hpp +3 -6
- package/nitrogen/generated/android/c++/JMarkerData.hpp +15 -3
- package/nitrogen/generated/android/c++/JPolygonData.hpp +133 -0
- package/nitrogen/generated/android/c++/JPolylineData.hpp +113 -0
- package/nitrogen/generated/android/c++/JUserLocationChangeEvent.hpp +70 -0
- package/nitrogen/generated/android/c++/JUserTrackingMode.hpp +62 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroMapStateUpdater.cpp +72 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/CircleData.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ClusterConfig.kt +4 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/CoordinateRing.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_UserLocationChangeEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_UserTrackingMode.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/HybridNitroMapSpec.kt +228 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerAnimation.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerData.kt +12 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/PolygonData.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/PolylineData.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/UserLocationChangeEvent.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/{ClusterAnimationStyle.kt → UserTrackingMode.kt} +6 -8
- package/nitrogen/generated/android/nitromapOnLoad.cpp +6 -0
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Bridge.cpp +24 -0
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Bridge.hpp +178 -17
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Umbrella.hpp +18 -3
- package/nitrogen/generated/ios/c++/HybridNitroMapSpecSwift.hpp +252 -16
- package/nitrogen/generated/ios/c++/views/HybridNitroMapComponent.mm +90 -5
- package/nitrogen/generated/ios/swift/CircleData.swift +143 -0
- package/nitrogen/generated/ios/swift/ClusterConfig.swift +22 -15
- package/nitrogen/generated/ios/swift/CoordinateRing.swift +48 -0
- package/nitrogen/generated/ios/swift/Func_void_UserLocationChangeEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_UserTrackingMode.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridNitroMapSpec.swift +35 -1
- package/nitrogen/generated/ios/swift/HybridNitroMapSpec_cxx.swift +582 -8
- package/nitrogen/generated/ios/swift/MarkerAnimation.swift +4 -8
- package/nitrogen/generated/ios/swift/MarkerData.swift +54 -2
- package/nitrogen/generated/ios/swift/PolygonData.swift +167 -0
- package/nitrogen/generated/ios/swift/PolylineData.swift +155 -0
- package/nitrogen/generated/ios/swift/UserLocationChangeEvent.swift +69 -0
- package/nitrogen/generated/ios/swift/UserTrackingMode.swift +44 -0
- package/nitrogen/generated/shared/c++/CircleData.hpp +113 -0
- package/nitrogen/generated/shared/c++/ClusterConfig.hpp +5 -8
- package/nitrogen/generated/shared/c++/CoordinateRing.hpp +77 -0
- package/nitrogen/generated/shared/c++/HybridNitroMapSpec.cpp +53 -2
- package/nitrogen/generated/shared/c++/HybridNitroMapSpec.hpp +75 -6
- package/nitrogen/generated/shared/c++/MarkerAnimation.hpp +4 -8
- package/nitrogen/generated/shared/c++/MarkerData.hpp +14 -2
- package/nitrogen/generated/shared/c++/PolygonData.hpp +117 -0
- package/nitrogen/generated/shared/c++/PolylineData.hpp +114 -0
- package/nitrogen/generated/shared/c++/UserLocationChangeEvent.hpp +88 -0
- package/nitrogen/generated/shared/c++/UserTrackingMode.hpp +80 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroMapComponent.cpp +216 -12
- package/nitrogen/generated/shared/c++/views/HybridNitroMapComponent.hpp +23 -1
- package/nitrogen/generated/shared/json/NitroMapConfig.json +18 -1
- package/package.json +36 -5
- package/src/components/ImageMarker.tsx +58 -42
- package/src/components/Marker.tsx +161 -0
- package/src/components/NitroCircle.tsx +183 -0
- package/src/components/NitroMap.tsx +328 -78
- package/src/components/NitroPolygon.tsx +229 -0
- package/src/components/NitroPolyline.tsx +208 -0
- package/src/components/PriceMarker.tsx +23 -48
- package/src/context/NitroMapContext.tsx +4 -0
- package/src/hooks/useNitroCircle.ts +25 -0
- package/src/hooks/useNitroMarker.ts +49 -10
- package/src/hooks/useNitroOverlay.ts +68 -0
- package/src/hooks/useNitroPolygon.ts +25 -0
- package/src/hooks/useNitroPolyline.ts +25 -0
- package/src/index.tsx +28 -2
- package/src/specs/NitroMap.nitro.ts +294 -5
- package/src/types/map.ts +36 -4
- package/src/types/marker.ts +24 -44
- package/src/types/overlay.ts +87 -0
- package/src/types/theme.ts +101 -0
- package/src/utils/colors.ts +48 -16
- package/src/utils/validation.ts +69 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/ClusterIconGenerator.kt +0 -108
- package/android/src/main/java/com/margelo/nitro/nitromap/ColorUtils.kt +0 -63
- package/android/src/main/java/com/margelo/nitro/nitromap/HybridNitroMap.kt +0 -408
- package/android/src/main/java/com/margelo/nitro/nitromap/HybridNitroMapConfig.kt +0 -68
- package/android/src/main/java/com/margelo/nitro/nitromap/MarkerIconCache.kt +0 -176
- package/android/src/main/java/com/margelo/nitro/nitromap/MarkerIconFactory.kt +0 -252
- package/android/src/main/java/com/margelo/nitro/nitromap/clustering/NitroClusterEngine.kt +0 -252
- package/android/src/main/java/com/margelo/nitro/nitromap/clustering/QuadTree.kt +0 -195
- package/android/src/main/java/com/margelo/nitro/nitromap/providers/GoogleMapProvider.kt +0 -912
- package/android/src/main/java/com/margelo/nitro/nitromap/providers/MapProviderInterface.kt +0 -70
- package/cpp/QuadTree.hpp +0 -246
- package/ios/NitroMapConfig/HybridNitroMapConfig.swift +0 -33
- package/ios/Providers/GoogleMapProvider+Camera.swift +0 -164
- package/ios/Providers/GoogleMapProvider.swift +0 -924
- package/nitrogen/generated/android/c++/JClusterAnimationStyle.hpp +0 -68
- package/nitrogen/generated/ios/swift/ClusterAnimationStyle.swift +0 -52
- package/nitrogen/generated/shared/c++/ClusterAnimationStyle.hpp +0 -88
|
@@ -71,10 +71,16 @@ namespace margelo::nitro::nitromap {
|
|
|
71
71
|
jni::local_ref<JPoint> anchor = this->getFieldValue(fieldAnchor);
|
|
72
72
|
static const auto fieldConfig = clazz->getField<JMarkerConfig>("config");
|
|
73
73
|
jni::local_ref<JMarkerConfig> config = this->getFieldValue(fieldConfig);
|
|
74
|
+
static const auto fieldAccessibilityLabel = clazz->getField<jni::JString>("accessibilityLabel");
|
|
75
|
+
jni::local_ref<jni::JString> accessibilityLabel = this->getFieldValue(fieldAccessibilityLabel);
|
|
74
76
|
static const auto fieldClusteringEnabled = clazz->getField<jboolean>("clusteringEnabled");
|
|
75
77
|
jboolean clusteringEnabled = this->getFieldValue(fieldClusteringEnabled);
|
|
76
78
|
static const auto fieldAnimation = clazz->getField<JMarkerAnimation>("animation");
|
|
77
79
|
jni::local_ref<JMarkerAnimation> animation = this->getFieldValue(fieldAnimation);
|
|
80
|
+
static const auto fieldAnimationDuration = clazz->getField<double>("animationDuration");
|
|
81
|
+
double animationDuration = this->getFieldValue(fieldAnimationDuration);
|
|
82
|
+
static const auto fieldAnimateOnReappear = clazz->getField<jboolean>("animateOnReappear");
|
|
83
|
+
jboolean animateOnReappear = this->getFieldValue(fieldAnimateOnReappear);
|
|
78
84
|
return MarkerData(
|
|
79
85
|
id->toStdString(),
|
|
80
86
|
coordinate->toCpp(),
|
|
@@ -86,8 +92,11 @@ namespace margelo::nitro::nitromap {
|
|
|
86
92
|
zIndex,
|
|
87
93
|
anchor->toCpp(),
|
|
88
94
|
config->toCpp(),
|
|
95
|
+
accessibilityLabel != nullptr ? std::make_optional(accessibilityLabel->toStdString()) : std::nullopt,
|
|
89
96
|
static_cast<bool>(clusteringEnabled),
|
|
90
|
-
animation->toCpp()
|
|
97
|
+
animation->toCpp(),
|
|
98
|
+
animationDuration,
|
|
99
|
+
static_cast<bool>(animateOnReappear)
|
|
91
100
|
);
|
|
92
101
|
}
|
|
93
102
|
|
|
@@ -97,7 +106,7 @@ namespace margelo::nitro::nitromap {
|
|
|
97
106
|
*/
|
|
98
107
|
[[maybe_unused]]
|
|
99
108
|
static jni::local_ref<JMarkerData::javaobject> fromCpp(const MarkerData& value) {
|
|
100
|
-
using JSignature = JMarkerData(jni::alias_ref<jni::JString>, jni::alias_ref<JCoordinate>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jboolean, double, double, double, jni::alias_ref<JPoint>, jni::alias_ref<JMarkerConfig>, jboolean, jni::alias_ref<JMarkerAnimation
|
|
109
|
+
using JSignature = JMarkerData(jni::alias_ref<jni::JString>, jni::alias_ref<JCoordinate>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jboolean, double, double, double, jni::alias_ref<JPoint>, jni::alias_ref<JMarkerConfig>, jni::alias_ref<jni::JString>, jboolean, jni::alias_ref<JMarkerAnimation>, double, jboolean);
|
|
101
110
|
static const auto clazz = javaClassStatic();
|
|
102
111
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
103
112
|
return create(
|
|
@@ -112,8 +121,11 @@ namespace margelo::nitro::nitromap {
|
|
|
112
121
|
value.zIndex,
|
|
113
122
|
JPoint::fromCpp(value.anchor),
|
|
114
123
|
JMarkerConfig::fromCpp(value.config),
|
|
124
|
+
value.accessibilityLabel.has_value() ? jni::make_jstring(value.accessibilityLabel.value()) : nullptr,
|
|
115
125
|
value.clusteringEnabled,
|
|
116
|
-
JMarkerAnimation::fromCpp(value.animation)
|
|
126
|
+
JMarkerAnimation::fromCpp(value.animation),
|
|
127
|
+
value.animationDuration,
|
|
128
|
+
value.animateOnReappear
|
|
117
129
|
);
|
|
118
130
|
}
|
|
119
131
|
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JPolygonData.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "PolygonData.hpp"
|
|
12
|
+
|
|
13
|
+
#include "Coordinate.hpp"
|
|
14
|
+
#include "CoordinateRing.hpp"
|
|
15
|
+
#include "JCoordinate.hpp"
|
|
16
|
+
#include "JCoordinateRing.hpp"
|
|
17
|
+
#include "JMarkerColor.hpp"
|
|
18
|
+
#include "MarkerColor.hpp"
|
|
19
|
+
#include <optional>
|
|
20
|
+
#include <string>
|
|
21
|
+
#include <vector>
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::nitromap {
|
|
24
|
+
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The C++ JNI bridge between the C++ struct "PolygonData" and the the Kotlin data class "PolygonData".
|
|
29
|
+
*/
|
|
30
|
+
struct JPolygonData final: public jni::JavaClass<JPolygonData> {
|
|
31
|
+
public:
|
|
32
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/PolygonData;";
|
|
33
|
+
|
|
34
|
+
public:
|
|
35
|
+
/**
|
|
36
|
+
* Convert this Java/Kotlin-based struct to the C++ struct PolygonData by copying all values to C++.
|
|
37
|
+
*/
|
|
38
|
+
[[maybe_unused]]
|
|
39
|
+
[[nodiscard]]
|
|
40
|
+
PolygonData toCpp() const {
|
|
41
|
+
static const auto clazz = javaClassStatic();
|
|
42
|
+
static const auto fieldId = clazz->getField<jni::JString>("id");
|
|
43
|
+
jni::local_ref<jni::JString> id = this->getFieldValue(fieldId);
|
|
44
|
+
static const auto fieldCoordinates = clazz->getField<jni::JArrayClass<JCoordinate>>("coordinates");
|
|
45
|
+
jni::local_ref<jni::JArrayClass<JCoordinate>> coordinates = this->getFieldValue(fieldCoordinates);
|
|
46
|
+
static const auto fieldHoles = clazz->getField<jni::JArrayClass<JCoordinateRing>>("holes");
|
|
47
|
+
jni::local_ref<jni::JArrayClass<JCoordinateRing>> holes = this->getFieldValue(fieldHoles);
|
|
48
|
+
static const auto fieldFillColor = clazz->getField<JMarkerColor>("fillColor");
|
|
49
|
+
jni::local_ref<JMarkerColor> fillColor = this->getFieldValue(fieldFillColor);
|
|
50
|
+
static const auto fieldStrokeColor = clazz->getField<JMarkerColor>("strokeColor");
|
|
51
|
+
jni::local_ref<JMarkerColor> strokeColor = this->getFieldValue(fieldStrokeColor);
|
|
52
|
+
static const auto fieldStrokeWidth = clazz->getField<double>("strokeWidth");
|
|
53
|
+
double strokeWidth = this->getFieldValue(fieldStrokeWidth);
|
|
54
|
+
static const auto fieldZIndex = clazz->getField<double>("zIndex");
|
|
55
|
+
double zIndex = this->getFieldValue(fieldZIndex);
|
|
56
|
+
static const auto fieldTappable = clazz->getField<jboolean>("tappable");
|
|
57
|
+
jboolean tappable = this->getFieldValue(fieldTappable);
|
|
58
|
+
static const auto fieldAccessibilityLabel = clazz->getField<jni::JString>("accessibilityLabel");
|
|
59
|
+
jni::local_ref<jni::JString> accessibilityLabel = this->getFieldValue(fieldAccessibilityLabel);
|
|
60
|
+
return PolygonData(
|
|
61
|
+
id->toStdString(),
|
|
62
|
+
[&]() {
|
|
63
|
+
size_t __size = coordinates->size();
|
|
64
|
+
std::vector<Coordinate> __vector;
|
|
65
|
+
__vector.reserve(__size);
|
|
66
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
67
|
+
auto __element = coordinates->getElement(__i);
|
|
68
|
+
__vector.push_back(__element->toCpp());
|
|
69
|
+
}
|
|
70
|
+
return __vector;
|
|
71
|
+
}(),
|
|
72
|
+
[&]() {
|
|
73
|
+
size_t __size = holes->size();
|
|
74
|
+
std::vector<CoordinateRing> __vector;
|
|
75
|
+
__vector.reserve(__size);
|
|
76
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
77
|
+
auto __element = holes->getElement(__i);
|
|
78
|
+
__vector.push_back(__element->toCpp());
|
|
79
|
+
}
|
|
80
|
+
return __vector;
|
|
81
|
+
}(),
|
|
82
|
+
fillColor->toCpp(),
|
|
83
|
+
strokeColor->toCpp(),
|
|
84
|
+
strokeWidth,
|
|
85
|
+
zIndex,
|
|
86
|
+
static_cast<bool>(tappable),
|
|
87
|
+
accessibilityLabel != nullptr ? std::make_optional(accessibilityLabel->toStdString()) : std::nullopt
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public:
|
|
92
|
+
/**
|
|
93
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
94
|
+
*/
|
|
95
|
+
[[maybe_unused]]
|
|
96
|
+
static jni::local_ref<JPolygonData::javaobject> fromCpp(const PolygonData& value) {
|
|
97
|
+
using JSignature = JPolygonData(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<JCoordinate>>, jni::alias_ref<jni::JArrayClass<JCoordinateRing>>, jni::alias_ref<JMarkerColor>, jni::alias_ref<JMarkerColor>, double, double, jboolean, jni::alias_ref<jni::JString>);
|
|
98
|
+
static const auto clazz = javaClassStatic();
|
|
99
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
100
|
+
return create(
|
|
101
|
+
clazz,
|
|
102
|
+
jni::make_jstring(value.id),
|
|
103
|
+
[&]() {
|
|
104
|
+
size_t __size = value.coordinates.size();
|
|
105
|
+
jni::local_ref<jni::JArrayClass<JCoordinate>> __array = jni::JArrayClass<JCoordinate>::newArray(__size);
|
|
106
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
107
|
+
const auto& __element = value.coordinates[__i];
|
|
108
|
+
auto __elementJni = JCoordinate::fromCpp(__element);
|
|
109
|
+
__array->setElement(__i, *__elementJni);
|
|
110
|
+
}
|
|
111
|
+
return __array;
|
|
112
|
+
}(),
|
|
113
|
+
[&]() {
|
|
114
|
+
size_t __size = value.holes.size();
|
|
115
|
+
jni::local_ref<jni::JArrayClass<JCoordinateRing>> __array = jni::JArrayClass<JCoordinateRing>::newArray(__size);
|
|
116
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
117
|
+
const auto& __element = value.holes[__i];
|
|
118
|
+
auto __elementJni = JCoordinateRing::fromCpp(__element);
|
|
119
|
+
__array->setElement(__i, *__elementJni);
|
|
120
|
+
}
|
|
121
|
+
return __array;
|
|
122
|
+
}(),
|
|
123
|
+
JMarkerColor::fromCpp(value.fillColor),
|
|
124
|
+
JMarkerColor::fromCpp(value.strokeColor),
|
|
125
|
+
value.strokeWidth,
|
|
126
|
+
value.zIndex,
|
|
127
|
+
value.tappable,
|
|
128
|
+
value.accessibilityLabel.has_value() ? jni::make_jstring(value.accessibilityLabel.value()) : nullptr
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JPolylineData.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "PolylineData.hpp"
|
|
12
|
+
|
|
13
|
+
#include "Coordinate.hpp"
|
|
14
|
+
#include "JCoordinate.hpp"
|
|
15
|
+
#include "JMarkerColor.hpp"
|
|
16
|
+
#include "MarkerColor.hpp"
|
|
17
|
+
#include <optional>
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <vector>
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::nitromap {
|
|
22
|
+
|
|
23
|
+
using namespace facebook;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The C++ JNI bridge between the C++ struct "PolylineData" and the the Kotlin data class "PolylineData".
|
|
27
|
+
*/
|
|
28
|
+
struct JPolylineData final: public jni::JavaClass<JPolylineData> {
|
|
29
|
+
public:
|
|
30
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/PolylineData;";
|
|
31
|
+
|
|
32
|
+
public:
|
|
33
|
+
/**
|
|
34
|
+
* Convert this Java/Kotlin-based struct to the C++ struct PolylineData by copying all values to C++.
|
|
35
|
+
*/
|
|
36
|
+
[[maybe_unused]]
|
|
37
|
+
[[nodiscard]]
|
|
38
|
+
PolylineData toCpp() const {
|
|
39
|
+
static const auto clazz = javaClassStatic();
|
|
40
|
+
static const auto fieldId = clazz->getField<jni::JString>("id");
|
|
41
|
+
jni::local_ref<jni::JString> id = this->getFieldValue(fieldId);
|
|
42
|
+
static const auto fieldCoordinates = clazz->getField<jni::JArrayClass<JCoordinate>>("coordinates");
|
|
43
|
+
jni::local_ref<jni::JArrayClass<JCoordinate>> coordinates = this->getFieldValue(fieldCoordinates);
|
|
44
|
+
static const auto fieldStrokeColor = clazz->getField<JMarkerColor>("strokeColor");
|
|
45
|
+
jni::local_ref<JMarkerColor> strokeColor = this->getFieldValue(fieldStrokeColor);
|
|
46
|
+
static const auto fieldStrokeWidth = clazz->getField<double>("strokeWidth");
|
|
47
|
+
double strokeWidth = this->getFieldValue(fieldStrokeWidth);
|
|
48
|
+
static const auto fieldGeodesic = clazz->getField<jboolean>("geodesic");
|
|
49
|
+
jboolean geodesic = this->getFieldValue(fieldGeodesic);
|
|
50
|
+
static const auto fieldDashed = clazz->getField<jboolean>("dashed");
|
|
51
|
+
jboolean dashed = this->getFieldValue(fieldDashed);
|
|
52
|
+
static const auto fieldZIndex = clazz->getField<double>("zIndex");
|
|
53
|
+
double zIndex = this->getFieldValue(fieldZIndex);
|
|
54
|
+
static const auto fieldTappable = clazz->getField<jboolean>("tappable");
|
|
55
|
+
jboolean tappable = this->getFieldValue(fieldTappable);
|
|
56
|
+
static const auto fieldAccessibilityLabel = clazz->getField<jni::JString>("accessibilityLabel");
|
|
57
|
+
jni::local_ref<jni::JString> accessibilityLabel = this->getFieldValue(fieldAccessibilityLabel);
|
|
58
|
+
return PolylineData(
|
|
59
|
+
id->toStdString(),
|
|
60
|
+
[&]() {
|
|
61
|
+
size_t __size = coordinates->size();
|
|
62
|
+
std::vector<Coordinate> __vector;
|
|
63
|
+
__vector.reserve(__size);
|
|
64
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
65
|
+
auto __element = coordinates->getElement(__i);
|
|
66
|
+
__vector.push_back(__element->toCpp());
|
|
67
|
+
}
|
|
68
|
+
return __vector;
|
|
69
|
+
}(),
|
|
70
|
+
strokeColor->toCpp(),
|
|
71
|
+
strokeWidth,
|
|
72
|
+
static_cast<bool>(geodesic),
|
|
73
|
+
static_cast<bool>(dashed),
|
|
74
|
+
zIndex,
|
|
75
|
+
static_cast<bool>(tappable),
|
|
76
|
+
accessibilityLabel != nullptr ? std::make_optional(accessibilityLabel->toStdString()) : std::nullopt
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public:
|
|
81
|
+
/**
|
|
82
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
83
|
+
*/
|
|
84
|
+
[[maybe_unused]]
|
|
85
|
+
static jni::local_ref<JPolylineData::javaobject> fromCpp(const PolylineData& value) {
|
|
86
|
+
using JSignature = JPolylineData(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<JCoordinate>>, jni::alias_ref<JMarkerColor>, double, jboolean, jboolean, double, jboolean, jni::alias_ref<jni::JString>);
|
|
87
|
+
static const auto clazz = javaClassStatic();
|
|
88
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
89
|
+
return create(
|
|
90
|
+
clazz,
|
|
91
|
+
jni::make_jstring(value.id),
|
|
92
|
+
[&]() {
|
|
93
|
+
size_t __size = value.coordinates.size();
|
|
94
|
+
jni::local_ref<jni::JArrayClass<JCoordinate>> __array = jni::JArrayClass<JCoordinate>::newArray(__size);
|
|
95
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
96
|
+
const auto& __element = value.coordinates[__i];
|
|
97
|
+
auto __elementJni = JCoordinate::fromCpp(__element);
|
|
98
|
+
__array->setElement(__i, *__elementJni);
|
|
99
|
+
}
|
|
100
|
+
return __array;
|
|
101
|
+
}(),
|
|
102
|
+
JMarkerColor::fromCpp(value.strokeColor),
|
|
103
|
+
value.strokeWidth,
|
|
104
|
+
value.geodesic,
|
|
105
|
+
value.dashed,
|
|
106
|
+
value.zIndex,
|
|
107
|
+
value.tappable,
|
|
108
|
+
value.accessibilityLabel.has_value() ? jni::make_jstring(value.accessibilityLabel.value()) : nullptr
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JUserLocationChangeEvent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "UserLocationChangeEvent.hpp"
|
|
12
|
+
|
|
13
|
+
#include "Coordinate.hpp"
|
|
14
|
+
#include "JCoordinate.hpp"
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::nitromap {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "UserLocationChangeEvent" and the the Kotlin data class "UserLocationChangeEvent".
|
|
22
|
+
*/
|
|
23
|
+
struct JUserLocationChangeEvent final: public jni::JavaClass<JUserLocationChangeEvent> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/UserLocationChangeEvent;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct UserLocationChangeEvent by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
UserLocationChangeEvent toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldCoordinate = clazz->getField<JCoordinate>("coordinate");
|
|
36
|
+
jni::local_ref<JCoordinate> coordinate = this->getFieldValue(fieldCoordinate);
|
|
37
|
+
static const auto fieldAccuracy = clazz->getField<double>("accuracy");
|
|
38
|
+
double accuracy = this->getFieldValue(fieldAccuracy);
|
|
39
|
+
static const auto fieldHeading = clazz->getField<double>("heading");
|
|
40
|
+
double heading = this->getFieldValue(fieldHeading);
|
|
41
|
+
static const auto fieldSpeed = clazz->getField<double>("speed");
|
|
42
|
+
double speed = this->getFieldValue(fieldSpeed);
|
|
43
|
+
return UserLocationChangeEvent(
|
|
44
|
+
coordinate->toCpp(),
|
|
45
|
+
accuracy,
|
|
46
|
+
heading,
|
|
47
|
+
speed
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
/**
|
|
53
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
54
|
+
*/
|
|
55
|
+
[[maybe_unused]]
|
|
56
|
+
static jni::local_ref<JUserLocationChangeEvent::javaobject> fromCpp(const UserLocationChangeEvent& value) {
|
|
57
|
+
using JSignature = JUserLocationChangeEvent(jni::alias_ref<JCoordinate>, double, double, double);
|
|
58
|
+
static const auto clazz = javaClassStatic();
|
|
59
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
60
|
+
return create(
|
|
61
|
+
clazz,
|
|
62
|
+
JCoordinate::fromCpp(value.coordinate),
|
|
63
|
+
value.accuracy,
|
|
64
|
+
value.heading,
|
|
65
|
+
value.speed
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JUserTrackingMode.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "UserTrackingMode.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitromap {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "UserTrackingMode" and the the Kotlin enum "UserTrackingMode".
|
|
19
|
+
*/
|
|
20
|
+
struct JUserTrackingMode final: public jni::JavaClass<JUserTrackingMode> {
|
|
21
|
+
public:
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/UserTrackingMode;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum UserTrackingMode.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
UserTrackingMode toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<UserTrackingMode>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JUserTrackingMode> fromCpp(UserTrackingMode value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
static const auto fieldNONE = clazz->getStaticField<JUserTrackingMode>("NONE");
|
|
45
|
+
static const auto fieldFOLLOW = clazz->getStaticField<JUserTrackingMode>("FOLLOW");
|
|
46
|
+
static const auto fieldFOLLOWWITHHEADING = clazz->getStaticField<JUserTrackingMode>("FOLLOWWITHHEADING");
|
|
47
|
+
|
|
48
|
+
switch (value) {
|
|
49
|
+
case UserTrackingMode::NONE:
|
|
50
|
+
return clazz->getStaticFieldValue(fieldNONE);
|
|
51
|
+
case UserTrackingMode::FOLLOW:
|
|
52
|
+
return clazz->getStaticFieldValue(fieldFOLLOW);
|
|
53
|
+
case UserTrackingMode::FOLLOWWITHHEADING:
|
|
54
|
+
return clazz->getStaticFieldValue(fieldFOLLOWWITHHEADING);
|
|
55
|
+
default:
|
|
56
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
57
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -44,6 +44,10 @@ void JHybridNitroMapStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /*
|
|
|
44
44
|
view->setInitialRegion(props.initialRegion.value);
|
|
45
45
|
// TODO: Set isDirty = false
|
|
46
46
|
}
|
|
47
|
+
if (props.region.isDirty) {
|
|
48
|
+
view->setRegion(props.region.value);
|
|
49
|
+
// TODO: Set isDirty = false
|
|
50
|
+
}
|
|
47
51
|
if (props.showsUserLocation.isDirty) {
|
|
48
52
|
view->setShowsUserLocation(props.showsUserLocation.value);
|
|
49
53
|
// TODO: Set isDirty = false
|
|
@@ -72,18 +76,54 @@ void JHybridNitroMapStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /*
|
|
|
72
76
|
view->setCustomMapStyle(props.customMapStyle.value);
|
|
73
77
|
// TODO: Set isDirty = false
|
|
74
78
|
}
|
|
75
|
-
if (props.showsMyLocationButton.isDirty) {
|
|
76
|
-
view->setShowsMyLocationButton(props.showsMyLocationButton.value);
|
|
77
|
-
// TODO: Set isDirty = false
|
|
78
|
-
}
|
|
79
79
|
if (props.clusterConfig.isDirty) {
|
|
80
80
|
view->setClusterConfig(props.clusterConfig.value);
|
|
81
81
|
// TODO: Set isDirty = false
|
|
82
82
|
}
|
|
83
|
+
if (props.mapPadding.isDirty) {
|
|
84
|
+
view->setMapPadding(props.mapPadding.value);
|
|
85
|
+
// TODO: Set isDirty = false
|
|
86
|
+
}
|
|
87
|
+
if (props.showsTraffic.isDirty) {
|
|
88
|
+
view->setShowsTraffic(props.showsTraffic.value);
|
|
89
|
+
// TODO: Set isDirty = false
|
|
90
|
+
}
|
|
91
|
+
if (props.showsBuildings.isDirty) {
|
|
92
|
+
view->setShowsBuildings(props.showsBuildings.value);
|
|
93
|
+
// TODO: Set isDirty = false
|
|
94
|
+
}
|
|
95
|
+
if (props.showsCompass.isDirty) {
|
|
96
|
+
view->setShowsCompass(props.showsCompass.value);
|
|
97
|
+
// TODO: Set isDirty = false
|
|
98
|
+
}
|
|
99
|
+
if (props.minZoom.isDirty) {
|
|
100
|
+
view->setMinZoom(props.minZoom.value);
|
|
101
|
+
// TODO: Set isDirty = false
|
|
102
|
+
}
|
|
103
|
+
if (props.maxZoom.isDirty) {
|
|
104
|
+
view->setMaxZoom(props.maxZoom.value);
|
|
105
|
+
// TODO: Set isDirty = false
|
|
106
|
+
}
|
|
83
107
|
if (props.darkMode.isDirty) {
|
|
84
108
|
view->setDarkMode(props.darkMode.value);
|
|
85
109
|
// TODO: Set isDirty = false
|
|
86
110
|
}
|
|
111
|
+
if (props.userTrackingMode.isDirty) {
|
|
112
|
+
view->setUserTrackingMode(props.userTrackingMode.value);
|
|
113
|
+
// TODO: Set isDirty = false
|
|
114
|
+
}
|
|
115
|
+
if (props.userLocationImage.isDirty) {
|
|
116
|
+
view->setUserLocationImage(props.userLocationImage.value);
|
|
117
|
+
// TODO: Set isDirty = false
|
|
118
|
+
}
|
|
119
|
+
if (props.userLocationSize.isDirty) {
|
|
120
|
+
view->setUserLocationSize(props.userLocationSize.value);
|
|
121
|
+
// TODO: Set isDirty = false
|
|
122
|
+
}
|
|
123
|
+
if (props.userLocationAnchor.isDirty) {
|
|
124
|
+
view->setUserLocationAnchor(props.userLocationAnchor.value);
|
|
125
|
+
// TODO: Set isDirty = false
|
|
126
|
+
}
|
|
87
127
|
if (props.onPress.isDirty) {
|
|
88
128
|
view->setOnPress(props.onPress.value);
|
|
89
129
|
// TODO: Set isDirty = false
|
|
@@ -124,10 +164,38 @@ void JHybridNitroMapStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /*
|
|
|
124
164
|
view->setOnClusterPress(props.onClusterPress.value);
|
|
125
165
|
// TODO: Set isDirty = false
|
|
126
166
|
}
|
|
167
|
+
if (props.onPolylinePress.isDirty) {
|
|
168
|
+
view->setOnPolylinePress(props.onPolylinePress.value);
|
|
169
|
+
// TODO: Set isDirty = false
|
|
170
|
+
}
|
|
171
|
+
if (props.onPolygonPress.isDirty) {
|
|
172
|
+
view->setOnPolygonPress(props.onPolygonPress.value);
|
|
173
|
+
// TODO: Set isDirty = false
|
|
174
|
+
}
|
|
175
|
+
if (props.onCirclePress.isDirty) {
|
|
176
|
+
view->setOnCirclePress(props.onCirclePress.value);
|
|
177
|
+
// TODO: Set isDirty = false
|
|
178
|
+
}
|
|
127
179
|
if (props.onError.isDirty) {
|
|
128
180
|
view->setOnError(props.onError.value);
|
|
129
181
|
// TODO: Set isDirty = false
|
|
130
182
|
}
|
|
183
|
+
if (props.onUserLocationChange.isDirty) {
|
|
184
|
+
view->setOnUserLocationChange(props.onUserLocationChange.value);
|
|
185
|
+
// TODO: Set isDirty = false
|
|
186
|
+
}
|
|
187
|
+
if (props.onUserTrackingModeChange.isDirty) {
|
|
188
|
+
view->setOnUserTrackingModeChange(props.onUserTrackingModeChange.value);
|
|
189
|
+
// TODO: Set isDirty = false
|
|
190
|
+
}
|
|
191
|
+
if (props.onUserLocationError.isDirty) {
|
|
192
|
+
view->setOnUserLocationError(props.onUserLocationError.value);
|
|
193
|
+
// TODO: Set isDirty = false
|
|
194
|
+
}
|
|
195
|
+
if (props.onMapIdle.isDirty) {
|
|
196
|
+
view->setOnMapIdle(props.onMapIdle.value);
|
|
197
|
+
// TODO: Set isDirty = false
|
|
198
|
+
}
|
|
131
199
|
|
|
132
200
|
// Update hybridRef if it changed
|
|
133
201
|
if (props.hybridRef.isDirty) {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CircleData.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitromap
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "CircleData".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class CircleData(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val id: String,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val center: Coordinate,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val radius: Double,
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
val fillColor: MarkerColor,
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
val strokeColor: MarkerColor,
|
|
35
|
+
@DoNotStrip
|
|
36
|
+
@Keep
|
|
37
|
+
val strokeWidth: Double,
|
|
38
|
+
@DoNotStrip
|
|
39
|
+
@Keep
|
|
40
|
+
val zIndex: Double,
|
|
41
|
+
@DoNotStrip
|
|
42
|
+
@Keep
|
|
43
|
+
val tappable: Boolean,
|
|
44
|
+
@DoNotStrip
|
|
45
|
+
@Keep
|
|
46
|
+
val accessibilityLabel: String?
|
|
47
|
+
) {
|
|
48
|
+
/* primary constructor */
|
|
49
|
+
|
|
50
|
+
private companion object {
|
|
51
|
+
/**
|
|
52
|
+
* Constructor called from C++
|
|
53
|
+
*/
|
|
54
|
+
@DoNotStrip
|
|
55
|
+
@Keep
|
|
56
|
+
@Suppress("unused")
|
|
57
|
+
@JvmStatic
|
|
58
|
+
private fun fromCpp(id: String, center: Coordinate, radius: Double, fillColor: MarkerColor, strokeColor: MarkerColor, strokeWidth: Double, zIndex: Double, tappable: Boolean, accessibilityLabel: String?): CircleData {
|
|
59
|
+
return CircleData(id, center, radius, fillColor, strokeColor, strokeWidth, zIndex, tappable, accessibilityLabel)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -49,10 +49,10 @@ data class ClusterConfig(
|
|
|
49
49
|
val animatesClusters: Boolean?,
|
|
50
50
|
@DoNotStrip
|
|
51
51
|
@Keep
|
|
52
|
-
val
|
|
52
|
+
val animateOnReappear: Boolean?,
|
|
53
53
|
@DoNotStrip
|
|
54
54
|
@Keep
|
|
55
|
-
val
|
|
55
|
+
val animationDuration: Double?,
|
|
56
56
|
@DoNotStrip
|
|
57
57
|
@Keep
|
|
58
58
|
val realtimeClustering: Boolean?,
|
|
@@ -73,8 +73,8 @@ data class ClusterConfig(
|
|
|
73
73
|
@Keep
|
|
74
74
|
@Suppress("unused")
|
|
75
75
|
@JvmStatic
|
|
76
|
-
private fun fromCpp(enabled: Boolean, strategy: ClusterStrategy?, radius: Double?, minimumClusterSize: Double?, maxZoom: Double?, backgroundColor: Variant_String_MarkerColor?, textColor: Variant_String_MarkerColor?, borderWidth: Double?, borderColor: Variant_String_MarkerColor?, animatesClusters: Boolean?,
|
|
77
|
-
return ClusterConfig(enabled, strategy, radius, minimumClusterSize, maxZoom, backgroundColor, textColor, borderWidth, borderColor, animatesClusters,
|
|
76
|
+
private fun fromCpp(enabled: Boolean, strategy: ClusterStrategy?, radius: Double?, minimumClusterSize: Double?, maxZoom: Double?, backgroundColor: Variant_String_MarkerColor?, textColor: Variant_String_MarkerColor?, borderWidth: Double?, borderColor: Variant_String_MarkerColor?, animatesClusters: Boolean?, animateOnReappear: Boolean?, animationDuration: Double?, realtimeClustering: Boolean?, renderBuffer: Double?, throttleInterval: Double?): ClusterConfig {
|
|
77
|
+
return ClusterConfig(enabled, strategy, radius, minimumClusterSize, maxZoom, backgroundColor, textColor, borderWidth, borderColor, animatesClusters, animateOnReappear, animationDuration, realtimeClustering, renderBuffer, throttleInterval)
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CoordinateRing.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitromap
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "CoordinateRing".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class CoordinateRing(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val coordinates: Array<Coordinate>
|
|
23
|
+
) {
|
|
24
|
+
/* primary constructor */
|
|
25
|
+
|
|
26
|
+
private companion object {
|
|
27
|
+
/**
|
|
28
|
+
* Constructor called from C++
|
|
29
|
+
*/
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
@Suppress("unused")
|
|
33
|
+
@JvmStatic
|
|
34
|
+
private fun fromCpp(coordinates: Array<Coordinate>): CoordinateRing {
|
|
35
|
+
return CoordinateRing(coordinates)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|