@maydon_tech/react-native-nitro-maps 0.1.3 → 0.2.0
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/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/Clustering/ClusterIconRenderer.swift +3 -3
- 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 +135 -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 +75 -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++/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 +328 -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 +149 -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/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 +175 -17
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Umbrella.hpp +15 -3
- package/nitrogen/generated/ios/c++/HybridNitroMapSpecSwift.hpp +249 -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/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 +179 -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++/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 +114 -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 +23 -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 +77 -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
|
@@ -27,15 +27,12 @@
|
|
|
27
27
|
namespace margelo::nitro::nitromap { enum class ClusterStrategy; }
|
|
28
28
|
// Forward declaration of `MarkerColor` to properly resolve imports.
|
|
29
29
|
namespace margelo::nitro::nitromap { struct MarkerColor; }
|
|
30
|
-
// Forward declaration of `ClusterAnimationStyle` to properly resolve imports.
|
|
31
|
-
namespace margelo::nitro::nitromap { enum class ClusterAnimationStyle; }
|
|
32
30
|
|
|
33
31
|
#include "ClusterStrategy.hpp"
|
|
34
32
|
#include <optional>
|
|
35
33
|
#include <string>
|
|
36
34
|
#include "MarkerColor.hpp"
|
|
37
35
|
#include <variant>
|
|
38
|
-
#include "ClusterAnimationStyle.hpp"
|
|
39
36
|
|
|
40
37
|
namespace margelo::nitro::nitromap {
|
|
41
38
|
|
|
@@ -54,15 +51,15 @@ namespace margelo::nitro::nitromap {
|
|
|
54
51
|
std::optional<double> borderWidth SWIFT_PRIVATE;
|
|
55
52
|
std::optional<std::variant<std::string, MarkerColor>> borderColor SWIFT_PRIVATE;
|
|
56
53
|
std::optional<bool> animatesClusters SWIFT_PRIVATE;
|
|
54
|
+
std::optional<bool> animateOnReappear SWIFT_PRIVATE;
|
|
57
55
|
std::optional<double> animationDuration SWIFT_PRIVATE;
|
|
58
|
-
std::optional<ClusterAnimationStyle> animationStyle SWIFT_PRIVATE;
|
|
59
56
|
std::optional<bool> realtimeClustering SWIFT_PRIVATE;
|
|
60
57
|
std::optional<double> renderBuffer SWIFT_PRIVATE;
|
|
61
58
|
std::optional<double> throttleInterval SWIFT_PRIVATE;
|
|
62
59
|
|
|
63
60
|
public:
|
|
64
61
|
ClusterConfig() = default;
|
|
65
|
-
explicit ClusterConfig(bool enabled, std::optional<ClusterStrategy> strategy, std::optional<double> radius, std::optional<double> minimumClusterSize, std::optional<double> maxZoom, std::optional<std::variant<std::string, MarkerColor>> backgroundColor, std::optional<std::variant<std::string, MarkerColor>> textColor, std::optional<double> borderWidth, std::optional<std::variant<std::string, MarkerColor>> borderColor, std::optional<bool> animatesClusters, std::optional<
|
|
62
|
+
explicit ClusterConfig(bool enabled, std::optional<ClusterStrategy> strategy, std::optional<double> radius, std::optional<double> minimumClusterSize, std::optional<double> maxZoom, std::optional<std::variant<std::string, MarkerColor>> backgroundColor, std::optional<std::variant<std::string, MarkerColor>> textColor, std::optional<double> borderWidth, std::optional<std::variant<std::string, MarkerColor>> borderColor, std::optional<bool> animatesClusters, std::optional<bool> animateOnReappear, std::optional<double> animationDuration, std::optional<bool> realtimeClustering, std::optional<double> renderBuffer, std::optional<double> throttleInterval): enabled(enabled), strategy(strategy), radius(radius), minimumClusterSize(minimumClusterSize), maxZoom(maxZoom), backgroundColor(backgroundColor), textColor(textColor), borderWidth(borderWidth), borderColor(borderColor), animatesClusters(animatesClusters), animateOnReappear(animateOnReappear), animationDuration(animationDuration), realtimeClustering(realtimeClustering), renderBuffer(renderBuffer), throttleInterval(throttleInterval) {}
|
|
66
63
|
};
|
|
67
64
|
|
|
68
65
|
} // namespace margelo::nitro::nitromap
|
|
@@ -85,8 +82,8 @@ namespace margelo::nitro {
|
|
|
85
82
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "borderWidth")),
|
|
86
83
|
JSIConverter<std::optional<std::variant<std::string, margelo::nitro::nitromap::MarkerColor>>>::fromJSI(runtime, obj.getProperty(runtime, "borderColor")),
|
|
87
84
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "animatesClusters")),
|
|
85
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "animateOnReappear")),
|
|
88
86
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "animationDuration")),
|
|
89
|
-
JSIConverter<std::optional<margelo::nitro::nitromap::ClusterAnimationStyle>>::fromJSI(runtime, obj.getProperty(runtime, "animationStyle")),
|
|
90
87
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "realtimeClustering")),
|
|
91
88
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "renderBuffer")),
|
|
92
89
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "throttleInterval"))
|
|
@@ -104,8 +101,8 @@ namespace margelo::nitro {
|
|
|
104
101
|
obj.setProperty(runtime, "borderWidth", JSIConverter<std::optional<double>>::toJSI(runtime, arg.borderWidth));
|
|
105
102
|
obj.setProperty(runtime, "borderColor", JSIConverter<std::optional<std::variant<std::string, margelo::nitro::nitromap::MarkerColor>>>::toJSI(runtime, arg.borderColor));
|
|
106
103
|
obj.setProperty(runtime, "animatesClusters", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.animatesClusters));
|
|
104
|
+
obj.setProperty(runtime, "animateOnReappear", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.animateOnReappear));
|
|
107
105
|
obj.setProperty(runtime, "animationDuration", JSIConverter<std::optional<double>>::toJSI(runtime, arg.animationDuration));
|
|
108
|
-
obj.setProperty(runtime, "animationStyle", JSIConverter<std::optional<margelo::nitro::nitromap::ClusterAnimationStyle>>::toJSI(runtime, arg.animationStyle));
|
|
109
106
|
obj.setProperty(runtime, "realtimeClustering", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.realtimeClustering));
|
|
110
107
|
obj.setProperty(runtime, "renderBuffer", JSIConverter<std::optional<double>>::toJSI(runtime, arg.renderBuffer));
|
|
111
108
|
obj.setProperty(runtime, "throttleInterval", JSIConverter<std::optional<double>>::toJSI(runtime, arg.throttleInterval));
|
|
@@ -129,8 +126,8 @@ namespace margelo::nitro {
|
|
|
129
126
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "borderWidth"))) return false;
|
|
130
127
|
if (!JSIConverter<std::optional<std::variant<std::string, margelo::nitro::nitromap::MarkerColor>>>::canConvert(runtime, obj.getProperty(runtime, "borderColor"))) return false;
|
|
131
128
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "animatesClusters"))) return false;
|
|
129
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "animateOnReappear"))) return false;
|
|
132
130
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "animationDuration"))) return false;
|
|
133
|
-
if (!JSIConverter<std::optional<margelo::nitro::nitromap::ClusterAnimationStyle>>::canConvert(runtime, obj.getProperty(runtime, "animationStyle"))) return false;
|
|
134
131
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "realtimeClustering"))) return false;
|
|
135
132
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "renderBuffer"))) return false;
|
|
136
133
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "throttleInterval"))) return false;
|
|
@@ -18,6 +18,8 @@ namespace margelo::nitro::nitromap {
|
|
|
18
18
|
prototype.registerHybridSetter("provider", &HybridNitroMapSpec::setProvider);
|
|
19
19
|
prototype.registerHybridGetter("initialRegion", &HybridNitroMapSpec::getInitialRegion);
|
|
20
20
|
prototype.registerHybridSetter("initialRegion", &HybridNitroMapSpec::setInitialRegion);
|
|
21
|
+
prototype.registerHybridGetter("region", &HybridNitroMapSpec::getRegion);
|
|
22
|
+
prototype.registerHybridSetter("region", &HybridNitroMapSpec::setRegion);
|
|
21
23
|
prototype.registerHybridGetter("showsUserLocation", &HybridNitroMapSpec::getShowsUserLocation);
|
|
22
24
|
prototype.registerHybridSetter("showsUserLocation", &HybridNitroMapSpec::setShowsUserLocation);
|
|
23
25
|
prototype.registerHybridGetter("zoomEnabled", &HybridNitroMapSpec::getZoomEnabled);
|
|
@@ -32,12 +34,30 @@ namespace margelo::nitro::nitromap {
|
|
|
32
34
|
prototype.registerHybridSetter("mapType", &HybridNitroMapSpec::setMapType);
|
|
33
35
|
prototype.registerHybridGetter("customMapStyle", &HybridNitroMapSpec::getCustomMapStyle);
|
|
34
36
|
prototype.registerHybridSetter("customMapStyle", &HybridNitroMapSpec::setCustomMapStyle);
|
|
35
|
-
prototype.registerHybridGetter("showsMyLocationButton", &HybridNitroMapSpec::getShowsMyLocationButton);
|
|
36
|
-
prototype.registerHybridSetter("showsMyLocationButton", &HybridNitroMapSpec::setShowsMyLocationButton);
|
|
37
37
|
prototype.registerHybridGetter("clusterConfig", &HybridNitroMapSpec::getClusterConfig);
|
|
38
38
|
prototype.registerHybridSetter("clusterConfig", &HybridNitroMapSpec::setClusterConfig);
|
|
39
|
+
prototype.registerHybridGetter("mapPadding", &HybridNitroMapSpec::getMapPadding);
|
|
40
|
+
prototype.registerHybridSetter("mapPadding", &HybridNitroMapSpec::setMapPadding);
|
|
41
|
+
prototype.registerHybridGetter("showsTraffic", &HybridNitroMapSpec::getShowsTraffic);
|
|
42
|
+
prototype.registerHybridSetter("showsTraffic", &HybridNitroMapSpec::setShowsTraffic);
|
|
43
|
+
prototype.registerHybridGetter("showsBuildings", &HybridNitroMapSpec::getShowsBuildings);
|
|
44
|
+
prototype.registerHybridSetter("showsBuildings", &HybridNitroMapSpec::setShowsBuildings);
|
|
45
|
+
prototype.registerHybridGetter("showsCompass", &HybridNitroMapSpec::getShowsCompass);
|
|
46
|
+
prototype.registerHybridSetter("showsCompass", &HybridNitroMapSpec::setShowsCompass);
|
|
47
|
+
prototype.registerHybridGetter("minZoom", &HybridNitroMapSpec::getMinZoom);
|
|
48
|
+
prototype.registerHybridSetter("minZoom", &HybridNitroMapSpec::setMinZoom);
|
|
49
|
+
prototype.registerHybridGetter("maxZoom", &HybridNitroMapSpec::getMaxZoom);
|
|
50
|
+
prototype.registerHybridSetter("maxZoom", &HybridNitroMapSpec::setMaxZoom);
|
|
39
51
|
prototype.registerHybridGetter("darkMode", &HybridNitroMapSpec::getDarkMode);
|
|
40
52
|
prototype.registerHybridSetter("darkMode", &HybridNitroMapSpec::setDarkMode);
|
|
53
|
+
prototype.registerHybridGetter("userTrackingMode", &HybridNitroMapSpec::getUserTrackingMode);
|
|
54
|
+
prototype.registerHybridSetter("userTrackingMode", &HybridNitroMapSpec::setUserTrackingMode);
|
|
55
|
+
prototype.registerHybridGetter("userLocationImage", &HybridNitroMapSpec::getUserLocationImage);
|
|
56
|
+
prototype.registerHybridSetter("userLocationImage", &HybridNitroMapSpec::setUserLocationImage);
|
|
57
|
+
prototype.registerHybridGetter("userLocationSize", &HybridNitroMapSpec::getUserLocationSize);
|
|
58
|
+
prototype.registerHybridSetter("userLocationSize", &HybridNitroMapSpec::setUserLocationSize);
|
|
59
|
+
prototype.registerHybridGetter("userLocationAnchor", &HybridNitroMapSpec::getUserLocationAnchor);
|
|
60
|
+
prototype.registerHybridSetter("userLocationAnchor", &HybridNitroMapSpec::setUserLocationAnchor);
|
|
41
61
|
prototype.registerHybridGetter("onPress", &HybridNitroMapSpec::getOnPress);
|
|
42
62
|
prototype.registerHybridSetter("onPress", &HybridNitroMapSpec::setOnPress);
|
|
43
63
|
prototype.registerHybridGetter("onLongPress", &HybridNitroMapSpec::getOnLongPress);
|
|
@@ -58,24 +78,55 @@ namespace margelo::nitro::nitromap {
|
|
|
58
78
|
prototype.registerHybridSetter("onMarkerDragEnd", &HybridNitroMapSpec::setOnMarkerDragEnd);
|
|
59
79
|
prototype.registerHybridGetter("onClusterPress", &HybridNitroMapSpec::getOnClusterPress);
|
|
60
80
|
prototype.registerHybridSetter("onClusterPress", &HybridNitroMapSpec::setOnClusterPress);
|
|
81
|
+
prototype.registerHybridGetter("onPolylinePress", &HybridNitroMapSpec::getOnPolylinePress);
|
|
82
|
+
prototype.registerHybridSetter("onPolylinePress", &HybridNitroMapSpec::setOnPolylinePress);
|
|
83
|
+
prototype.registerHybridGetter("onPolygonPress", &HybridNitroMapSpec::getOnPolygonPress);
|
|
84
|
+
prototype.registerHybridSetter("onPolygonPress", &HybridNitroMapSpec::setOnPolygonPress);
|
|
85
|
+
prototype.registerHybridGetter("onCirclePress", &HybridNitroMapSpec::getOnCirclePress);
|
|
86
|
+
prototype.registerHybridSetter("onCirclePress", &HybridNitroMapSpec::setOnCirclePress);
|
|
61
87
|
prototype.registerHybridGetter("onError", &HybridNitroMapSpec::getOnError);
|
|
62
88
|
prototype.registerHybridSetter("onError", &HybridNitroMapSpec::setOnError);
|
|
89
|
+
prototype.registerHybridGetter("onUserLocationChange", &HybridNitroMapSpec::getOnUserLocationChange);
|
|
90
|
+
prototype.registerHybridSetter("onUserLocationChange", &HybridNitroMapSpec::setOnUserLocationChange);
|
|
91
|
+
prototype.registerHybridGetter("onUserTrackingModeChange", &HybridNitroMapSpec::getOnUserTrackingModeChange);
|
|
92
|
+
prototype.registerHybridSetter("onUserTrackingModeChange", &HybridNitroMapSpec::setOnUserTrackingModeChange);
|
|
93
|
+
prototype.registerHybridGetter("onUserLocationError", &HybridNitroMapSpec::getOnUserLocationError);
|
|
94
|
+
prototype.registerHybridSetter("onUserLocationError", &HybridNitroMapSpec::setOnUserLocationError);
|
|
95
|
+
prototype.registerHybridGetter("onMapIdle", &HybridNitroMapSpec::getOnMapIdle);
|
|
96
|
+
prototype.registerHybridSetter("onMapIdle", &HybridNitroMapSpec::setOnMapIdle);
|
|
63
97
|
prototype.registerHybridMethod("animateToRegion", &HybridNitroMapSpec::animateToRegion);
|
|
64
98
|
prototype.registerHybridMethod("fitToCoordinates", &HybridNitroMapSpec::fitToCoordinates);
|
|
99
|
+
prototype.registerHybridMethod("fitToSuppliedMarkers", &HybridNitroMapSpec::fitToSuppliedMarkers);
|
|
65
100
|
prototype.registerHybridMethod("animateCamera", &HybridNitroMapSpec::animateCamera);
|
|
66
101
|
prototype.registerHybridMethod("getCamera", &HybridNitroMapSpec::getCamera);
|
|
67
102
|
prototype.registerHybridMethod("setCamera", &HybridNitroMapSpec::setCamera);
|
|
68
103
|
prototype.registerHybridMethod("setMapStyle", &HybridNitroMapSpec::setMapStyle);
|
|
69
104
|
prototype.registerHybridMethod("getMapBoundaries", &HybridNitroMapSpec::getMapBoundaries);
|
|
105
|
+
prototype.registerHybridMethod("centerOnUserLocation", &HybridNitroMapSpec::centerOnUserLocation);
|
|
106
|
+
prototype.registerHybridMethod("pointForCoordinate", &HybridNitroMapSpec::pointForCoordinate);
|
|
107
|
+
prototype.registerHybridMethod("coordinateForPoint", &HybridNitroMapSpec::coordinateForPoint);
|
|
70
108
|
prototype.registerHybridMethod("setIsDarkMode", &HybridNitroMapSpec::setIsDarkMode);
|
|
71
109
|
prototype.registerHybridMethod("addMarker", &HybridNitroMapSpec::addMarker);
|
|
72
110
|
prototype.registerHybridMethod("addMarkers", &HybridNitroMapSpec::addMarkers);
|
|
73
111
|
prototype.registerHybridMethod("updateMarker", &HybridNitroMapSpec::updateMarker);
|
|
74
112
|
prototype.registerHybridMethod("removeMarker", &HybridNitroMapSpec::removeMarker);
|
|
75
113
|
prototype.registerHybridMethod("selectMarker", &HybridNitroMapSpec::selectMarker);
|
|
114
|
+
prototype.registerHybridMethod("deselectMarker", &HybridNitroMapSpec::deselectMarker);
|
|
76
115
|
prototype.registerHybridMethod("clearMarkers", &HybridNitroMapSpec::clearMarkers);
|
|
77
116
|
prototype.registerHybridMethod("setClusteringEnabled", &HybridNitroMapSpec::setClusteringEnabled);
|
|
78
117
|
prototype.registerHybridMethod("refreshClusters", &HybridNitroMapSpec::refreshClusters);
|
|
118
|
+
prototype.registerHybridMethod("addPolyline", &HybridNitroMapSpec::addPolyline);
|
|
119
|
+
prototype.registerHybridMethod("updatePolyline", &HybridNitroMapSpec::updatePolyline);
|
|
120
|
+
prototype.registerHybridMethod("removePolyline", &HybridNitroMapSpec::removePolyline);
|
|
121
|
+
prototype.registerHybridMethod("clearPolylines", &HybridNitroMapSpec::clearPolylines);
|
|
122
|
+
prototype.registerHybridMethod("addPolygon", &HybridNitroMapSpec::addPolygon);
|
|
123
|
+
prototype.registerHybridMethod("updatePolygon", &HybridNitroMapSpec::updatePolygon);
|
|
124
|
+
prototype.registerHybridMethod("removePolygon", &HybridNitroMapSpec::removePolygon);
|
|
125
|
+
prototype.registerHybridMethod("clearPolygons", &HybridNitroMapSpec::clearPolygons);
|
|
126
|
+
prototype.registerHybridMethod("addCircle", &HybridNitroMapSpec::addCircle);
|
|
127
|
+
prototype.registerHybridMethod("updateCircle", &HybridNitroMapSpec::updateCircle);
|
|
128
|
+
prototype.registerHybridMethod("removeCircle", &HybridNitroMapSpec::removeCircle);
|
|
129
|
+
prototype.registerHybridMethod("clearCircles", &HybridNitroMapSpec::clearCircles);
|
|
79
130
|
});
|
|
80
131
|
}
|
|
81
132
|
|
|
@@ -23,6 +23,12 @@ namespace margelo::nitro::nitromap { enum class MapType; }
|
|
|
23
23
|
namespace margelo::nitro::nitromap { struct MapStyleElement; }
|
|
24
24
|
// Forward declaration of `ClusterConfig` to properly resolve imports.
|
|
25
25
|
namespace margelo::nitro::nitromap { struct ClusterConfig; }
|
|
26
|
+
// Forward declaration of `EdgePadding` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::nitromap { struct EdgePadding; }
|
|
28
|
+
// Forward declaration of `UserTrackingMode` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::nitromap { enum class UserTrackingMode; }
|
|
30
|
+
// Forward declaration of `Point` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::nitromap { struct Point; }
|
|
26
32
|
// Forward declaration of `MapPressEvent` to properly resolve imports.
|
|
27
33
|
namespace margelo::nitro::nitromap { struct MapPressEvent; }
|
|
28
34
|
// Forward declaration of `RegionChangeEvent` to properly resolve imports.
|
|
@@ -35,16 +41,22 @@ namespace margelo::nitro::nitromap { struct MarkerDragEvent; }
|
|
|
35
41
|
namespace margelo::nitro::nitromap { struct ClusterPressEvent; }
|
|
36
42
|
// Forward declaration of `MapError` to properly resolve imports.
|
|
37
43
|
namespace margelo::nitro::nitromap { struct MapError; }
|
|
44
|
+
// Forward declaration of `UserLocationChangeEvent` to properly resolve imports.
|
|
45
|
+
namespace margelo::nitro::nitromap { struct UserLocationChangeEvent; }
|
|
38
46
|
// Forward declaration of `Coordinate` to properly resolve imports.
|
|
39
47
|
namespace margelo::nitro::nitromap { struct Coordinate; }
|
|
40
|
-
// Forward declaration of `EdgePadding` to properly resolve imports.
|
|
41
|
-
namespace margelo::nitro::nitromap { struct EdgePadding; }
|
|
42
48
|
// Forward declaration of `Camera` to properly resolve imports.
|
|
43
49
|
namespace margelo::nitro::nitromap { struct Camera; }
|
|
44
50
|
// Forward declaration of `MapBoundaries` to properly resolve imports.
|
|
45
51
|
namespace margelo::nitro::nitromap { struct MapBoundaries; }
|
|
46
52
|
// Forward declaration of `MarkerData` to properly resolve imports.
|
|
47
53
|
namespace margelo::nitro::nitromap { struct MarkerData; }
|
|
54
|
+
// Forward declaration of `PolylineData` to properly resolve imports.
|
|
55
|
+
namespace margelo::nitro::nitromap { struct PolylineData; }
|
|
56
|
+
// Forward declaration of `PolygonData` to properly resolve imports.
|
|
57
|
+
namespace margelo::nitro::nitromap { struct PolygonData; }
|
|
58
|
+
// Forward declaration of `CircleData` to properly resolve imports.
|
|
59
|
+
namespace margelo::nitro::nitromap { struct CircleData; }
|
|
48
60
|
|
|
49
61
|
#include "MapProvider.hpp"
|
|
50
62
|
#include <optional>
|
|
@@ -53,6 +65,10 @@ namespace margelo::nitro::nitromap { struct MarkerData; }
|
|
|
53
65
|
#include "MapStyleElement.hpp"
|
|
54
66
|
#include <vector>
|
|
55
67
|
#include "ClusterConfig.hpp"
|
|
68
|
+
#include "EdgePadding.hpp"
|
|
69
|
+
#include "UserTrackingMode.hpp"
|
|
70
|
+
#include <string>
|
|
71
|
+
#include "Point.hpp"
|
|
56
72
|
#include "MapPressEvent.hpp"
|
|
57
73
|
#include <functional>
|
|
58
74
|
#include "RegionChangeEvent.hpp"
|
|
@@ -60,13 +76,15 @@ namespace margelo::nitro::nitromap { struct MarkerData; }
|
|
|
60
76
|
#include "MarkerDragEvent.hpp"
|
|
61
77
|
#include "ClusterPressEvent.hpp"
|
|
62
78
|
#include "MapError.hpp"
|
|
79
|
+
#include "UserLocationChangeEvent.hpp"
|
|
63
80
|
#include "Coordinate.hpp"
|
|
64
|
-
#include "EdgePadding.hpp"
|
|
65
81
|
#include "Camera.hpp"
|
|
66
82
|
#include <NitroModules/Promise.hpp>
|
|
67
83
|
#include "MapBoundaries.hpp"
|
|
68
84
|
#include "MarkerData.hpp"
|
|
69
|
-
#include
|
|
85
|
+
#include "PolylineData.hpp"
|
|
86
|
+
#include "PolygonData.hpp"
|
|
87
|
+
#include "CircleData.hpp"
|
|
70
88
|
|
|
71
89
|
namespace margelo::nitro::nitromap {
|
|
72
90
|
|
|
@@ -99,6 +117,8 @@ namespace margelo::nitro::nitromap {
|
|
|
99
117
|
virtual void setProvider(std::optional<MapProvider> provider) = 0;
|
|
100
118
|
virtual std::optional<Region> getInitialRegion() = 0;
|
|
101
119
|
virtual void setInitialRegion(const std::optional<Region>& initialRegion) = 0;
|
|
120
|
+
virtual std::optional<Region> getRegion() = 0;
|
|
121
|
+
virtual void setRegion(const std::optional<Region>& region) = 0;
|
|
102
122
|
virtual std::optional<bool> getShowsUserLocation() = 0;
|
|
103
123
|
virtual void setShowsUserLocation(std::optional<bool> showsUserLocation) = 0;
|
|
104
124
|
virtual std::optional<bool> getZoomEnabled() = 0;
|
|
@@ -113,12 +133,30 @@ namespace margelo::nitro::nitromap {
|
|
|
113
133
|
virtual void setMapType(std::optional<MapType> mapType) = 0;
|
|
114
134
|
virtual std::optional<std::vector<MapStyleElement>> getCustomMapStyle() = 0;
|
|
115
135
|
virtual void setCustomMapStyle(const std::optional<std::vector<MapStyleElement>>& customMapStyle) = 0;
|
|
116
|
-
virtual std::optional<bool> getShowsMyLocationButton() = 0;
|
|
117
|
-
virtual void setShowsMyLocationButton(std::optional<bool> showsMyLocationButton) = 0;
|
|
118
136
|
virtual std::optional<ClusterConfig> getClusterConfig() = 0;
|
|
119
137
|
virtual void setClusterConfig(const std::optional<ClusterConfig>& clusterConfig) = 0;
|
|
138
|
+
virtual EdgePadding getMapPadding() = 0;
|
|
139
|
+
virtual void setMapPadding(const EdgePadding& mapPadding) = 0;
|
|
140
|
+
virtual std::optional<bool> getShowsTraffic() = 0;
|
|
141
|
+
virtual void setShowsTraffic(std::optional<bool> showsTraffic) = 0;
|
|
142
|
+
virtual std::optional<bool> getShowsBuildings() = 0;
|
|
143
|
+
virtual void setShowsBuildings(std::optional<bool> showsBuildings) = 0;
|
|
144
|
+
virtual std::optional<bool> getShowsCompass() = 0;
|
|
145
|
+
virtual void setShowsCompass(std::optional<bool> showsCompass) = 0;
|
|
146
|
+
virtual double getMinZoom() = 0;
|
|
147
|
+
virtual void setMinZoom(double minZoom) = 0;
|
|
148
|
+
virtual double getMaxZoom() = 0;
|
|
149
|
+
virtual void setMaxZoom(double maxZoom) = 0;
|
|
120
150
|
virtual std::optional<bool> getDarkMode() = 0;
|
|
121
151
|
virtual void setDarkMode(std::optional<bool> darkMode) = 0;
|
|
152
|
+
virtual std::optional<UserTrackingMode> getUserTrackingMode() = 0;
|
|
153
|
+
virtual void setUserTrackingMode(std::optional<UserTrackingMode> userTrackingMode) = 0;
|
|
154
|
+
virtual std::string getUserLocationImage() = 0;
|
|
155
|
+
virtual void setUserLocationImage(const std::string& userLocationImage) = 0;
|
|
156
|
+
virtual double getUserLocationSize() = 0;
|
|
157
|
+
virtual void setUserLocationSize(double userLocationSize) = 0;
|
|
158
|
+
virtual std::optional<Point> getUserLocationAnchor() = 0;
|
|
159
|
+
virtual void setUserLocationAnchor(const std::optional<Point>& userLocationAnchor) = 0;
|
|
122
160
|
virtual std::optional<std::function<void(const MapPressEvent& /* event */)>> getOnPress() = 0;
|
|
123
161
|
virtual void setOnPress(const std::optional<std::function<void(const MapPressEvent& /* event */)>>& onPress) = 0;
|
|
124
162
|
virtual std::optional<std::function<void(const MapPressEvent& /* event */)>> getOnLongPress() = 0;
|
|
@@ -139,27 +177,58 @@ namespace margelo::nitro::nitromap {
|
|
|
139
177
|
virtual void setOnMarkerDragEnd(const std::optional<std::function<void(const MarkerDragEvent& /* event */)>>& onMarkerDragEnd) = 0;
|
|
140
178
|
virtual std::optional<std::function<void(const ClusterPressEvent& /* event */)>> getOnClusterPress() = 0;
|
|
141
179
|
virtual void setOnClusterPress(const std::optional<std::function<void(const ClusterPressEvent& /* event */)>>& onClusterPress) = 0;
|
|
180
|
+
virtual std::optional<std::function<void(const std::string& /* id */)>> getOnPolylinePress() = 0;
|
|
181
|
+
virtual void setOnPolylinePress(const std::optional<std::function<void(const std::string& /* id */)>>& onPolylinePress) = 0;
|
|
182
|
+
virtual std::optional<std::function<void(const std::string& /* id */)>> getOnPolygonPress() = 0;
|
|
183
|
+
virtual void setOnPolygonPress(const std::optional<std::function<void(const std::string& /* id */)>>& onPolygonPress) = 0;
|
|
184
|
+
virtual std::optional<std::function<void(const std::string& /* id */)>> getOnCirclePress() = 0;
|
|
185
|
+
virtual void setOnCirclePress(const std::optional<std::function<void(const std::string& /* id */)>>& onCirclePress) = 0;
|
|
142
186
|
virtual std::optional<std::function<void(const MapError& /* error */)>> getOnError() = 0;
|
|
143
187
|
virtual void setOnError(const std::optional<std::function<void(const MapError& /* error */)>>& onError) = 0;
|
|
188
|
+
virtual std::optional<std::function<void(const UserLocationChangeEvent& /* event */)>> getOnUserLocationChange() = 0;
|
|
189
|
+
virtual void setOnUserLocationChange(const std::optional<std::function<void(const UserLocationChangeEvent& /* event */)>>& onUserLocationChange) = 0;
|
|
190
|
+
virtual std::optional<std::function<void(UserTrackingMode /* mode */)>> getOnUserTrackingModeChange() = 0;
|
|
191
|
+
virtual void setOnUserTrackingModeChange(const std::optional<std::function<void(UserTrackingMode /* mode */)>>& onUserTrackingModeChange) = 0;
|
|
192
|
+
virtual std::optional<std::function<void(const MapError& /* error */)>> getOnUserLocationError() = 0;
|
|
193
|
+
virtual void setOnUserLocationError(const std::optional<std::function<void(const MapError& /* error */)>>& onUserLocationError) = 0;
|
|
194
|
+
virtual std::optional<std::function<void()>> getOnMapIdle() = 0;
|
|
195
|
+
virtual void setOnMapIdle(const std::optional<std::function<void()>>& onMapIdle) = 0;
|
|
144
196
|
|
|
145
197
|
public:
|
|
146
198
|
// Methods
|
|
147
199
|
virtual void animateToRegion(const Region& region, std::optional<double> duration) = 0;
|
|
148
200
|
virtual void fitToCoordinates(const std::vector<Coordinate>& coordinates, const std::optional<EdgePadding>& edgePadding, std::optional<bool> animated) = 0;
|
|
201
|
+
virtual void fitToSuppliedMarkers(const std::vector<std::string>& markerIds, const std::optional<EdgePadding>& edgePadding, std::optional<bool> animated) = 0;
|
|
149
202
|
virtual void animateCamera(const Camera& camera, std::optional<double> duration) = 0;
|
|
150
203
|
virtual std::shared_ptr<Promise<Camera>> getCamera() = 0;
|
|
151
204
|
virtual void setCamera(const Camera& camera) = 0;
|
|
152
205
|
virtual void setMapStyle(const std::optional<std::vector<MapStyleElement>>& style) = 0;
|
|
153
206
|
virtual std::shared_ptr<Promise<MapBoundaries>> getMapBoundaries() = 0;
|
|
207
|
+
virtual void centerOnUserLocation() = 0;
|
|
208
|
+
virtual Point pointForCoordinate(const Coordinate& coordinate) = 0;
|
|
209
|
+
virtual Coordinate coordinateForPoint(const Point& point) = 0;
|
|
154
210
|
virtual void setIsDarkMode(bool enabled) = 0;
|
|
155
211
|
virtual void addMarker(const MarkerData& marker) = 0;
|
|
156
212
|
virtual void addMarkers(const std::vector<MarkerData>& markers) = 0;
|
|
157
213
|
virtual void updateMarker(const MarkerData& marker) = 0;
|
|
158
214
|
virtual void removeMarker(const std::string& id) = 0;
|
|
159
215
|
virtual void selectMarker(const std::string& id) = 0;
|
|
216
|
+
virtual void deselectMarker() = 0;
|
|
160
217
|
virtual void clearMarkers() = 0;
|
|
161
218
|
virtual void setClusteringEnabled(bool enabled) = 0;
|
|
162
219
|
virtual void refreshClusters() = 0;
|
|
220
|
+
virtual void addPolyline(const PolylineData& polyline) = 0;
|
|
221
|
+
virtual void updatePolyline(const PolylineData& polyline) = 0;
|
|
222
|
+
virtual void removePolyline(const std::string& id) = 0;
|
|
223
|
+
virtual void clearPolylines() = 0;
|
|
224
|
+
virtual void addPolygon(const PolygonData& polygon) = 0;
|
|
225
|
+
virtual void updatePolygon(const PolygonData& polygon) = 0;
|
|
226
|
+
virtual void removePolygon(const std::string& id) = 0;
|
|
227
|
+
virtual void clearPolygons() = 0;
|
|
228
|
+
virtual void addCircle(const CircleData& circle) = 0;
|
|
229
|
+
virtual void updateCircle(const CircleData& circle) = 0;
|
|
230
|
+
virtual void removeCircle(const std::string& id) = 0;
|
|
231
|
+
virtual void clearCircles() = 0;
|
|
163
232
|
|
|
164
233
|
protected:
|
|
165
234
|
// Hybrid Setup
|
|
@@ -30,8 +30,7 @@ namespace margelo::nitro::nitromap {
|
|
|
30
30
|
*/
|
|
31
31
|
enum class MarkerAnimation {
|
|
32
32
|
NONE SWIFT_NAME(none) = 0,
|
|
33
|
-
|
|
34
|
-
FADEIN SWIFT_NAME(fadein) = 2,
|
|
33
|
+
APPEAR SWIFT_NAME(appear) = 1,
|
|
35
34
|
} CLOSED_ENUM;
|
|
36
35
|
|
|
37
36
|
} // namespace margelo::nitro::nitromap
|
|
@@ -45,8 +44,7 @@ namespace margelo::nitro {
|
|
|
45
44
|
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
46
45
|
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
47
46
|
case hashString("none"): return margelo::nitro::nitromap::MarkerAnimation::NONE;
|
|
48
|
-
case hashString("
|
|
49
|
-
case hashString("fadeIn"): return margelo::nitro::nitromap::MarkerAnimation::FADEIN;
|
|
47
|
+
case hashString("appear"): return margelo::nitro::nitromap::MarkerAnimation::APPEAR;
|
|
50
48
|
default: [[unlikely]]
|
|
51
49
|
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum MarkerAnimation - invalid value!");
|
|
52
50
|
}
|
|
@@ -54,8 +52,7 @@ namespace margelo::nitro {
|
|
|
54
52
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitromap::MarkerAnimation arg) {
|
|
55
53
|
switch (arg) {
|
|
56
54
|
case margelo::nitro::nitromap::MarkerAnimation::NONE: return JSIConverter<std::string>::toJSI(runtime, "none");
|
|
57
|
-
case margelo::nitro::nitromap::MarkerAnimation::
|
|
58
|
-
case margelo::nitro::nitromap::MarkerAnimation::FADEIN: return JSIConverter<std::string>::toJSI(runtime, "fadeIn");
|
|
55
|
+
case margelo::nitro::nitromap::MarkerAnimation::APPEAR: return JSIConverter<std::string>::toJSI(runtime, "appear");
|
|
59
56
|
default: [[unlikely]]
|
|
60
57
|
throw std::invalid_argument("Cannot convert MarkerAnimation to JS - invalid value: "
|
|
61
58
|
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
@@ -68,8 +65,7 @@ namespace margelo::nitro {
|
|
|
68
65
|
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
69
66
|
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
70
67
|
case hashString("none"):
|
|
71
|
-
case hashString("
|
|
72
|
-
case hashString("fadeIn"):
|
|
68
|
+
case hashString("appear"):
|
|
73
69
|
return true;
|
|
74
70
|
default:
|
|
75
71
|
return false;
|
|
@@ -56,12 +56,15 @@ namespace margelo::nitro::nitromap {
|
|
|
56
56
|
double zIndex SWIFT_PRIVATE;
|
|
57
57
|
Point anchor SWIFT_PRIVATE;
|
|
58
58
|
MarkerConfig config SWIFT_PRIVATE;
|
|
59
|
+
std::optional<std::string> accessibilityLabel SWIFT_PRIVATE;
|
|
59
60
|
bool clusteringEnabled SWIFT_PRIVATE;
|
|
60
61
|
MarkerAnimation animation SWIFT_PRIVATE;
|
|
62
|
+
double animationDuration SWIFT_PRIVATE;
|
|
63
|
+
bool animateOnReappear SWIFT_PRIVATE;
|
|
61
64
|
|
|
62
65
|
public:
|
|
63
66
|
MarkerData() = default;
|
|
64
|
-
explicit MarkerData(std::string id, Coordinate coordinate, std::optional<std::string> title, std::optional<std::string> description, bool draggable, double opacity, double rotation, double zIndex, Point anchor, MarkerConfig config, bool clusteringEnabled, MarkerAnimation animation): id(id), coordinate(coordinate), title(title), description(description), draggable(draggable), opacity(opacity), rotation(rotation), zIndex(zIndex), anchor(anchor), config(config), clusteringEnabled(clusteringEnabled), animation(animation) {}
|
|
67
|
+
explicit MarkerData(std::string id, Coordinate coordinate, std::optional<std::string> title, std::optional<std::string> description, bool draggable, double opacity, double rotation, double zIndex, Point anchor, MarkerConfig config, std::optional<std::string> accessibilityLabel, bool clusteringEnabled, MarkerAnimation animation, double animationDuration, bool animateOnReappear): id(id), coordinate(coordinate), title(title), description(description), draggable(draggable), opacity(opacity), rotation(rotation), zIndex(zIndex), anchor(anchor), config(config), accessibilityLabel(accessibilityLabel), clusteringEnabled(clusteringEnabled), animation(animation), animationDuration(animationDuration), animateOnReappear(animateOnReappear) {}
|
|
65
68
|
};
|
|
66
69
|
|
|
67
70
|
} // namespace margelo::nitro::nitromap
|
|
@@ -84,8 +87,11 @@ namespace margelo::nitro {
|
|
|
84
87
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
85
88
|
JSIConverter<margelo::nitro::nitromap::Point>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
|
|
86
89
|
JSIConverter<margelo::nitro::nitromap::MarkerConfig>::fromJSI(runtime, obj.getProperty(runtime, "config")),
|
|
90
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "accessibilityLabel")),
|
|
87
91
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "clusteringEnabled")),
|
|
88
|
-
JSIConverter<margelo::nitro::nitromap::MarkerAnimation>::fromJSI(runtime, obj.getProperty(runtime, "animation"))
|
|
92
|
+
JSIConverter<margelo::nitro::nitromap::MarkerAnimation>::fromJSI(runtime, obj.getProperty(runtime, "animation")),
|
|
93
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "animationDuration")),
|
|
94
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "animateOnReappear"))
|
|
89
95
|
);
|
|
90
96
|
}
|
|
91
97
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::MarkerData& arg) {
|
|
@@ -100,8 +106,11 @@ namespace margelo::nitro {
|
|
|
100
106
|
obj.setProperty(runtime, "zIndex", JSIConverter<double>::toJSI(runtime, arg.zIndex));
|
|
101
107
|
obj.setProperty(runtime, "anchor", JSIConverter<margelo::nitro::nitromap::Point>::toJSI(runtime, arg.anchor));
|
|
102
108
|
obj.setProperty(runtime, "config", JSIConverter<margelo::nitro::nitromap::MarkerConfig>::toJSI(runtime, arg.config));
|
|
109
|
+
obj.setProperty(runtime, "accessibilityLabel", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accessibilityLabel));
|
|
103
110
|
obj.setProperty(runtime, "clusteringEnabled", JSIConverter<bool>::toJSI(runtime, arg.clusteringEnabled));
|
|
104
111
|
obj.setProperty(runtime, "animation", JSIConverter<margelo::nitro::nitromap::MarkerAnimation>::toJSI(runtime, arg.animation));
|
|
112
|
+
obj.setProperty(runtime, "animationDuration", JSIConverter<double>::toJSI(runtime, arg.animationDuration));
|
|
113
|
+
obj.setProperty(runtime, "animateOnReappear", JSIConverter<bool>::toJSI(runtime, arg.animateOnReappear));
|
|
105
114
|
return obj;
|
|
106
115
|
}
|
|
107
116
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -122,8 +131,11 @@ namespace margelo::nitro {
|
|
|
122
131
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
123
132
|
if (!JSIConverter<margelo::nitro::nitromap::Point>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
|
|
124
133
|
if (!JSIConverter<margelo::nitro::nitromap::MarkerConfig>::canConvert(runtime, obj.getProperty(runtime, "config"))) return false;
|
|
134
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "accessibilityLabel"))) return false;
|
|
125
135
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "clusteringEnabled"))) return false;
|
|
126
136
|
if (!JSIConverter<margelo::nitro::nitromap::MarkerAnimation>::canConvert(runtime, obj.getProperty(runtime, "animation"))) return false;
|
|
137
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "animationDuration"))) return false;
|
|
138
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "animateOnReappear"))) return false;
|
|
127
139
|
return true;
|
|
128
140
|
}
|
|
129
141
|
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PolygonData.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
|
+
#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
|
+
// Forward declaration of `Coordinate` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::nitromap { struct Coordinate; }
|
|
28
|
+
// Forward declaration of `MarkerColor` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::nitromap { struct MarkerColor; }
|
|
30
|
+
|
|
31
|
+
#include <string>
|
|
32
|
+
#include "Coordinate.hpp"
|
|
33
|
+
#include <vector>
|
|
34
|
+
#include "MarkerColor.hpp"
|
|
35
|
+
#include <optional>
|
|
36
|
+
|
|
37
|
+
namespace margelo::nitro::nitromap {
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A struct which can be represented as a JavaScript object (PolygonData).
|
|
41
|
+
*/
|
|
42
|
+
struct PolygonData {
|
|
43
|
+
public:
|
|
44
|
+
std::string id SWIFT_PRIVATE;
|
|
45
|
+
std::vector<Coordinate> coordinates SWIFT_PRIVATE;
|
|
46
|
+
std::vector<std::vector<Coordinate>> holes SWIFT_PRIVATE;
|
|
47
|
+
MarkerColor fillColor SWIFT_PRIVATE;
|
|
48
|
+
MarkerColor strokeColor SWIFT_PRIVATE;
|
|
49
|
+
double strokeWidth SWIFT_PRIVATE;
|
|
50
|
+
double zIndex SWIFT_PRIVATE;
|
|
51
|
+
bool tappable SWIFT_PRIVATE;
|
|
52
|
+
std::optional<std::string> accessibilityLabel SWIFT_PRIVATE;
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
PolygonData() = default;
|
|
56
|
+
explicit PolygonData(std::string id, std::vector<Coordinate> coordinates, std::vector<std::vector<Coordinate>> holes, MarkerColor fillColor, MarkerColor strokeColor, double strokeWidth, double zIndex, bool tappable, std::optional<std::string> accessibilityLabel): id(id), coordinates(coordinates), holes(holes), fillColor(fillColor), strokeColor(strokeColor), strokeWidth(strokeWidth), zIndex(zIndex), tappable(tappable), accessibilityLabel(accessibilityLabel) {}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
} // namespace margelo::nitro::nitromap
|
|
60
|
+
|
|
61
|
+
namespace margelo::nitro {
|
|
62
|
+
|
|
63
|
+
// C++ PolygonData <> JS PolygonData (object)
|
|
64
|
+
template <>
|
|
65
|
+
struct JSIConverter<margelo::nitro::nitromap::PolygonData> final {
|
|
66
|
+
static inline margelo::nitro::nitromap::PolygonData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
67
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
68
|
+
return margelo::nitro::nitromap::PolygonData(
|
|
69
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
70
|
+
JSIConverter<std::vector<margelo::nitro::nitromap::Coordinate>>::fromJSI(runtime, obj.getProperty(runtime, "coordinates")),
|
|
71
|
+
JSIConverter<std::vector<std::vector<margelo::nitro::nitromap::Coordinate>>>::fromJSI(runtime, obj.getProperty(runtime, "holes")),
|
|
72
|
+
JSIConverter<margelo::nitro::nitromap::MarkerColor>::fromJSI(runtime, obj.getProperty(runtime, "fillColor")),
|
|
73
|
+
JSIConverter<margelo::nitro::nitromap::MarkerColor>::fromJSI(runtime, obj.getProperty(runtime, "strokeColor")),
|
|
74
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "strokeWidth")),
|
|
75
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
76
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "tappable")),
|
|
77
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "accessibilityLabel"))
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::PolygonData& arg) {
|
|
81
|
+
jsi::Object obj(runtime);
|
|
82
|
+
obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
83
|
+
obj.setProperty(runtime, "coordinates", JSIConverter<std::vector<margelo::nitro::nitromap::Coordinate>>::toJSI(runtime, arg.coordinates));
|
|
84
|
+
obj.setProperty(runtime, "holes", JSIConverter<std::vector<std::vector<margelo::nitro::nitromap::Coordinate>>>::toJSI(runtime, arg.holes));
|
|
85
|
+
obj.setProperty(runtime, "fillColor", JSIConverter<margelo::nitro::nitromap::MarkerColor>::toJSI(runtime, arg.fillColor));
|
|
86
|
+
obj.setProperty(runtime, "strokeColor", JSIConverter<margelo::nitro::nitromap::MarkerColor>::toJSI(runtime, arg.strokeColor));
|
|
87
|
+
obj.setProperty(runtime, "strokeWidth", JSIConverter<double>::toJSI(runtime, arg.strokeWidth));
|
|
88
|
+
obj.setProperty(runtime, "zIndex", JSIConverter<double>::toJSI(runtime, arg.zIndex));
|
|
89
|
+
obj.setProperty(runtime, "tappable", JSIConverter<bool>::toJSI(runtime, arg.tappable));
|
|
90
|
+
obj.setProperty(runtime, "accessibilityLabel", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accessibilityLabel));
|
|
91
|
+
return obj;
|
|
92
|
+
}
|
|
93
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
94
|
+
if (!value.isObject()) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
jsi::Object obj = value.getObject(runtime);
|
|
98
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
102
|
+
if (!JSIConverter<std::vector<margelo::nitro::nitromap::Coordinate>>::canConvert(runtime, obj.getProperty(runtime, "coordinates"))) return false;
|
|
103
|
+
if (!JSIConverter<std::vector<std::vector<margelo::nitro::nitromap::Coordinate>>>::canConvert(runtime, obj.getProperty(runtime, "holes"))) return false;
|
|
104
|
+
if (!JSIConverter<margelo::nitro::nitromap::MarkerColor>::canConvert(runtime, obj.getProperty(runtime, "fillColor"))) return false;
|
|
105
|
+
if (!JSIConverter<margelo::nitro::nitromap::MarkerColor>::canConvert(runtime, obj.getProperty(runtime, "strokeColor"))) return false;
|
|
106
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "strokeWidth"))) return false;
|
|
107
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
108
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "tappable"))) return false;
|
|
109
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "accessibilityLabel"))) return false;
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
} // namespace margelo::nitro
|