@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,173 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroMapSpec.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/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `MapProvider` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::nitromap { enum class MapProvider; }
|
|
18
|
+
// Forward declaration of `Region` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::nitromap { struct Region; }
|
|
20
|
+
// Forward declaration of `MapType` to properly resolve imports.
|
|
21
|
+
namespace margelo::nitro::nitromap { enum class MapType; }
|
|
22
|
+
// Forward declaration of `MapStyleElement` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::nitromap { struct MapStyleElement; }
|
|
24
|
+
// Forward declaration of `ClusterConfig` to properly resolve imports.
|
|
25
|
+
namespace margelo::nitro::nitromap { struct ClusterConfig; }
|
|
26
|
+
// Forward declaration of `MapPressEvent` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::nitromap { struct MapPressEvent; }
|
|
28
|
+
// Forward declaration of `RegionChangeEvent` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::nitromap { struct RegionChangeEvent; }
|
|
30
|
+
// Forward declaration of `MarkerPressEvent` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::nitromap { struct MarkerPressEvent; }
|
|
32
|
+
// Forward declaration of `MarkerDragEvent` to properly resolve imports.
|
|
33
|
+
namespace margelo::nitro::nitromap { struct MarkerDragEvent; }
|
|
34
|
+
// Forward declaration of `ClusterPressEvent` to properly resolve imports.
|
|
35
|
+
namespace margelo::nitro::nitromap { struct ClusterPressEvent; }
|
|
36
|
+
// Forward declaration of `MapError` to properly resolve imports.
|
|
37
|
+
namespace margelo::nitro::nitromap { struct MapError; }
|
|
38
|
+
// Forward declaration of `Coordinate` to properly resolve imports.
|
|
39
|
+
namespace margelo::nitro::nitromap { struct Coordinate; }
|
|
40
|
+
// Forward declaration of `EdgePadding` to properly resolve imports.
|
|
41
|
+
namespace margelo::nitro::nitromap { struct EdgePadding; }
|
|
42
|
+
// Forward declaration of `Camera` to properly resolve imports.
|
|
43
|
+
namespace margelo::nitro::nitromap { struct Camera; }
|
|
44
|
+
// Forward declaration of `MapBoundaries` to properly resolve imports.
|
|
45
|
+
namespace margelo::nitro::nitromap { struct MapBoundaries; }
|
|
46
|
+
// Forward declaration of `MarkerData` to properly resolve imports.
|
|
47
|
+
namespace margelo::nitro::nitromap { struct MarkerData; }
|
|
48
|
+
|
|
49
|
+
#include "MapProvider.hpp"
|
|
50
|
+
#include <optional>
|
|
51
|
+
#include "Region.hpp"
|
|
52
|
+
#include "MapType.hpp"
|
|
53
|
+
#include "MapStyleElement.hpp"
|
|
54
|
+
#include <vector>
|
|
55
|
+
#include "ClusterConfig.hpp"
|
|
56
|
+
#include "MapPressEvent.hpp"
|
|
57
|
+
#include <functional>
|
|
58
|
+
#include "RegionChangeEvent.hpp"
|
|
59
|
+
#include "MarkerPressEvent.hpp"
|
|
60
|
+
#include "MarkerDragEvent.hpp"
|
|
61
|
+
#include "ClusterPressEvent.hpp"
|
|
62
|
+
#include "MapError.hpp"
|
|
63
|
+
#include "Coordinate.hpp"
|
|
64
|
+
#include "EdgePadding.hpp"
|
|
65
|
+
#include "Camera.hpp"
|
|
66
|
+
#include <NitroModules/Promise.hpp>
|
|
67
|
+
#include "MapBoundaries.hpp"
|
|
68
|
+
#include "MarkerData.hpp"
|
|
69
|
+
#include <string>
|
|
70
|
+
|
|
71
|
+
namespace margelo::nitro::nitromap {
|
|
72
|
+
|
|
73
|
+
using namespace margelo::nitro;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* An abstract base class for `NitroMap`
|
|
77
|
+
* Inherit this class to create instances of `HybridNitroMapSpec` in C++.
|
|
78
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
79
|
+
* @example
|
|
80
|
+
* ```cpp
|
|
81
|
+
* class HybridNitroMap: public HybridNitroMapSpec {
|
|
82
|
+
* public:
|
|
83
|
+
* HybridNitroMap(...): HybridObject(TAG) { ... }
|
|
84
|
+
* // ...
|
|
85
|
+
* };
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
class HybridNitroMapSpec: public virtual HybridObject {
|
|
89
|
+
public:
|
|
90
|
+
// Constructor
|
|
91
|
+
explicit HybridNitroMapSpec(): HybridObject(TAG) { }
|
|
92
|
+
|
|
93
|
+
// Destructor
|
|
94
|
+
~HybridNitroMapSpec() override = default;
|
|
95
|
+
|
|
96
|
+
public:
|
|
97
|
+
// Properties
|
|
98
|
+
virtual std::optional<MapProvider> getProvider() = 0;
|
|
99
|
+
virtual void setProvider(std::optional<MapProvider> provider) = 0;
|
|
100
|
+
virtual std::optional<Region> getInitialRegion() = 0;
|
|
101
|
+
virtual void setInitialRegion(const std::optional<Region>& initialRegion) = 0;
|
|
102
|
+
virtual std::optional<bool> getShowsUserLocation() = 0;
|
|
103
|
+
virtual void setShowsUserLocation(std::optional<bool> showsUserLocation) = 0;
|
|
104
|
+
virtual std::optional<bool> getZoomEnabled() = 0;
|
|
105
|
+
virtual void setZoomEnabled(std::optional<bool> zoomEnabled) = 0;
|
|
106
|
+
virtual std::optional<bool> getScrollEnabled() = 0;
|
|
107
|
+
virtual void setScrollEnabled(std::optional<bool> scrollEnabled) = 0;
|
|
108
|
+
virtual std::optional<bool> getRotateEnabled() = 0;
|
|
109
|
+
virtual void setRotateEnabled(std::optional<bool> rotateEnabled) = 0;
|
|
110
|
+
virtual std::optional<bool> getPitchEnabled() = 0;
|
|
111
|
+
virtual void setPitchEnabled(std::optional<bool> pitchEnabled) = 0;
|
|
112
|
+
virtual std::optional<MapType> getMapType() = 0;
|
|
113
|
+
virtual void setMapType(std::optional<MapType> mapType) = 0;
|
|
114
|
+
virtual std::optional<std::vector<MapStyleElement>> getCustomMapStyle() = 0;
|
|
115
|
+
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
|
+
virtual std::optional<ClusterConfig> getClusterConfig() = 0;
|
|
119
|
+
virtual void setClusterConfig(const std::optional<ClusterConfig>& clusterConfig) = 0;
|
|
120
|
+
virtual std::optional<bool> getDarkMode() = 0;
|
|
121
|
+
virtual void setDarkMode(std::optional<bool> darkMode) = 0;
|
|
122
|
+
virtual std::optional<std::function<void(const MapPressEvent& /* event */)>> getOnPress() = 0;
|
|
123
|
+
virtual void setOnPress(const std::optional<std::function<void(const MapPressEvent& /* event */)>>& onPress) = 0;
|
|
124
|
+
virtual std::optional<std::function<void(const MapPressEvent& /* event */)>> getOnLongPress() = 0;
|
|
125
|
+
virtual void setOnLongPress(const std::optional<std::function<void(const MapPressEvent& /* event */)>>& onLongPress) = 0;
|
|
126
|
+
virtual std::optional<std::function<void()>> getOnMapReady() = 0;
|
|
127
|
+
virtual void setOnMapReady(const std::optional<std::function<void()>>& onMapReady) = 0;
|
|
128
|
+
virtual std::optional<std::function<void(const RegionChangeEvent& /* region */)>> getOnRegionChange() = 0;
|
|
129
|
+
virtual void setOnRegionChange(const std::optional<std::function<void(const RegionChangeEvent& /* region */)>>& onRegionChange) = 0;
|
|
130
|
+
virtual std::optional<std::function<void(const RegionChangeEvent& /* region */)>> getOnRegionChangeComplete() = 0;
|
|
131
|
+
virtual void setOnRegionChangeComplete(const std::optional<std::function<void(const RegionChangeEvent& /* region */)>>& onRegionChangeComplete) = 0;
|
|
132
|
+
virtual std::optional<std::function<void(const MarkerPressEvent& /* event */)>> getOnMarkerPress() = 0;
|
|
133
|
+
virtual void setOnMarkerPress(const std::optional<std::function<void(const MarkerPressEvent& /* event */)>>& onMarkerPress) = 0;
|
|
134
|
+
virtual std::optional<std::function<void(const MarkerDragEvent& /* event */)>> getOnMarkerDragStart() = 0;
|
|
135
|
+
virtual void setOnMarkerDragStart(const std::optional<std::function<void(const MarkerDragEvent& /* event */)>>& onMarkerDragStart) = 0;
|
|
136
|
+
virtual std::optional<std::function<void(const MarkerDragEvent& /* event */)>> getOnMarkerDrag() = 0;
|
|
137
|
+
virtual void setOnMarkerDrag(const std::optional<std::function<void(const MarkerDragEvent& /* event */)>>& onMarkerDrag) = 0;
|
|
138
|
+
virtual std::optional<std::function<void(const MarkerDragEvent& /* event */)>> getOnMarkerDragEnd() = 0;
|
|
139
|
+
virtual void setOnMarkerDragEnd(const std::optional<std::function<void(const MarkerDragEvent& /* event */)>>& onMarkerDragEnd) = 0;
|
|
140
|
+
virtual std::optional<std::function<void(const ClusterPressEvent& /* event */)>> getOnClusterPress() = 0;
|
|
141
|
+
virtual void setOnClusterPress(const std::optional<std::function<void(const ClusterPressEvent& /* event */)>>& onClusterPress) = 0;
|
|
142
|
+
virtual std::optional<std::function<void(const MapError& /* error */)>> getOnError() = 0;
|
|
143
|
+
virtual void setOnError(const std::optional<std::function<void(const MapError& /* error */)>>& onError) = 0;
|
|
144
|
+
|
|
145
|
+
public:
|
|
146
|
+
// Methods
|
|
147
|
+
virtual void animateToRegion(const Region& region, std::optional<double> duration) = 0;
|
|
148
|
+
virtual void fitToCoordinates(const std::vector<Coordinate>& coordinates, const std::optional<EdgePadding>& edgePadding, std::optional<bool> animated) = 0;
|
|
149
|
+
virtual void animateCamera(const Camera& camera, std::optional<double> duration) = 0;
|
|
150
|
+
virtual std::shared_ptr<Promise<Camera>> getCamera() = 0;
|
|
151
|
+
virtual void setCamera(const Camera& camera) = 0;
|
|
152
|
+
virtual void setMapStyle(const std::optional<std::vector<MapStyleElement>>& style) = 0;
|
|
153
|
+
virtual std::shared_ptr<Promise<MapBoundaries>> getMapBoundaries() = 0;
|
|
154
|
+
virtual void setIsDarkMode(bool enabled) = 0;
|
|
155
|
+
virtual void addMarker(const MarkerData& marker) = 0;
|
|
156
|
+
virtual void addMarkers(const std::vector<MarkerData>& markers) = 0;
|
|
157
|
+
virtual void updateMarker(const MarkerData& marker) = 0;
|
|
158
|
+
virtual void removeMarker(const std::string& id) = 0;
|
|
159
|
+
virtual void selectMarker(const std::string& id) = 0;
|
|
160
|
+
virtual void clearMarkers() = 0;
|
|
161
|
+
virtual void setClusteringEnabled(bool enabled) = 0;
|
|
162
|
+
virtual void refreshClusters() = 0;
|
|
163
|
+
|
|
164
|
+
protected:
|
|
165
|
+
// Hybrid Setup
|
|
166
|
+
void loadHybridMethods() override;
|
|
167
|
+
|
|
168
|
+
protected:
|
|
169
|
+
// Tag for logging
|
|
170
|
+
static constexpr auto TAG = "NitroMap";
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ImageMarkerConfig.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 `MarkerColor` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::nitromap { struct MarkerColor; }
|
|
28
|
+
|
|
29
|
+
#include <string>
|
|
30
|
+
#include <optional>
|
|
31
|
+
#include "MarkerColor.hpp"
|
|
32
|
+
#include <variant>
|
|
33
|
+
|
|
34
|
+
namespace margelo::nitro::nitromap {
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A struct which can be represented as a JavaScript object (ImageMarkerConfig).
|
|
38
|
+
*/
|
|
39
|
+
struct ImageMarkerConfig {
|
|
40
|
+
public:
|
|
41
|
+
std::optional<std::string> imageUrl SWIFT_PRIVATE;
|
|
42
|
+
std::optional<std::string> imageBase64 SWIFT_PRIVATE;
|
|
43
|
+
double width SWIFT_PRIVATE;
|
|
44
|
+
double height SWIFT_PRIVATE;
|
|
45
|
+
double cornerRadius SWIFT_PRIVATE;
|
|
46
|
+
double borderWidth SWIFT_PRIVATE;
|
|
47
|
+
std::variant<std::string, MarkerColor> borderColor SWIFT_PRIVATE;
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
ImageMarkerConfig() = default;
|
|
51
|
+
explicit ImageMarkerConfig(std::optional<std::string> imageUrl, std::optional<std::string> imageBase64, double width, double height, double cornerRadius, double borderWidth, std::variant<std::string, MarkerColor> borderColor): imageUrl(imageUrl), imageBase64(imageBase64), width(width), height(height), cornerRadius(cornerRadius), borderWidth(borderWidth), borderColor(borderColor) {}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
} // namespace margelo::nitro::nitromap
|
|
55
|
+
|
|
56
|
+
namespace margelo::nitro {
|
|
57
|
+
|
|
58
|
+
// C++ ImageMarkerConfig <> JS ImageMarkerConfig (object)
|
|
59
|
+
template <>
|
|
60
|
+
struct JSIConverter<margelo::nitro::nitromap::ImageMarkerConfig> final {
|
|
61
|
+
static inline margelo::nitro::nitromap::ImageMarkerConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
62
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
63
|
+
return margelo::nitro::nitromap::ImageMarkerConfig(
|
|
64
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "imageUrl")),
|
|
65
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "imageBase64")),
|
|
66
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "width")),
|
|
67
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "height")),
|
|
68
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "cornerRadius")),
|
|
69
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "borderWidth")),
|
|
70
|
+
JSIConverter<std::variant<std::string, margelo::nitro::nitromap::MarkerColor>>::fromJSI(runtime, obj.getProperty(runtime, "borderColor"))
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::ImageMarkerConfig& arg) {
|
|
74
|
+
jsi::Object obj(runtime);
|
|
75
|
+
obj.setProperty(runtime, "imageUrl", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.imageUrl));
|
|
76
|
+
obj.setProperty(runtime, "imageBase64", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.imageBase64));
|
|
77
|
+
obj.setProperty(runtime, "width", JSIConverter<double>::toJSI(runtime, arg.width));
|
|
78
|
+
obj.setProperty(runtime, "height", JSIConverter<double>::toJSI(runtime, arg.height));
|
|
79
|
+
obj.setProperty(runtime, "cornerRadius", JSIConverter<double>::toJSI(runtime, arg.cornerRadius));
|
|
80
|
+
obj.setProperty(runtime, "borderWidth", JSIConverter<double>::toJSI(runtime, arg.borderWidth));
|
|
81
|
+
obj.setProperty(runtime, "borderColor", JSIConverter<std::variant<std::string, margelo::nitro::nitromap::MarkerColor>>::toJSI(runtime, arg.borderColor));
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
85
|
+
if (!value.isObject()) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
jsi::Object obj = value.getObject(runtime);
|
|
89
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "imageUrl"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "imageBase64"))) return false;
|
|
94
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "width"))) return false;
|
|
95
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "height"))) return false;
|
|
96
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "cornerRadius"))) return false;
|
|
97
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "borderWidth"))) return false;
|
|
98
|
+
if (!JSIConverter<std::variant<std::string, margelo::nitro::nitromap::MarkerColor>>::canConvert(runtime, obj.getProperty(runtime, "borderColor"))) return false;
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MapBoundaries.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
|
+
|
|
29
|
+
#include "Coordinate.hpp"
|
|
30
|
+
|
|
31
|
+
namespace margelo::nitro::nitromap {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A struct which can be represented as a JavaScript object (MapBoundaries).
|
|
35
|
+
*/
|
|
36
|
+
struct MapBoundaries {
|
|
37
|
+
public:
|
|
38
|
+
Coordinate northEast SWIFT_PRIVATE;
|
|
39
|
+
Coordinate southWest SWIFT_PRIVATE;
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
MapBoundaries() = default;
|
|
43
|
+
explicit MapBoundaries(Coordinate northEast, Coordinate southWest): northEast(northEast), southWest(southWest) {}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
} // namespace margelo::nitro::nitromap
|
|
47
|
+
|
|
48
|
+
namespace margelo::nitro {
|
|
49
|
+
|
|
50
|
+
// C++ MapBoundaries <> JS MapBoundaries (object)
|
|
51
|
+
template <>
|
|
52
|
+
struct JSIConverter<margelo::nitro::nitromap::MapBoundaries> final {
|
|
53
|
+
static inline margelo::nitro::nitromap::MapBoundaries fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
54
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
55
|
+
return margelo::nitro::nitromap::MapBoundaries(
|
|
56
|
+
JSIConverter<margelo::nitro::nitromap::Coordinate>::fromJSI(runtime, obj.getProperty(runtime, "northEast")),
|
|
57
|
+
JSIConverter<margelo::nitro::nitromap::Coordinate>::fromJSI(runtime, obj.getProperty(runtime, "southWest"))
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::MapBoundaries& arg) {
|
|
61
|
+
jsi::Object obj(runtime);
|
|
62
|
+
obj.setProperty(runtime, "northEast", JSIConverter<margelo::nitro::nitromap::Coordinate>::toJSI(runtime, arg.northEast));
|
|
63
|
+
obj.setProperty(runtime, "southWest", JSIConverter<margelo::nitro::nitromap::Coordinate>::toJSI(runtime, arg.southWest));
|
|
64
|
+
return obj;
|
|
65
|
+
}
|
|
66
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
67
|
+
if (!value.isObject()) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
jsi::Object obj = value.getObject(runtime);
|
|
71
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
if (!JSIConverter<margelo::nitro::nitromap::Coordinate>::canConvert(runtime, obj.getProperty(runtime, "northEast"))) return false;
|
|
75
|
+
if (!JSIConverter<margelo::nitro::nitromap::Coordinate>::canConvert(runtime, obj.getProperty(runtime, "southWest"))) return false;
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MapError.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
|
+
|
|
27
|
+
|
|
28
|
+
#include <string>
|
|
29
|
+
|
|
30
|
+
namespace margelo::nitro::nitromap {
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A struct which can be represented as a JavaScript object (MapError).
|
|
34
|
+
*/
|
|
35
|
+
struct MapError {
|
|
36
|
+
public:
|
|
37
|
+
std::string code SWIFT_PRIVATE;
|
|
38
|
+
std::string message SWIFT_PRIVATE;
|
|
39
|
+
|
|
40
|
+
public:
|
|
41
|
+
MapError() = default;
|
|
42
|
+
explicit MapError(std::string code, std::string message): code(code), message(message) {}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
} // namespace margelo::nitro::nitromap
|
|
46
|
+
|
|
47
|
+
namespace margelo::nitro {
|
|
48
|
+
|
|
49
|
+
// C++ MapError <> JS MapError (object)
|
|
50
|
+
template <>
|
|
51
|
+
struct JSIConverter<margelo::nitro::nitromap::MapError> final {
|
|
52
|
+
static inline margelo::nitro::nitromap::MapError fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
53
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
54
|
+
return margelo::nitro::nitromap::MapError(
|
|
55
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "code")),
|
|
56
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "message"))
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::MapError& arg) {
|
|
60
|
+
jsi::Object obj(runtime);
|
|
61
|
+
obj.setProperty(runtime, "code", JSIConverter<std::string>::toJSI(runtime, arg.code));
|
|
62
|
+
obj.setProperty(runtime, "message", JSIConverter<std::string>::toJSI(runtime, arg.message));
|
|
63
|
+
return obj;
|
|
64
|
+
}
|
|
65
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
66
|
+
if (!value.isObject()) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
jsi::Object obj = value.getObject(runtime);
|
|
70
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "code"))) return false;
|
|
74
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "message"))) return false;
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MapPressEvent.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 `Point` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::nitromap { struct Point; }
|
|
30
|
+
|
|
31
|
+
#include "Coordinate.hpp"
|
|
32
|
+
#include "Point.hpp"
|
|
33
|
+
|
|
34
|
+
namespace margelo::nitro::nitromap {
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A struct which can be represented as a JavaScript object (MapPressEvent).
|
|
38
|
+
*/
|
|
39
|
+
struct MapPressEvent {
|
|
40
|
+
public:
|
|
41
|
+
Coordinate coordinate SWIFT_PRIVATE;
|
|
42
|
+
Point position SWIFT_PRIVATE;
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
MapPressEvent() = default;
|
|
46
|
+
explicit MapPressEvent(Coordinate coordinate, Point position): coordinate(coordinate), position(position) {}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
} // namespace margelo::nitro::nitromap
|
|
50
|
+
|
|
51
|
+
namespace margelo::nitro {
|
|
52
|
+
|
|
53
|
+
// C++ MapPressEvent <> JS MapPressEvent (object)
|
|
54
|
+
template <>
|
|
55
|
+
struct JSIConverter<margelo::nitro::nitromap::MapPressEvent> final {
|
|
56
|
+
static inline margelo::nitro::nitromap::MapPressEvent fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
57
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
58
|
+
return margelo::nitro::nitromap::MapPressEvent(
|
|
59
|
+
JSIConverter<margelo::nitro::nitromap::Coordinate>::fromJSI(runtime, obj.getProperty(runtime, "coordinate")),
|
|
60
|
+
JSIConverter<margelo::nitro::nitromap::Point>::fromJSI(runtime, obj.getProperty(runtime, "position"))
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::MapPressEvent& arg) {
|
|
64
|
+
jsi::Object obj(runtime);
|
|
65
|
+
obj.setProperty(runtime, "coordinate", JSIConverter<margelo::nitro::nitromap::Coordinate>::toJSI(runtime, arg.coordinate));
|
|
66
|
+
obj.setProperty(runtime, "position", JSIConverter<margelo::nitro::nitromap::Point>::toJSI(runtime, arg.position));
|
|
67
|
+
return obj;
|
|
68
|
+
}
|
|
69
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
70
|
+
if (!value.isObject()) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
jsi::Object obj = value.getObject(runtime);
|
|
74
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
if (!JSIConverter<margelo::nitro::nitromap::Coordinate>::canConvert(runtime, obj.getProperty(runtime, "coordinate"))) return false;
|
|
78
|
+
if (!JSIConverter<margelo::nitro::nitromap::Point>::canConvert(runtime, obj.getProperty(runtime, "position"))) return false;
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MapProvider.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/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::nitromap {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (MapProvider).
|
|
30
|
+
*/
|
|
31
|
+
enum class MapProvider {
|
|
32
|
+
GOOGLE SWIFT_NAME(google) = 0,
|
|
33
|
+
APPLE SWIFT_NAME(apple) = 1,
|
|
34
|
+
YANDEX SWIFT_NAME(yandex) = 2,
|
|
35
|
+
} CLOSED_ENUM;
|
|
36
|
+
|
|
37
|
+
} // namespace margelo::nitro::nitromap
|
|
38
|
+
|
|
39
|
+
namespace margelo::nitro {
|
|
40
|
+
|
|
41
|
+
// C++ MapProvider <> JS MapProvider (union)
|
|
42
|
+
template <>
|
|
43
|
+
struct JSIConverter<margelo::nitro::nitromap::MapProvider> final {
|
|
44
|
+
static inline margelo::nitro::nitromap::MapProvider fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
45
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
46
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
47
|
+
case hashString("google"): return margelo::nitro::nitromap::MapProvider::GOOGLE;
|
|
48
|
+
case hashString("apple"): return margelo::nitro::nitromap::MapProvider::APPLE;
|
|
49
|
+
case hashString("yandex"): return margelo::nitro::nitromap::MapProvider::YANDEX;
|
|
50
|
+
default: [[unlikely]]
|
|
51
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum MapProvider - invalid value!");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitromap::MapProvider arg) {
|
|
55
|
+
switch (arg) {
|
|
56
|
+
case margelo::nitro::nitromap::MapProvider::GOOGLE: return JSIConverter<std::string>::toJSI(runtime, "google");
|
|
57
|
+
case margelo::nitro::nitromap::MapProvider::APPLE: return JSIConverter<std::string>::toJSI(runtime, "apple");
|
|
58
|
+
case margelo::nitro::nitromap::MapProvider::YANDEX: return JSIConverter<std::string>::toJSI(runtime, "yandex");
|
|
59
|
+
default: [[unlikely]]
|
|
60
|
+
throw std::invalid_argument("Cannot convert MapProvider to JS - invalid value: "
|
|
61
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
65
|
+
if (!value.isString()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
69
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
70
|
+
case hashString("google"):
|
|
71
|
+
case hashString("apple"):
|
|
72
|
+
case hashString("yandex"):
|
|
73
|
+
return true;
|
|
74
|
+
default:
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|