@maydon_tech/react-native-nitro-maps 0.1.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 +20 -0
- package/NitroMap.podspec +42 -0
- package/README.md +172 -0
- package/android/CMakeLists.txt +27 -0
- package/android/build.gradle +141 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/ClusterIconGenerator.kt +108 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/ColorUtils.kt +63 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/HybridNitroMap.kt +408 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/HybridNitroMapConfig.kt +68 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/MarkerIconCache.kt +176 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/MarkerIconFactory.kt +252 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/NitroMapPackage.kt +33 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/clustering/NitroClusterEngine.kt +252 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/clustering/QuadTree.kt +195 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/providers/GoogleMapProvider.kt +912 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/providers/MapProviderInterface.kt +70 -0
- package/cpp/ClusterEngine.hpp +411 -0
- package/cpp/KDBush.hpp +238 -0
- package/cpp/QuadTree.hpp +246 -0
- package/ios/Clustering/ClusterEngineWrapper.h +58 -0
- package/ios/Clustering/ClusterEngineWrapper.mm +142 -0
- package/ios/Clustering/ClusterIconRenderer.swift +80 -0
- package/ios/Clustering/NitroClusterEngine.swift +117 -0
- package/ios/Clustering/NitroClusterIconGenerator.swift +35 -0
- package/ios/MarkerRenderer/MarkerIconFactory.swift +322 -0
- package/ios/MarkerRenderer/PriceMarkerRenderer.swift +140 -0
- package/ios/NitroMap.swift +332 -0
- package/ios/NitroMapConfig/HybridNitroMapConfig.swift +33 -0
- package/ios/Providers/GoogleMapDelegate.swift +310 -0
- package/ios/Providers/GoogleMapProvider+Camera.swift +164 -0
- package/ios/Providers/GoogleMapProvider.swift +924 -0
- package/ios/Providers/MapProviderProtocol.swift +78 -0
- package/ios/Shared/ClusterConfig+Factory.swift +58 -0
- package/ios/Shared/ClusteringManager.swift +211 -0
- package/ios/Shared/MapStyleProvider.swift +135 -0
- package/ios/Shared/MarkerSelectionHandler.swift +116 -0
- package/ios/Utils/ColorValueExtension.swift +54 -0
- package/lib/module/components/ImageMarker.js +146 -0
- package/lib/module/components/ImageMarker.js.map +1 -0
- package/lib/module/components/NitroMap.js +320 -0
- package/lib/module/components/NitroMap.js.map +1 -0
- package/lib/module/components/PriceMarker.js +165 -0
- package/lib/module/components/PriceMarker.js.map +1 -0
- package/lib/module/context/NitroMapContext.js +15 -0
- package/lib/module/context/NitroMapContext.js.map +1 -0
- package/lib/module/hooks/useNitroMarker.js +104 -0
- package/lib/module/hooks/useNitroMarker.js.map +1 -0
- package/lib/module/index.js +21 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/modules/index.js +4 -0
- package/lib/module/modules/index.js.map +1 -0
- package/lib/module/modules/module.js +30 -0
- package/lib/module/modules/module.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/specs/NitroMap.nitro.js +4 -0
- package/lib/module/specs/NitroMap.nitro.js.map +1 -0
- package/lib/module/specs/NitroMapConfig.nitro.js +4 -0
- package/lib/module/specs/NitroMapConfig.nitro.js.map +1 -0
- package/lib/module/types/map.js +2 -0
- package/lib/module/types/map.js.map +1 -0
- package/lib/module/types/marker.js +4 -0
- package/lib/module/types/marker.js.map +1 -0
- package/lib/module/utils/colors.js +147 -0
- package/lib/module/utils/colors.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/ImageMarker.d.ts +70 -0
- package/lib/typescript/src/components/ImageMarker.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroMap.d.ts +14 -0
- package/lib/typescript/src/components/NitroMap.d.ts.map +1 -0
- package/lib/typescript/src/components/PriceMarker.d.ts +88 -0
- package/lib/typescript/src/components/PriceMarker.d.ts.map +1 -0
- package/lib/typescript/src/context/NitroMapContext.d.ts +16 -0
- package/lib/typescript/src/context/NitroMapContext.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNitroMarker.d.ts +78 -0
- package/lib/typescript/src/hooks/useNitroMarker.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +12 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/modules/index.d.ts +2 -0
- package/lib/typescript/src/modules/index.d.ts.map +1 -0
- package/lib/typescript/src/modules/module.d.ts +22 -0
- package/lib/typescript/src/modules/module.d.ts.map +1 -0
- package/lib/typescript/src/specs/NitroMap.nitro.d.ts +227 -0
- package/lib/typescript/src/specs/NitroMap.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/NitroMapConfig.nitro.d.ts +10 -0
- package/lib/typescript/src/specs/NitroMapConfig.nitro.d.ts.map +1 -0
- package/lib/typescript/src/types/map.d.ts +154 -0
- package/lib/typescript/src/types/map.d.ts.map +1 -0
- package/lib/typescript/src/types/marker.d.ts +248 -0
- package/lib/typescript/src/types/marker.d.ts.map +1 -0
- package/lib/typescript/src/utils/colors.d.ts +82 -0
- package/lib/typescript/src/utils/colors.d.ts.map +1 -0
- package/nitro.json +21 -0
- package/nitrogen/generated/android/c++/JCamera.hpp +74 -0
- package/nitrogen/generated/android/c++/JClusterAnimationStyle.hpp +68 -0
- package/nitrogen/generated/android/c++/JClusterConfig.hpp +121 -0
- package/nitrogen/generated/android/c++/JClusterPressEvent.hpp +86 -0
- package/nitrogen/generated/android/c++/JClusterStrategy.hpp +59 -0
- package/nitrogen/generated/android/c++/JColorValue.cpp +26 -0
- package/nitrogen/generated/android/c++/JColorValue.hpp +70 -0
- package/nitrogen/generated/android/c++/JCoordinate.hpp +61 -0
- package/nitrogen/generated/android/c++/JEdgePadding.hpp +69 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_ClusterPressEvent.hpp +81 -0
- package/nitrogen/generated/android/c++/JFunc_void_MapError.hpp +78 -0
- package/nitrogen/generated/android/c++/JFunc_void_MapPressEvent.hpp +81 -0
- package/nitrogen/generated/android/c++/JFunc_void_MarkerDragEvent.hpp +80 -0
- package/nitrogen/generated/android/c++/JFunc_void_MarkerPressEvent.hpp +80 -0
- package/nitrogen/generated/android/c++/JFunc_void_RegionChangeEvent.hpp +79 -0
- package/nitrogen/generated/android/c++/JHybridNitroMapConfigSpec.cpp +59 -0
- package/nitrogen/generated/android/c++/JHybridNitroMapConfigSpec.hpp +66 -0
- package/nitrogen/generated/android/c++/JHybridNitroMapSpec.cpp +593 -0
- package/nitrogen/generated/android/c++/JHybridNitroMapSpec.hpp +125 -0
- package/nitrogen/generated/android/c++/JImageMarkerConfig.hpp +86 -0
- package/nitrogen/generated/android/c++/JMapBoundaries.hpp +62 -0
- package/nitrogen/generated/android/c++/JMapError.hpp +61 -0
- package/nitrogen/generated/android/c++/JMapPressEvent.hpp +64 -0
- package/nitrogen/generated/android/c++/JMapProvider.hpp +62 -0
- package/nitrogen/generated/android/c++/JMapStyleElement.hpp +87 -0
- package/nitrogen/generated/android/c++/JMapStyler.hpp +78 -0
- package/nitrogen/generated/android/c++/JMapType.hpp +62 -0
- package/nitrogen/generated/android/c++/JMarkerAnimation.hpp +62 -0
- package/nitrogen/generated/android/c++/JMarkerColor.hpp +69 -0
- package/nitrogen/generated/android/c++/JMarkerConfig.hpp +77 -0
- package/nitrogen/generated/android/c++/JMarkerData.hpp +121 -0
- package/nitrogen/generated/android/c++/JMarkerDragEvent.hpp +63 -0
- package/nitrogen/generated/android/c++/JMarkerPressEvent.hpp +63 -0
- package/nitrogen/generated/android/c++/JMarkerStyle.hpp +62 -0
- package/nitrogen/generated/android/c++/JPoint.hpp +61 -0
- package/nitrogen/generated/android/c++/JPriceMarkerStyle.hpp +102 -0
- package/nitrogen/generated/android/c++/JRegion.hpp +69 -0
- package/nitrogen/generated/android/c++/JRegionChangeEvent.hpp +62 -0
- package/nitrogen/generated/android/c++/JVariant_String_MarkerColor.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_String_MarkerColor.hpp +70 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroMapStateUpdater.cpp +144 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroMapStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Camera.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ClusterAnimationStyle.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ClusterConfig.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ClusterPressEvent.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ClusterStrategy.kt +21 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ColorValue.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Coordinate.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/EdgePadding.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_ClusterPressEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_MapError.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_MapPressEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_MarkerDragEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_MarkerPressEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_RegionChangeEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/HybridNitroMapConfigSpec.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/HybridNitroMapSpec.kt +342 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ImageMarkerConfig.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapBoundaries.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapError.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapPressEvent.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapProvider.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapStyleElement.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapStyler.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapType.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerAnimation.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerColor.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerConfig.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerData.kt +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerDragEvent.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerPressEvent.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerStyle.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Point.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/PriceMarkerStyle.kt +68 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Region.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/RegionChangeEvent.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Variant_String_MarkerColor.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/nitromapOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/views/HybridNitroMapManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/views/HybridNitroMapStateUpdater.kt +23 -0
- package/nitrogen/generated/android/nitromap+autolinking.cmake +87 -0
- package/nitrogen/generated/android/nitromap+autolinking.gradle +27 -0
- package/nitrogen/generated/android/nitromapOnLoad.cpp +70 -0
- package/nitrogen/generated/android/nitromapOnLoad.hpp +25 -0
- package/nitrogen/generated/ios/NitroMap+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Bridge.cpp +130 -0
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Bridge.hpp +793 -0
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Umbrella.hpp +132 -0
- package/nitrogen/generated/ios/NitroMapAutolinking.mm +41 -0
- package/nitrogen/generated/ios/NitroMapAutolinking.swift +40 -0
- package/nitrogen/generated/ios/c++/HybridNitroMapConfigSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroMapConfigSpecSwift.hpp +84 -0
- package/nitrogen/generated/ios/c++/HybridNitroMapSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroMapSpecSwift.hpp +410 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroMapComponent.mm +206 -0
- package/nitrogen/generated/ios/swift/Camera.swift +80 -0
- package/nitrogen/generated/ios/swift/ClusterAnimationStyle.swift +52 -0
- package/nitrogen/generated/ios/swift/ClusterConfig.swift +268 -0
- package/nitrogen/generated/ios/swift/ClusterPressEvent.swift +70 -0
- package/nitrogen/generated/ios/swift/ClusterStrategy.swift +40 -0
- package/nitrogen/generated/ios/swift/ColorValue.swift +18 -0
- package/nitrogen/generated/ios/swift/Coordinate.swift +47 -0
- package/nitrogen/generated/ios/swift/EdgePadding.swift +69 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_Camera.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_ClusterPressEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_MapBoundaries.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_MapError.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_MapPressEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_MarkerDragEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_MarkerPressEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_RegionChangeEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridNitroMapConfigSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridNitroMapConfigSpec_cxx.swift +142 -0
- package/nitrogen/generated/ios/swift/HybridNitroMapSpec.swift +93 -0
- package/nitrogen/generated/ios/swift/HybridNitroMapSpec_cxx.swift +953 -0
- package/nitrogen/generated/ios/swift/ImageMarkerConfig.swift +166 -0
- package/nitrogen/generated/ios/swift/MapBoundaries.swift +47 -0
- package/nitrogen/generated/ios/swift/MapError.swift +47 -0
- package/nitrogen/generated/ios/swift/MapPressEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/MapProvider.swift +44 -0
- package/nitrogen/generated/ios/swift/MapStyleElement.swift +108 -0
- package/nitrogen/generated/ios/swift/MapStyler.swift +177 -0
- package/nitrogen/generated/ios/swift/MapType.swift +44 -0
- package/nitrogen/generated/ios/swift/MarkerAnimation.swift +44 -0
- package/nitrogen/generated/ios/swift/MarkerColor.swift +69 -0
- package/nitrogen/generated/ios/swift/MarkerConfig.swift +82 -0
- package/nitrogen/generated/ios/swift/MarkerData.swift +195 -0
- package/nitrogen/generated/ios/swift/MarkerDragEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/MarkerPressEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/MarkerStyle.swift +44 -0
- package/nitrogen/generated/ios/swift/Point.swift +47 -0
- package/nitrogen/generated/ios/swift/PriceMarkerStyle.swift +374 -0
- package/nitrogen/generated/ios/swift/Region.swift +69 -0
- package/nitrogen/generated/ios/swift/RegionChangeEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Variant_String_MarkerColor.swift +18 -0
- package/nitrogen/generated/shared/c++/Camera.hpp +92 -0
- package/nitrogen/generated/shared/c++/ClusterAnimationStyle.hpp +88 -0
- package/nitrogen/generated/shared/c++/ClusterConfig.hpp +140 -0
- package/nitrogen/generated/shared/c++/ClusterPressEvent.hpp +86 -0
- package/nitrogen/generated/shared/c++/ClusterStrategy.hpp +76 -0
- package/nitrogen/generated/shared/c++/Coordinate.hpp +79 -0
- package/nitrogen/generated/shared/c++/EdgePadding.hpp +87 -0
- package/nitrogen/generated/shared/c++/HybridNitroMapConfigSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroMapConfigSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/HybridNitroMapSpec.cpp +82 -0
- package/nitrogen/generated/shared/c++/HybridNitroMapSpec.hpp +173 -0
- package/nitrogen/generated/shared/c++/ImageMarkerConfig.hpp +103 -0
- package/nitrogen/generated/shared/c++/MapBoundaries.hpp +80 -0
- package/nitrogen/generated/shared/c++/MapError.hpp +79 -0
- package/nitrogen/generated/shared/c++/MapPressEvent.hpp +83 -0
- package/nitrogen/generated/shared/c++/MapProvider.hpp +80 -0
- package/nitrogen/generated/shared/c++/MapStyleElement.hpp +87 -0
- package/nitrogen/generated/shared/c++/MapStyler.hpp +96 -0
- package/nitrogen/generated/shared/c++/MapType.hpp +80 -0
- package/nitrogen/generated/shared/c++/MarkerAnimation.hpp +80 -0
- package/nitrogen/generated/shared/c++/MarkerColor.hpp +87 -0
- package/nitrogen/generated/shared/c++/MarkerConfig.hpp +91 -0
- package/nitrogen/generated/shared/c++/MarkerData.hpp +131 -0
- package/nitrogen/generated/shared/c++/MarkerDragEvent.hpp +81 -0
- package/nitrogen/generated/shared/c++/MarkerPressEvent.hpp +81 -0
- package/nitrogen/generated/shared/c++/MarkerStyle.hpp +80 -0
- package/nitrogen/generated/shared/c++/Point.hpp +79 -0
- package/nitrogen/generated/shared/c++/PriceMarkerStyle.hpp +119 -0
- package/nitrogen/generated/shared/c++/Region.hpp +87 -0
- package/nitrogen/generated/shared/c++/RegionChangeEvent.hpp +80 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroMapComponent.cpp +351 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroMapComponent.hpp +141 -0
- package/nitrogen/generated/shared/json/NitroMapConfig.json +32 -0
- package/package.json +176 -0
- package/react-native.config.js +16 -0
- package/src/components/ImageMarker.tsx +254 -0
- package/src/components/NitroMap.tsx +433 -0
- package/src/components/PriceMarker.tsx +311 -0
- package/src/context/NitroMapContext.tsx +33 -0
- package/src/hooks/useNitroMarker.ts +198 -0
- package/src/index.tsx +62 -0
- package/src/modules/index.ts +6 -0
- package/src/modules/module.ts +45 -0
- package/src/specs/NitroMap.nitro.ts +292 -0
- package/src/specs/NitroMapConfig.nitro.ts +8 -0
- package/src/types/map.ts +166 -0
- package/src/types/marker.ts +267 -0
- package/src/utils/colors.ts +159 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroMapSpecSwift.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 "HybridNitroMapSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridNitroMapSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace NitroMap { class HybridNitroMapSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `MapProvider` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::nitromap { enum class MapProvider; }
|
|
17
|
+
// Forward declaration of `Region` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::nitromap { struct Region; }
|
|
19
|
+
// Forward declaration of `MapType` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::nitromap { enum class MapType; }
|
|
21
|
+
// Forward declaration of `MapStyleElement` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::nitromap { struct MapStyleElement; }
|
|
23
|
+
// Forward declaration of `MapStyler` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::nitromap { struct MapStyler; }
|
|
25
|
+
// Forward declaration of `ClusterConfig` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::nitromap { struct ClusterConfig; }
|
|
27
|
+
// Forward declaration of `ClusterStrategy` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::nitromap { enum class ClusterStrategy; }
|
|
29
|
+
// Forward declaration of `MarkerColor` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::nitromap { struct MarkerColor; }
|
|
31
|
+
// Forward declaration of `ClusterAnimationStyle` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::nitromap { enum class ClusterAnimationStyle; }
|
|
33
|
+
// Forward declaration of `MapPressEvent` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::nitromap { struct MapPressEvent; }
|
|
35
|
+
// Forward declaration of `Coordinate` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::nitromap { struct Coordinate; }
|
|
37
|
+
// Forward declaration of `Point` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::nitromap { struct Point; }
|
|
39
|
+
// Forward declaration of `RegionChangeEvent` to properly resolve imports.
|
|
40
|
+
namespace margelo::nitro::nitromap { struct RegionChangeEvent; }
|
|
41
|
+
// Forward declaration of `MarkerPressEvent` to properly resolve imports.
|
|
42
|
+
namespace margelo::nitro::nitromap { struct MarkerPressEvent; }
|
|
43
|
+
// Forward declaration of `MarkerDragEvent` to properly resolve imports.
|
|
44
|
+
namespace margelo::nitro::nitromap { struct MarkerDragEvent; }
|
|
45
|
+
// Forward declaration of `ClusterPressEvent` to properly resolve imports.
|
|
46
|
+
namespace margelo::nitro::nitromap { struct ClusterPressEvent; }
|
|
47
|
+
// Forward declaration of `MapError` to properly resolve imports.
|
|
48
|
+
namespace margelo::nitro::nitromap { struct MapError; }
|
|
49
|
+
// Forward declaration of `EdgePadding` to properly resolve imports.
|
|
50
|
+
namespace margelo::nitro::nitromap { struct EdgePadding; }
|
|
51
|
+
// Forward declaration of `Camera` to properly resolve imports.
|
|
52
|
+
namespace margelo::nitro::nitromap { struct Camera; }
|
|
53
|
+
// Forward declaration of `MapBoundaries` to properly resolve imports.
|
|
54
|
+
namespace margelo::nitro::nitromap { struct MapBoundaries; }
|
|
55
|
+
// Forward declaration of `MarkerData` to properly resolve imports.
|
|
56
|
+
namespace margelo::nitro::nitromap { struct MarkerData; }
|
|
57
|
+
// Forward declaration of `MarkerConfig` to properly resolve imports.
|
|
58
|
+
namespace margelo::nitro::nitromap { struct MarkerConfig; }
|
|
59
|
+
// Forward declaration of `MarkerStyle` to properly resolve imports.
|
|
60
|
+
namespace margelo::nitro::nitromap { enum class MarkerStyle; }
|
|
61
|
+
// Forward declaration of `ImageMarkerConfig` to properly resolve imports.
|
|
62
|
+
namespace margelo::nitro::nitromap { struct ImageMarkerConfig; }
|
|
63
|
+
// Forward declaration of `PriceMarkerStyle` to properly resolve imports.
|
|
64
|
+
namespace margelo::nitro::nitromap { struct PriceMarkerStyle; }
|
|
65
|
+
// Forward declaration of `MarkerAnimation` to properly resolve imports.
|
|
66
|
+
namespace margelo::nitro::nitromap { enum class MarkerAnimation; }
|
|
67
|
+
|
|
68
|
+
#include "MapProvider.hpp"
|
|
69
|
+
#include <optional>
|
|
70
|
+
#include "Region.hpp"
|
|
71
|
+
#include "MapType.hpp"
|
|
72
|
+
#include "MapStyleElement.hpp"
|
|
73
|
+
#include <vector>
|
|
74
|
+
#include <string>
|
|
75
|
+
#include "MapStyler.hpp"
|
|
76
|
+
#include "ClusterConfig.hpp"
|
|
77
|
+
#include "ClusterStrategy.hpp"
|
|
78
|
+
#include "MarkerColor.hpp"
|
|
79
|
+
#include <variant>
|
|
80
|
+
#include "ClusterAnimationStyle.hpp"
|
|
81
|
+
#include "MapPressEvent.hpp"
|
|
82
|
+
#include <functional>
|
|
83
|
+
#include "Coordinate.hpp"
|
|
84
|
+
#include "Point.hpp"
|
|
85
|
+
#include "RegionChangeEvent.hpp"
|
|
86
|
+
#include "MarkerPressEvent.hpp"
|
|
87
|
+
#include "MarkerDragEvent.hpp"
|
|
88
|
+
#include "ClusterPressEvent.hpp"
|
|
89
|
+
#include "MapError.hpp"
|
|
90
|
+
#include "EdgePadding.hpp"
|
|
91
|
+
#include "Camera.hpp"
|
|
92
|
+
#include <NitroModules/Promise.hpp>
|
|
93
|
+
#include "MapBoundaries.hpp"
|
|
94
|
+
#include "MarkerData.hpp"
|
|
95
|
+
#include "MarkerConfig.hpp"
|
|
96
|
+
#include "MarkerStyle.hpp"
|
|
97
|
+
#include "ImageMarkerConfig.hpp"
|
|
98
|
+
#include "PriceMarkerStyle.hpp"
|
|
99
|
+
#include "MarkerAnimation.hpp"
|
|
100
|
+
|
|
101
|
+
#include "NitroMap-Swift-Cxx-Umbrella.hpp"
|
|
102
|
+
|
|
103
|
+
namespace margelo::nitro::nitromap {
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The C++ part of HybridNitroMapSpec_cxx.swift.
|
|
107
|
+
*
|
|
108
|
+
* HybridNitroMapSpecSwift (C++) accesses HybridNitroMapSpec_cxx (Swift), and might
|
|
109
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
110
|
+
*
|
|
111
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
112
|
+
* the future, HybridNitroMapSpec_cxx can directly inherit from the C++ class HybridNitroMapSpec
|
|
113
|
+
* to simplify the whole structure and memory management.
|
|
114
|
+
*/
|
|
115
|
+
class HybridNitroMapSpecSwift: public virtual HybridNitroMapSpec {
|
|
116
|
+
public:
|
|
117
|
+
// Constructor from a Swift instance
|
|
118
|
+
explicit HybridNitroMapSpecSwift(const NitroMap::HybridNitroMapSpec_cxx& swiftPart):
|
|
119
|
+
HybridObject(HybridNitroMapSpec::TAG),
|
|
120
|
+
_swiftPart(swiftPart) { }
|
|
121
|
+
|
|
122
|
+
public:
|
|
123
|
+
// Get the Swift part
|
|
124
|
+
inline NitroMap::HybridNitroMapSpec_cxx& getSwiftPart() noexcept {
|
|
125
|
+
return _swiftPart;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
public:
|
|
129
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
130
|
+
return _swiftPart.getMemorySize();
|
|
131
|
+
}
|
|
132
|
+
void dispose() noexcept override {
|
|
133
|
+
_swiftPart.dispose();
|
|
134
|
+
}
|
|
135
|
+
std::string toString() override {
|
|
136
|
+
return _swiftPart.toString();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
public:
|
|
140
|
+
// Properties
|
|
141
|
+
inline std::optional<MapProvider> getProvider() noexcept override {
|
|
142
|
+
auto __result = _swiftPart.getProvider();
|
|
143
|
+
return __result;
|
|
144
|
+
}
|
|
145
|
+
inline void setProvider(std::optional<MapProvider> provider) noexcept override {
|
|
146
|
+
_swiftPart.setProvider(provider);
|
|
147
|
+
}
|
|
148
|
+
inline std::optional<Region> getInitialRegion() noexcept override {
|
|
149
|
+
auto __result = _swiftPart.getInitialRegion();
|
|
150
|
+
return __result;
|
|
151
|
+
}
|
|
152
|
+
inline void setInitialRegion(const std::optional<Region>& initialRegion) noexcept override {
|
|
153
|
+
_swiftPart.setInitialRegion(initialRegion);
|
|
154
|
+
}
|
|
155
|
+
inline std::optional<bool> getShowsUserLocation() noexcept override {
|
|
156
|
+
auto __result = _swiftPart.getShowsUserLocation();
|
|
157
|
+
return __result;
|
|
158
|
+
}
|
|
159
|
+
inline void setShowsUserLocation(std::optional<bool> showsUserLocation) noexcept override {
|
|
160
|
+
_swiftPart.setShowsUserLocation(showsUserLocation);
|
|
161
|
+
}
|
|
162
|
+
inline std::optional<bool> getZoomEnabled() noexcept override {
|
|
163
|
+
auto __result = _swiftPart.getZoomEnabled();
|
|
164
|
+
return __result;
|
|
165
|
+
}
|
|
166
|
+
inline void setZoomEnabled(std::optional<bool> zoomEnabled) noexcept override {
|
|
167
|
+
_swiftPart.setZoomEnabled(zoomEnabled);
|
|
168
|
+
}
|
|
169
|
+
inline std::optional<bool> getScrollEnabled() noexcept override {
|
|
170
|
+
auto __result = _swiftPart.getScrollEnabled();
|
|
171
|
+
return __result;
|
|
172
|
+
}
|
|
173
|
+
inline void setScrollEnabled(std::optional<bool> scrollEnabled) noexcept override {
|
|
174
|
+
_swiftPart.setScrollEnabled(scrollEnabled);
|
|
175
|
+
}
|
|
176
|
+
inline std::optional<bool> getRotateEnabled() noexcept override {
|
|
177
|
+
auto __result = _swiftPart.getRotateEnabled();
|
|
178
|
+
return __result;
|
|
179
|
+
}
|
|
180
|
+
inline void setRotateEnabled(std::optional<bool> rotateEnabled) noexcept override {
|
|
181
|
+
_swiftPart.setRotateEnabled(rotateEnabled);
|
|
182
|
+
}
|
|
183
|
+
inline std::optional<bool> getPitchEnabled() noexcept override {
|
|
184
|
+
auto __result = _swiftPart.getPitchEnabled();
|
|
185
|
+
return __result;
|
|
186
|
+
}
|
|
187
|
+
inline void setPitchEnabled(std::optional<bool> pitchEnabled) noexcept override {
|
|
188
|
+
_swiftPart.setPitchEnabled(pitchEnabled);
|
|
189
|
+
}
|
|
190
|
+
inline std::optional<MapType> getMapType() noexcept override {
|
|
191
|
+
auto __result = _swiftPart.getMapType();
|
|
192
|
+
return __result;
|
|
193
|
+
}
|
|
194
|
+
inline void setMapType(std::optional<MapType> mapType) noexcept override {
|
|
195
|
+
_swiftPart.setMapType(mapType);
|
|
196
|
+
}
|
|
197
|
+
inline std::optional<std::vector<MapStyleElement>> getCustomMapStyle() noexcept override {
|
|
198
|
+
auto __result = _swiftPart.getCustomMapStyle();
|
|
199
|
+
return __result;
|
|
200
|
+
}
|
|
201
|
+
inline void setCustomMapStyle(const std::optional<std::vector<MapStyleElement>>& customMapStyle) noexcept override {
|
|
202
|
+
_swiftPart.setCustomMapStyle(customMapStyle);
|
|
203
|
+
}
|
|
204
|
+
inline std::optional<bool> getShowsMyLocationButton() noexcept override {
|
|
205
|
+
auto __result = _swiftPart.getShowsMyLocationButton();
|
|
206
|
+
return __result;
|
|
207
|
+
}
|
|
208
|
+
inline void setShowsMyLocationButton(std::optional<bool> showsMyLocationButton) noexcept override {
|
|
209
|
+
_swiftPart.setShowsMyLocationButton(showsMyLocationButton);
|
|
210
|
+
}
|
|
211
|
+
inline std::optional<ClusterConfig> getClusterConfig() noexcept override {
|
|
212
|
+
auto __result = _swiftPart.getClusterConfig();
|
|
213
|
+
return __result;
|
|
214
|
+
}
|
|
215
|
+
inline void setClusterConfig(const std::optional<ClusterConfig>& clusterConfig) noexcept override {
|
|
216
|
+
_swiftPart.setClusterConfig(clusterConfig);
|
|
217
|
+
}
|
|
218
|
+
inline std::optional<bool> getDarkMode() noexcept override {
|
|
219
|
+
auto __result = _swiftPart.getDarkMode();
|
|
220
|
+
return __result;
|
|
221
|
+
}
|
|
222
|
+
inline void setDarkMode(std::optional<bool> darkMode) noexcept override {
|
|
223
|
+
_swiftPart.setDarkMode(darkMode);
|
|
224
|
+
}
|
|
225
|
+
inline std::optional<std::function<void(const MapPressEvent& /* event */)>> getOnPress() noexcept override {
|
|
226
|
+
auto __result = _swiftPart.getOnPress();
|
|
227
|
+
return __result;
|
|
228
|
+
}
|
|
229
|
+
inline void setOnPress(const std::optional<std::function<void(const MapPressEvent& /* event */)>>& onPress) noexcept override {
|
|
230
|
+
_swiftPart.setOnPress(onPress);
|
|
231
|
+
}
|
|
232
|
+
inline std::optional<std::function<void(const MapPressEvent& /* event */)>> getOnLongPress() noexcept override {
|
|
233
|
+
auto __result = _swiftPart.getOnLongPress();
|
|
234
|
+
return __result;
|
|
235
|
+
}
|
|
236
|
+
inline void setOnLongPress(const std::optional<std::function<void(const MapPressEvent& /* event */)>>& onLongPress) noexcept override {
|
|
237
|
+
_swiftPart.setOnLongPress(onLongPress);
|
|
238
|
+
}
|
|
239
|
+
inline std::optional<std::function<void()>> getOnMapReady() noexcept override {
|
|
240
|
+
auto __result = _swiftPart.getOnMapReady();
|
|
241
|
+
return __result;
|
|
242
|
+
}
|
|
243
|
+
inline void setOnMapReady(const std::optional<std::function<void()>>& onMapReady) noexcept override {
|
|
244
|
+
_swiftPart.setOnMapReady(onMapReady);
|
|
245
|
+
}
|
|
246
|
+
inline std::optional<std::function<void(const RegionChangeEvent& /* region */)>> getOnRegionChange() noexcept override {
|
|
247
|
+
auto __result = _swiftPart.getOnRegionChange();
|
|
248
|
+
return __result;
|
|
249
|
+
}
|
|
250
|
+
inline void setOnRegionChange(const std::optional<std::function<void(const RegionChangeEvent& /* region */)>>& onRegionChange) noexcept override {
|
|
251
|
+
_swiftPart.setOnRegionChange(onRegionChange);
|
|
252
|
+
}
|
|
253
|
+
inline std::optional<std::function<void(const RegionChangeEvent& /* region */)>> getOnRegionChangeComplete() noexcept override {
|
|
254
|
+
auto __result = _swiftPart.getOnRegionChangeComplete();
|
|
255
|
+
return __result;
|
|
256
|
+
}
|
|
257
|
+
inline void setOnRegionChangeComplete(const std::optional<std::function<void(const RegionChangeEvent& /* region */)>>& onRegionChangeComplete) noexcept override {
|
|
258
|
+
_swiftPart.setOnRegionChangeComplete(onRegionChangeComplete);
|
|
259
|
+
}
|
|
260
|
+
inline std::optional<std::function<void(const MarkerPressEvent& /* event */)>> getOnMarkerPress() noexcept override {
|
|
261
|
+
auto __result = _swiftPart.getOnMarkerPress();
|
|
262
|
+
return __result;
|
|
263
|
+
}
|
|
264
|
+
inline void setOnMarkerPress(const std::optional<std::function<void(const MarkerPressEvent& /* event */)>>& onMarkerPress) noexcept override {
|
|
265
|
+
_swiftPart.setOnMarkerPress(onMarkerPress);
|
|
266
|
+
}
|
|
267
|
+
inline std::optional<std::function<void(const MarkerDragEvent& /* event */)>> getOnMarkerDragStart() noexcept override {
|
|
268
|
+
auto __result = _swiftPart.getOnMarkerDragStart();
|
|
269
|
+
return __result;
|
|
270
|
+
}
|
|
271
|
+
inline void setOnMarkerDragStart(const std::optional<std::function<void(const MarkerDragEvent& /* event */)>>& onMarkerDragStart) noexcept override {
|
|
272
|
+
_swiftPart.setOnMarkerDragStart(onMarkerDragStart);
|
|
273
|
+
}
|
|
274
|
+
inline std::optional<std::function<void(const MarkerDragEvent& /* event */)>> getOnMarkerDrag() noexcept override {
|
|
275
|
+
auto __result = _swiftPart.getOnMarkerDrag();
|
|
276
|
+
return __result;
|
|
277
|
+
}
|
|
278
|
+
inline void setOnMarkerDrag(const std::optional<std::function<void(const MarkerDragEvent& /* event */)>>& onMarkerDrag) noexcept override {
|
|
279
|
+
_swiftPart.setOnMarkerDrag(onMarkerDrag);
|
|
280
|
+
}
|
|
281
|
+
inline std::optional<std::function<void(const MarkerDragEvent& /* event */)>> getOnMarkerDragEnd() noexcept override {
|
|
282
|
+
auto __result = _swiftPart.getOnMarkerDragEnd();
|
|
283
|
+
return __result;
|
|
284
|
+
}
|
|
285
|
+
inline void setOnMarkerDragEnd(const std::optional<std::function<void(const MarkerDragEvent& /* event */)>>& onMarkerDragEnd) noexcept override {
|
|
286
|
+
_swiftPart.setOnMarkerDragEnd(onMarkerDragEnd);
|
|
287
|
+
}
|
|
288
|
+
inline std::optional<std::function<void(const ClusterPressEvent& /* event */)>> getOnClusterPress() noexcept override {
|
|
289
|
+
auto __result = _swiftPart.getOnClusterPress();
|
|
290
|
+
return __result;
|
|
291
|
+
}
|
|
292
|
+
inline void setOnClusterPress(const std::optional<std::function<void(const ClusterPressEvent& /* event */)>>& onClusterPress) noexcept override {
|
|
293
|
+
_swiftPart.setOnClusterPress(onClusterPress);
|
|
294
|
+
}
|
|
295
|
+
inline std::optional<std::function<void(const MapError& /* error */)>> getOnError() noexcept override {
|
|
296
|
+
auto __result = _swiftPart.getOnError();
|
|
297
|
+
return __result;
|
|
298
|
+
}
|
|
299
|
+
inline void setOnError(const std::optional<std::function<void(const MapError& /* error */)>>& onError) noexcept override {
|
|
300
|
+
_swiftPart.setOnError(onError);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
public:
|
|
304
|
+
// Methods
|
|
305
|
+
inline void animateToRegion(const Region& region, std::optional<double> duration) override {
|
|
306
|
+
auto __result = _swiftPart.animateToRegion(std::forward<decltype(region)>(region), duration);
|
|
307
|
+
if (__result.hasError()) [[unlikely]] {
|
|
308
|
+
std::rethrow_exception(__result.error());
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
inline void fitToCoordinates(const std::vector<Coordinate>& coordinates, const std::optional<EdgePadding>& edgePadding, std::optional<bool> animated) override {
|
|
312
|
+
auto __result = _swiftPart.fitToCoordinates(coordinates, edgePadding, animated);
|
|
313
|
+
if (__result.hasError()) [[unlikely]] {
|
|
314
|
+
std::rethrow_exception(__result.error());
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
inline void animateCamera(const Camera& camera, std::optional<double> duration) override {
|
|
318
|
+
auto __result = _swiftPart.animateCamera(std::forward<decltype(camera)>(camera), duration);
|
|
319
|
+
if (__result.hasError()) [[unlikely]] {
|
|
320
|
+
std::rethrow_exception(__result.error());
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
inline std::shared_ptr<Promise<Camera>> getCamera() override {
|
|
324
|
+
auto __result = _swiftPart.getCamera();
|
|
325
|
+
if (__result.hasError()) [[unlikely]] {
|
|
326
|
+
std::rethrow_exception(__result.error());
|
|
327
|
+
}
|
|
328
|
+
auto __value = std::move(__result.value());
|
|
329
|
+
return __value;
|
|
330
|
+
}
|
|
331
|
+
inline void setCamera(const Camera& camera) override {
|
|
332
|
+
auto __result = _swiftPart.setCamera(std::forward<decltype(camera)>(camera));
|
|
333
|
+
if (__result.hasError()) [[unlikely]] {
|
|
334
|
+
std::rethrow_exception(__result.error());
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
inline void setMapStyle(const std::optional<std::vector<MapStyleElement>>& style) override {
|
|
338
|
+
auto __result = _swiftPart.setMapStyle(style);
|
|
339
|
+
if (__result.hasError()) [[unlikely]] {
|
|
340
|
+
std::rethrow_exception(__result.error());
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
inline std::shared_ptr<Promise<MapBoundaries>> getMapBoundaries() override {
|
|
344
|
+
auto __result = _swiftPart.getMapBoundaries();
|
|
345
|
+
if (__result.hasError()) [[unlikely]] {
|
|
346
|
+
std::rethrow_exception(__result.error());
|
|
347
|
+
}
|
|
348
|
+
auto __value = std::move(__result.value());
|
|
349
|
+
return __value;
|
|
350
|
+
}
|
|
351
|
+
inline void setIsDarkMode(bool enabled) override {
|
|
352
|
+
auto __result = _swiftPart.setIsDarkMode(std::forward<decltype(enabled)>(enabled));
|
|
353
|
+
if (__result.hasError()) [[unlikely]] {
|
|
354
|
+
std::rethrow_exception(__result.error());
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
inline void addMarker(const MarkerData& marker) override {
|
|
358
|
+
auto __result = _swiftPart.addMarker(std::forward<decltype(marker)>(marker));
|
|
359
|
+
if (__result.hasError()) [[unlikely]] {
|
|
360
|
+
std::rethrow_exception(__result.error());
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
inline void addMarkers(const std::vector<MarkerData>& markers) override {
|
|
364
|
+
auto __result = _swiftPart.addMarkers(markers);
|
|
365
|
+
if (__result.hasError()) [[unlikely]] {
|
|
366
|
+
std::rethrow_exception(__result.error());
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
inline void updateMarker(const MarkerData& marker) override {
|
|
370
|
+
auto __result = _swiftPart.updateMarker(std::forward<decltype(marker)>(marker));
|
|
371
|
+
if (__result.hasError()) [[unlikely]] {
|
|
372
|
+
std::rethrow_exception(__result.error());
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
inline void removeMarker(const std::string& id) override {
|
|
376
|
+
auto __result = _swiftPart.removeMarker(id);
|
|
377
|
+
if (__result.hasError()) [[unlikely]] {
|
|
378
|
+
std::rethrow_exception(__result.error());
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
inline void selectMarker(const std::string& id) override {
|
|
382
|
+
auto __result = _swiftPart.selectMarker(id);
|
|
383
|
+
if (__result.hasError()) [[unlikely]] {
|
|
384
|
+
std::rethrow_exception(__result.error());
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
inline void clearMarkers() override {
|
|
388
|
+
auto __result = _swiftPart.clearMarkers();
|
|
389
|
+
if (__result.hasError()) [[unlikely]] {
|
|
390
|
+
std::rethrow_exception(__result.error());
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
inline void setClusteringEnabled(bool enabled) override {
|
|
394
|
+
auto __result = _swiftPart.setClusteringEnabled(std::forward<decltype(enabled)>(enabled));
|
|
395
|
+
if (__result.hasError()) [[unlikely]] {
|
|
396
|
+
std::rethrow_exception(__result.error());
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
inline void refreshClusters() override {
|
|
400
|
+
auto __result = _swiftPart.refreshClusters();
|
|
401
|
+
if (__result.hasError()) [[unlikely]] {
|
|
402
|
+
std::rethrow_exception(__result.error());
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
private:
|
|
407
|
+
NitroMap::HybridNitroMapSpec_cxx _swiftPart;
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroMapComponent.mm
|
|
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
|
+
#import "HybridNitroMapComponent.hpp"
|
|
9
|
+
#import <memory>
|
|
10
|
+
#import <react/renderer/componentregistry/ComponentDescriptorProvider.h>
|
|
11
|
+
#import <React/RCTViewComponentView.h>
|
|
12
|
+
#import <React/RCTComponentViewFactory.h>
|
|
13
|
+
#import <React/UIView+ComponentViewProtocol.h>
|
|
14
|
+
#import <NitroModules/NitroDefines.hpp>
|
|
15
|
+
#import <UIKit/UIKit.h>
|
|
16
|
+
|
|
17
|
+
#import "HybridNitroMapSpecSwift.hpp"
|
|
18
|
+
#import "NitroMap-Swift-Cxx-Umbrella.hpp"
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
using namespace margelo::nitro::nitromap;
|
|
22
|
+
using namespace margelo::nitro::nitromap::views;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Represents the React Native View holder for the Nitro "NitroMap" HybridView.
|
|
26
|
+
*/
|
|
27
|
+
@interface HybridNitroMapComponent: RCTViewComponentView
|
|
28
|
+
@end
|
|
29
|
+
|
|
30
|
+
@implementation HybridNitroMapComponent {
|
|
31
|
+
std::shared_ptr<HybridNitroMapSpecSwift> _hybridView;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
+ (void) load {
|
|
35
|
+
[super load];
|
|
36
|
+
[RCTComponentViewFactory.currentComponentViewFactory registerComponentViewClass:[HybridNitroMapComponent class]];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
+ (react::ComponentDescriptorProvider) componentDescriptorProvider {
|
|
40
|
+
return react::concreteComponentDescriptorProvider<HybridNitroMapComponentDescriptor>();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
- (instancetype) init {
|
|
44
|
+
if (self = [super init]) {
|
|
45
|
+
std::shared_ptr<HybridNitroMapSpec> hybridView = NitroMap::NitroMapAutolinking::createNitroMap();
|
|
46
|
+
_hybridView = std::dynamic_pointer_cast<HybridNitroMapSpecSwift>(hybridView);
|
|
47
|
+
[self updateView];
|
|
48
|
+
}
|
|
49
|
+
return self;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
- (void) updateView {
|
|
53
|
+
// 1. Get Swift part
|
|
54
|
+
NitroMap::HybridNitroMapSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
55
|
+
|
|
56
|
+
// 2. Get UIView*
|
|
57
|
+
void* viewUnsafe = swiftPart.getView();
|
|
58
|
+
UIView* view = (__bridge_transfer UIView*) viewUnsafe;
|
|
59
|
+
|
|
60
|
+
// 3. Update RCTViewComponentView's [contentView]
|
|
61
|
+
[self setContentView:view];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
- (void) updateProps:(const std::shared_ptr<const react::Props>&)props
|
|
65
|
+
oldProps:(const std::shared_ptr<const react::Props>&)oldProps {
|
|
66
|
+
// 1. Downcast props
|
|
67
|
+
const auto& newViewPropsConst = *std::static_pointer_cast<HybridNitroMapProps const>(props);
|
|
68
|
+
auto& newViewProps = const_cast<HybridNitroMapProps&>(newViewPropsConst);
|
|
69
|
+
NitroMap::HybridNitroMapSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
70
|
+
|
|
71
|
+
// 2. Update each prop individually
|
|
72
|
+
swiftPart.beforeUpdate();
|
|
73
|
+
|
|
74
|
+
// provider: optional
|
|
75
|
+
if (newViewProps.provider.isDirty) {
|
|
76
|
+
swiftPart.setProvider(newViewProps.provider.value);
|
|
77
|
+
newViewProps.provider.isDirty = false;
|
|
78
|
+
}
|
|
79
|
+
// initialRegion: optional
|
|
80
|
+
if (newViewProps.initialRegion.isDirty) {
|
|
81
|
+
swiftPart.setInitialRegion(newViewProps.initialRegion.value);
|
|
82
|
+
newViewProps.initialRegion.isDirty = false;
|
|
83
|
+
}
|
|
84
|
+
// showsUserLocation: optional
|
|
85
|
+
if (newViewProps.showsUserLocation.isDirty) {
|
|
86
|
+
swiftPart.setShowsUserLocation(newViewProps.showsUserLocation.value);
|
|
87
|
+
newViewProps.showsUserLocation.isDirty = false;
|
|
88
|
+
}
|
|
89
|
+
// zoomEnabled: optional
|
|
90
|
+
if (newViewProps.zoomEnabled.isDirty) {
|
|
91
|
+
swiftPart.setZoomEnabled(newViewProps.zoomEnabled.value);
|
|
92
|
+
newViewProps.zoomEnabled.isDirty = false;
|
|
93
|
+
}
|
|
94
|
+
// scrollEnabled: optional
|
|
95
|
+
if (newViewProps.scrollEnabled.isDirty) {
|
|
96
|
+
swiftPart.setScrollEnabled(newViewProps.scrollEnabled.value);
|
|
97
|
+
newViewProps.scrollEnabled.isDirty = false;
|
|
98
|
+
}
|
|
99
|
+
// rotateEnabled: optional
|
|
100
|
+
if (newViewProps.rotateEnabled.isDirty) {
|
|
101
|
+
swiftPart.setRotateEnabled(newViewProps.rotateEnabled.value);
|
|
102
|
+
newViewProps.rotateEnabled.isDirty = false;
|
|
103
|
+
}
|
|
104
|
+
// pitchEnabled: optional
|
|
105
|
+
if (newViewProps.pitchEnabled.isDirty) {
|
|
106
|
+
swiftPart.setPitchEnabled(newViewProps.pitchEnabled.value);
|
|
107
|
+
newViewProps.pitchEnabled.isDirty = false;
|
|
108
|
+
}
|
|
109
|
+
// mapType: optional
|
|
110
|
+
if (newViewProps.mapType.isDirty) {
|
|
111
|
+
swiftPart.setMapType(newViewProps.mapType.value);
|
|
112
|
+
newViewProps.mapType.isDirty = false;
|
|
113
|
+
}
|
|
114
|
+
// customMapStyle: optional
|
|
115
|
+
if (newViewProps.customMapStyle.isDirty) {
|
|
116
|
+
swiftPart.setCustomMapStyle(newViewProps.customMapStyle.value);
|
|
117
|
+
newViewProps.customMapStyle.isDirty = false;
|
|
118
|
+
}
|
|
119
|
+
// showsMyLocationButton: optional
|
|
120
|
+
if (newViewProps.showsMyLocationButton.isDirty) {
|
|
121
|
+
swiftPart.setShowsMyLocationButton(newViewProps.showsMyLocationButton.value);
|
|
122
|
+
newViewProps.showsMyLocationButton.isDirty = false;
|
|
123
|
+
}
|
|
124
|
+
// clusterConfig: optional
|
|
125
|
+
if (newViewProps.clusterConfig.isDirty) {
|
|
126
|
+
swiftPart.setClusterConfig(newViewProps.clusterConfig.value);
|
|
127
|
+
newViewProps.clusterConfig.isDirty = false;
|
|
128
|
+
}
|
|
129
|
+
// darkMode: optional
|
|
130
|
+
if (newViewProps.darkMode.isDirty) {
|
|
131
|
+
swiftPart.setDarkMode(newViewProps.darkMode.value);
|
|
132
|
+
newViewProps.darkMode.isDirty = false;
|
|
133
|
+
}
|
|
134
|
+
// onPress: optional
|
|
135
|
+
if (newViewProps.onPress.isDirty) {
|
|
136
|
+
swiftPart.setOnPress(newViewProps.onPress.value);
|
|
137
|
+
newViewProps.onPress.isDirty = false;
|
|
138
|
+
}
|
|
139
|
+
// onLongPress: optional
|
|
140
|
+
if (newViewProps.onLongPress.isDirty) {
|
|
141
|
+
swiftPart.setOnLongPress(newViewProps.onLongPress.value);
|
|
142
|
+
newViewProps.onLongPress.isDirty = false;
|
|
143
|
+
}
|
|
144
|
+
// onMapReady: optional
|
|
145
|
+
if (newViewProps.onMapReady.isDirty) {
|
|
146
|
+
swiftPart.setOnMapReady(newViewProps.onMapReady.value);
|
|
147
|
+
newViewProps.onMapReady.isDirty = false;
|
|
148
|
+
}
|
|
149
|
+
// onRegionChange: optional
|
|
150
|
+
if (newViewProps.onRegionChange.isDirty) {
|
|
151
|
+
swiftPart.setOnRegionChange(newViewProps.onRegionChange.value);
|
|
152
|
+
newViewProps.onRegionChange.isDirty = false;
|
|
153
|
+
}
|
|
154
|
+
// onRegionChangeComplete: optional
|
|
155
|
+
if (newViewProps.onRegionChangeComplete.isDirty) {
|
|
156
|
+
swiftPart.setOnRegionChangeComplete(newViewProps.onRegionChangeComplete.value);
|
|
157
|
+
newViewProps.onRegionChangeComplete.isDirty = false;
|
|
158
|
+
}
|
|
159
|
+
// onMarkerPress: optional
|
|
160
|
+
if (newViewProps.onMarkerPress.isDirty) {
|
|
161
|
+
swiftPart.setOnMarkerPress(newViewProps.onMarkerPress.value);
|
|
162
|
+
newViewProps.onMarkerPress.isDirty = false;
|
|
163
|
+
}
|
|
164
|
+
// onMarkerDragStart: optional
|
|
165
|
+
if (newViewProps.onMarkerDragStart.isDirty) {
|
|
166
|
+
swiftPart.setOnMarkerDragStart(newViewProps.onMarkerDragStart.value);
|
|
167
|
+
newViewProps.onMarkerDragStart.isDirty = false;
|
|
168
|
+
}
|
|
169
|
+
// onMarkerDrag: optional
|
|
170
|
+
if (newViewProps.onMarkerDrag.isDirty) {
|
|
171
|
+
swiftPart.setOnMarkerDrag(newViewProps.onMarkerDrag.value);
|
|
172
|
+
newViewProps.onMarkerDrag.isDirty = false;
|
|
173
|
+
}
|
|
174
|
+
// onMarkerDragEnd: optional
|
|
175
|
+
if (newViewProps.onMarkerDragEnd.isDirty) {
|
|
176
|
+
swiftPart.setOnMarkerDragEnd(newViewProps.onMarkerDragEnd.value);
|
|
177
|
+
newViewProps.onMarkerDragEnd.isDirty = false;
|
|
178
|
+
}
|
|
179
|
+
// onClusterPress: optional
|
|
180
|
+
if (newViewProps.onClusterPress.isDirty) {
|
|
181
|
+
swiftPart.setOnClusterPress(newViewProps.onClusterPress.value);
|
|
182
|
+
newViewProps.onClusterPress.isDirty = false;
|
|
183
|
+
}
|
|
184
|
+
// onError: optional
|
|
185
|
+
if (newViewProps.onError.isDirty) {
|
|
186
|
+
swiftPart.setOnError(newViewProps.onError.value);
|
|
187
|
+
newViewProps.onError.isDirty = false;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
swiftPart.afterUpdate();
|
|
191
|
+
|
|
192
|
+
// 3. Update hybridRef if it changed
|
|
193
|
+
if (newViewProps.hybridRef.isDirty) {
|
|
194
|
+
// hybridRef changed - call it with new this
|
|
195
|
+
const auto& maybeFunc = newViewProps.hybridRef.value;
|
|
196
|
+
if (maybeFunc.has_value()) {
|
|
197
|
+
maybeFunc.value()(_hybridView);
|
|
198
|
+
}
|
|
199
|
+
newViewProps.hybridRef.isDirty = false;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// 4. Continue in base class
|
|
203
|
+
[super updateProps:props oldProps:oldProps];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
@end
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Camera.swift
|
|
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
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an instance of `Camera`, backed by a C++ struct.
|
|
13
|
+
*/
|
|
14
|
+
public typealias Camera = margelo.nitro.nitromap.Camera
|
|
15
|
+
|
|
16
|
+
public extension Camera {
|
|
17
|
+
private typealias bridge = margelo.nitro.nitromap.bridge.swift
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of `Camera`.
|
|
21
|
+
*/
|
|
22
|
+
init(center: Coordinate, pitch: Double, heading: Double, altitude: Double, zoom: Double) {
|
|
23
|
+
self.init(center, pitch, heading, altitude, zoom)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var center: Coordinate {
|
|
27
|
+
@inline(__always)
|
|
28
|
+
get {
|
|
29
|
+
return self.__center
|
|
30
|
+
}
|
|
31
|
+
@inline(__always)
|
|
32
|
+
set {
|
|
33
|
+
self.__center = newValue
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var pitch: Double {
|
|
38
|
+
@inline(__always)
|
|
39
|
+
get {
|
|
40
|
+
return self.__pitch
|
|
41
|
+
}
|
|
42
|
+
@inline(__always)
|
|
43
|
+
set {
|
|
44
|
+
self.__pitch = newValue
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var heading: Double {
|
|
49
|
+
@inline(__always)
|
|
50
|
+
get {
|
|
51
|
+
return self.__heading
|
|
52
|
+
}
|
|
53
|
+
@inline(__always)
|
|
54
|
+
set {
|
|
55
|
+
self.__heading = newValue
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var altitude: Double {
|
|
60
|
+
@inline(__always)
|
|
61
|
+
get {
|
|
62
|
+
return self.__altitude
|
|
63
|
+
}
|
|
64
|
+
@inline(__always)
|
|
65
|
+
set {
|
|
66
|
+
self.__altitude = newValue
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var zoom: Double {
|
|
71
|
+
@inline(__always)
|
|
72
|
+
get {
|
|
73
|
+
return self.__zoom
|
|
74
|
+
}
|
|
75
|
+
@inline(__always)
|
|
76
|
+
set {
|
|
77
|
+
self.__zoom = newValue
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|