@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,125 @@
|
|
|
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
|
+
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include "HybridNitroMapSpec.hpp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::nitromap {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
class JHybridNitroMapSpec: public jni::HybridClass<JHybridNitroMapSpec, JHybridObject>,
|
|
22
|
+
public virtual HybridNitroMapSpec {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/HybridNitroMapSpec;";
|
|
25
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
|
+
static void registerNatives();
|
|
27
|
+
|
|
28
|
+
protected:
|
|
29
|
+
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
+
explicit JHybridNitroMapSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
+
HybridObject(HybridNitroMapSpec::TAG),
|
|
32
|
+
HybridBase(jThis),
|
|
33
|
+
_javaPart(jni::make_global(jThis)) {}
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
~JHybridNitroMapSpec() override {
|
|
37
|
+
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
38
|
+
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
size_t getExternalMemorySize() noexcept override;
|
|
43
|
+
void dispose() noexcept override;
|
|
44
|
+
std::string toString() override;
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
inline const jni::global_ref<JHybridNitroMapSpec::javaobject>& getJavaPart() const noexcept {
|
|
48
|
+
return _javaPart;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Properties
|
|
53
|
+
std::optional<MapProvider> getProvider() override;
|
|
54
|
+
void setProvider(std::optional<MapProvider> provider) override;
|
|
55
|
+
std::optional<Region> getInitialRegion() override;
|
|
56
|
+
void setInitialRegion(const std::optional<Region>& initialRegion) override;
|
|
57
|
+
std::optional<bool> getShowsUserLocation() override;
|
|
58
|
+
void setShowsUserLocation(std::optional<bool> showsUserLocation) override;
|
|
59
|
+
std::optional<bool> getZoomEnabled() override;
|
|
60
|
+
void setZoomEnabled(std::optional<bool> zoomEnabled) override;
|
|
61
|
+
std::optional<bool> getScrollEnabled() override;
|
|
62
|
+
void setScrollEnabled(std::optional<bool> scrollEnabled) override;
|
|
63
|
+
std::optional<bool> getRotateEnabled() override;
|
|
64
|
+
void setRotateEnabled(std::optional<bool> rotateEnabled) override;
|
|
65
|
+
std::optional<bool> getPitchEnabled() override;
|
|
66
|
+
void setPitchEnabled(std::optional<bool> pitchEnabled) override;
|
|
67
|
+
std::optional<MapType> getMapType() override;
|
|
68
|
+
void setMapType(std::optional<MapType> mapType) override;
|
|
69
|
+
std::optional<std::vector<MapStyleElement>> getCustomMapStyle() override;
|
|
70
|
+
void setCustomMapStyle(const std::optional<std::vector<MapStyleElement>>& customMapStyle) override;
|
|
71
|
+
std::optional<bool> getShowsMyLocationButton() override;
|
|
72
|
+
void setShowsMyLocationButton(std::optional<bool> showsMyLocationButton) override;
|
|
73
|
+
std::optional<ClusterConfig> getClusterConfig() override;
|
|
74
|
+
void setClusterConfig(const std::optional<ClusterConfig>& clusterConfig) override;
|
|
75
|
+
std::optional<bool> getDarkMode() override;
|
|
76
|
+
void setDarkMode(std::optional<bool> darkMode) override;
|
|
77
|
+
std::optional<std::function<void(const MapPressEvent& /* event */)>> getOnPress() override;
|
|
78
|
+
void setOnPress(const std::optional<std::function<void(const MapPressEvent& /* event */)>>& onPress) override;
|
|
79
|
+
std::optional<std::function<void(const MapPressEvent& /* event */)>> getOnLongPress() override;
|
|
80
|
+
void setOnLongPress(const std::optional<std::function<void(const MapPressEvent& /* event */)>>& onLongPress) override;
|
|
81
|
+
std::optional<std::function<void()>> getOnMapReady() override;
|
|
82
|
+
void setOnMapReady(const std::optional<std::function<void()>>& onMapReady) override;
|
|
83
|
+
std::optional<std::function<void(const RegionChangeEvent& /* region */)>> getOnRegionChange() override;
|
|
84
|
+
void setOnRegionChange(const std::optional<std::function<void(const RegionChangeEvent& /* region */)>>& onRegionChange) override;
|
|
85
|
+
std::optional<std::function<void(const RegionChangeEvent& /* region */)>> getOnRegionChangeComplete() override;
|
|
86
|
+
void setOnRegionChangeComplete(const std::optional<std::function<void(const RegionChangeEvent& /* region */)>>& onRegionChangeComplete) override;
|
|
87
|
+
std::optional<std::function<void(const MarkerPressEvent& /* event */)>> getOnMarkerPress() override;
|
|
88
|
+
void setOnMarkerPress(const std::optional<std::function<void(const MarkerPressEvent& /* event */)>>& onMarkerPress) override;
|
|
89
|
+
std::optional<std::function<void(const MarkerDragEvent& /* event */)>> getOnMarkerDragStart() override;
|
|
90
|
+
void setOnMarkerDragStart(const std::optional<std::function<void(const MarkerDragEvent& /* event */)>>& onMarkerDragStart) override;
|
|
91
|
+
std::optional<std::function<void(const MarkerDragEvent& /* event */)>> getOnMarkerDrag() override;
|
|
92
|
+
void setOnMarkerDrag(const std::optional<std::function<void(const MarkerDragEvent& /* event */)>>& onMarkerDrag) override;
|
|
93
|
+
std::optional<std::function<void(const MarkerDragEvent& /* event */)>> getOnMarkerDragEnd() override;
|
|
94
|
+
void setOnMarkerDragEnd(const std::optional<std::function<void(const MarkerDragEvent& /* event */)>>& onMarkerDragEnd) override;
|
|
95
|
+
std::optional<std::function<void(const ClusterPressEvent& /* event */)>> getOnClusterPress() override;
|
|
96
|
+
void setOnClusterPress(const std::optional<std::function<void(const ClusterPressEvent& /* event */)>>& onClusterPress) override;
|
|
97
|
+
std::optional<std::function<void(const MapError& /* error */)>> getOnError() override;
|
|
98
|
+
void setOnError(const std::optional<std::function<void(const MapError& /* error */)>>& onError) override;
|
|
99
|
+
|
|
100
|
+
public:
|
|
101
|
+
// Methods
|
|
102
|
+
void animateToRegion(const Region& region, std::optional<double> duration) override;
|
|
103
|
+
void fitToCoordinates(const std::vector<Coordinate>& coordinates, const std::optional<EdgePadding>& edgePadding, std::optional<bool> animated) override;
|
|
104
|
+
void animateCamera(const Camera& camera, std::optional<double> duration) override;
|
|
105
|
+
std::shared_ptr<Promise<Camera>> getCamera() override;
|
|
106
|
+
void setCamera(const Camera& camera) override;
|
|
107
|
+
void setMapStyle(const std::optional<std::vector<MapStyleElement>>& style) override;
|
|
108
|
+
std::shared_ptr<Promise<MapBoundaries>> getMapBoundaries() override;
|
|
109
|
+
void setIsDarkMode(bool enabled) override;
|
|
110
|
+
void addMarker(const MarkerData& marker) override;
|
|
111
|
+
void addMarkers(const std::vector<MarkerData>& markers) override;
|
|
112
|
+
void updateMarker(const MarkerData& marker) override;
|
|
113
|
+
void removeMarker(const std::string& id) override;
|
|
114
|
+
void selectMarker(const std::string& id) override;
|
|
115
|
+
void clearMarkers() override;
|
|
116
|
+
void setClusteringEnabled(bool enabled) override;
|
|
117
|
+
void refreshClusters() override;
|
|
118
|
+
|
|
119
|
+
private:
|
|
120
|
+
friend HybridBase;
|
|
121
|
+
using HybridBase::HybridBase;
|
|
122
|
+
jni::global_ref<JHybridNitroMapSpec::javaobject> _javaPart;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JImageMarkerConfig.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "ImageMarkerConfig.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JColorValue.hpp"
|
|
14
|
+
#include "JMarkerColor.hpp"
|
|
15
|
+
#include "MarkerColor.hpp"
|
|
16
|
+
#include <optional>
|
|
17
|
+
#include <string>
|
|
18
|
+
#include <variant>
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::nitromap {
|
|
21
|
+
|
|
22
|
+
using namespace facebook;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The C++ JNI bridge between the C++ struct "ImageMarkerConfig" and the the Kotlin data class "ImageMarkerConfig".
|
|
26
|
+
*/
|
|
27
|
+
struct JImageMarkerConfig final: public jni::JavaClass<JImageMarkerConfig> {
|
|
28
|
+
public:
|
|
29
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/ImageMarkerConfig;";
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
/**
|
|
33
|
+
* Convert this Java/Kotlin-based struct to the C++ struct ImageMarkerConfig by copying all values to C++.
|
|
34
|
+
*/
|
|
35
|
+
[[maybe_unused]]
|
|
36
|
+
[[nodiscard]]
|
|
37
|
+
ImageMarkerConfig toCpp() const {
|
|
38
|
+
static const auto clazz = javaClassStatic();
|
|
39
|
+
static const auto fieldImageUrl = clazz->getField<jni::JString>("imageUrl");
|
|
40
|
+
jni::local_ref<jni::JString> imageUrl = this->getFieldValue(fieldImageUrl);
|
|
41
|
+
static const auto fieldImageBase64 = clazz->getField<jni::JString>("imageBase64");
|
|
42
|
+
jni::local_ref<jni::JString> imageBase64 = this->getFieldValue(fieldImageBase64);
|
|
43
|
+
static const auto fieldWidth = clazz->getField<double>("width");
|
|
44
|
+
double width = this->getFieldValue(fieldWidth);
|
|
45
|
+
static const auto fieldHeight = clazz->getField<double>("height");
|
|
46
|
+
double height = this->getFieldValue(fieldHeight);
|
|
47
|
+
static const auto fieldCornerRadius = clazz->getField<double>("cornerRadius");
|
|
48
|
+
double cornerRadius = this->getFieldValue(fieldCornerRadius);
|
|
49
|
+
static const auto fieldBorderWidth = clazz->getField<double>("borderWidth");
|
|
50
|
+
double borderWidth = this->getFieldValue(fieldBorderWidth);
|
|
51
|
+
static const auto fieldBorderColor = clazz->getField<JColorValue>("borderColor");
|
|
52
|
+
jni::local_ref<JColorValue> borderColor = this->getFieldValue(fieldBorderColor);
|
|
53
|
+
return ImageMarkerConfig(
|
|
54
|
+
imageUrl != nullptr ? std::make_optional(imageUrl->toStdString()) : std::nullopt,
|
|
55
|
+
imageBase64 != nullptr ? std::make_optional(imageBase64->toStdString()) : std::nullopt,
|
|
56
|
+
width,
|
|
57
|
+
height,
|
|
58
|
+
cornerRadius,
|
|
59
|
+
borderWidth,
|
|
60
|
+
borderColor->toCpp()
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public:
|
|
65
|
+
/**
|
|
66
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
67
|
+
*/
|
|
68
|
+
[[maybe_unused]]
|
|
69
|
+
static jni::local_ref<JImageMarkerConfig::javaobject> fromCpp(const ImageMarkerConfig& value) {
|
|
70
|
+
using JSignature = JImageMarkerConfig(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, double, double, double, double, jni::alias_ref<JColorValue>);
|
|
71
|
+
static const auto clazz = javaClassStatic();
|
|
72
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
73
|
+
return create(
|
|
74
|
+
clazz,
|
|
75
|
+
value.imageUrl.has_value() ? jni::make_jstring(value.imageUrl.value()) : nullptr,
|
|
76
|
+
value.imageBase64.has_value() ? jni::make_jstring(value.imageBase64.value()) : nullptr,
|
|
77
|
+
value.width,
|
|
78
|
+
value.height,
|
|
79
|
+
value.cornerRadius,
|
|
80
|
+
value.borderWidth,
|
|
81
|
+
JColorValue::fromCpp(value.borderColor)
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMapBoundaries.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MapBoundaries.hpp"
|
|
12
|
+
|
|
13
|
+
#include "Coordinate.hpp"
|
|
14
|
+
#include "JCoordinate.hpp"
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::nitromap {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "MapBoundaries" and the the Kotlin data class "MapBoundaries".
|
|
22
|
+
*/
|
|
23
|
+
struct JMapBoundaries final: public jni::JavaClass<JMapBoundaries> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/MapBoundaries;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct MapBoundaries by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
MapBoundaries toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldNorthEast = clazz->getField<JCoordinate>("northEast");
|
|
36
|
+
jni::local_ref<JCoordinate> northEast = this->getFieldValue(fieldNorthEast);
|
|
37
|
+
static const auto fieldSouthWest = clazz->getField<JCoordinate>("southWest");
|
|
38
|
+
jni::local_ref<JCoordinate> southWest = this->getFieldValue(fieldSouthWest);
|
|
39
|
+
return MapBoundaries(
|
|
40
|
+
northEast->toCpp(),
|
|
41
|
+
southWest->toCpp()
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
/**
|
|
47
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
48
|
+
*/
|
|
49
|
+
[[maybe_unused]]
|
|
50
|
+
static jni::local_ref<JMapBoundaries::javaobject> fromCpp(const MapBoundaries& value) {
|
|
51
|
+
using JSignature = JMapBoundaries(jni::alias_ref<JCoordinate>, jni::alias_ref<JCoordinate>);
|
|
52
|
+
static const auto clazz = javaClassStatic();
|
|
53
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
54
|
+
return create(
|
|
55
|
+
clazz,
|
|
56
|
+
JCoordinate::fromCpp(value.northEast),
|
|
57
|
+
JCoordinate::fromCpp(value.southWest)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMapError.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MapError.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::nitromap {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "MapError" and the the Kotlin data class "MapError".
|
|
21
|
+
*/
|
|
22
|
+
struct JMapError final: public jni::JavaClass<JMapError> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/MapError;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct MapError by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
MapError toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldCode = clazz->getField<jni::JString>("code");
|
|
35
|
+
jni::local_ref<jni::JString> code = this->getFieldValue(fieldCode);
|
|
36
|
+
static const auto fieldMessage = clazz->getField<jni::JString>("message");
|
|
37
|
+
jni::local_ref<jni::JString> message = this->getFieldValue(fieldMessage);
|
|
38
|
+
return MapError(
|
|
39
|
+
code->toStdString(),
|
|
40
|
+
message->toStdString()
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
/**
|
|
46
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
47
|
+
*/
|
|
48
|
+
[[maybe_unused]]
|
|
49
|
+
static jni::local_ref<JMapError::javaobject> fromCpp(const MapError& value) {
|
|
50
|
+
using JSignature = JMapError(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
51
|
+
static const auto clazz = javaClassStatic();
|
|
52
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
53
|
+
return create(
|
|
54
|
+
clazz,
|
|
55
|
+
jni::make_jstring(value.code),
|
|
56
|
+
jni::make_jstring(value.message)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMapPressEvent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MapPressEvent.hpp"
|
|
12
|
+
|
|
13
|
+
#include "Coordinate.hpp"
|
|
14
|
+
#include "JCoordinate.hpp"
|
|
15
|
+
#include "JPoint.hpp"
|
|
16
|
+
#include "Point.hpp"
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::nitromap {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The C++ JNI bridge between the C++ struct "MapPressEvent" and the the Kotlin data class "MapPressEvent".
|
|
24
|
+
*/
|
|
25
|
+
struct JMapPressEvent final: public jni::JavaClass<JMapPressEvent> {
|
|
26
|
+
public:
|
|
27
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/MapPressEvent;";
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
/**
|
|
31
|
+
* Convert this Java/Kotlin-based struct to the C++ struct MapPressEvent by copying all values to C++.
|
|
32
|
+
*/
|
|
33
|
+
[[maybe_unused]]
|
|
34
|
+
[[nodiscard]]
|
|
35
|
+
MapPressEvent toCpp() const {
|
|
36
|
+
static const auto clazz = javaClassStatic();
|
|
37
|
+
static const auto fieldCoordinate = clazz->getField<JCoordinate>("coordinate");
|
|
38
|
+
jni::local_ref<JCoordinate> coordinate = this->getFieldValue(fieldCoordinate);
|
|
39
|
+
static const auto fieldPosition = clazz->getField<JPoint>("position");
|
|
40
|
+
jni::local_ref<JPoint> position = this->getFieldValue(fieldPosition);
|
|
41
|
+
return MapPressEvent(
|
|
42
|
+
coordinate->toCpp(),
|
|
43
|
+
position->toCpp()
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
/**
|
|
49
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
50
|
+
*/
|
|
51
|
+
[[maybe_unused]]
|
|
52
|
+
static jni::local_ref<JMapPressEvent::javaobject> fromCpp(const MapPressEvent& value) {
|
|
53
|
+
using JSignature = JMapPressEvent(jni::alias_ref<JCoordinate>, jni::alias_ref<JPoint>);
|
|
54
|
+
static const auto clazz = javaClassStatic();
|
|
55
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
56
|
+
return create(
|
|
57
|
+
clazz,
|
|
58
|
+
JCoordinate::fromCpp(value.coordinate),
|
|
59
|
+
JPoint::fromCpp(value.position)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMapProvider.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MapProvider.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitromap {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "MapProvider" and the the Kotlin enum "MapProvider".
|
|
19
|
+
*/
|
|
20
|
+
struct JMapProvider final: public jni::JavaClass<JMapProvider> {
|
|
21
|
+
public:
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/MapProvider;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum MapProvider.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
MapProvider toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<MapProvider>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JMapProvider> fromCpp(MapProvider value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
static const auto fieldGOOGLE = clazz->getStaticField<JMapProvider>("GOOGLE");
|
|
45
|
+
static const auto fieldAPPLE = clazz->getStaticField<JMapProvider>("APPLE");
|
|
46
|
+
static const auto fieldYANDEX = clazz->getStaticField<JMapProvider>("YANDEX");
|
|
47
|
+
|
|
48
|
+
switch (value) {
|
|
49
|
+
case MapProvider::GOOGLE:
|
|
50
|
+
return clazz->getStaticFieldValue(fieldGOOGLE);
|
|
51
|
+
case MapProvider::APPLE:
|
|
52
|
+
return clazz->getStaticFieldValue(fieldAPPLE);
|
|
53
|
+
case MapProvider::YANDEX:
|
|
54
|
+
return clazz->getStaticFieldValue(fieldYANDEX);
|
|
55
|
+
default:
|
|
56
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
57
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMapStyleElement.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MapStyleElement.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JMapStyler.hpp"
|
|
14
|
+
#include "MapStyler.hpp"
|
|
15
|
+
#include <optional>
|
|
16
|
+
#include <string>
|
|
17
|
+
#include <vector>
|
|
18
|
+
|
|
19
|
+
namespace margelo::nitro::nitromap {
|
|
20
|
+
|
|
21
|
+
using namespace facebook;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The C++ JNI bridge between the C++ struct "MapStyleElement" and the the Kotlin data class "MapStyleElement".
|
|
25
|
+
*/
|
|
26
|
+
struct JMapStyleElement final: public jni::JavaClass<JMapStyleElement> {
|
|
27
|
+
public:
|
|
28
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/MapStyleElement;";
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
/**
|
|
32
|
+
* Convert this Java/Kotlin-based struct to the C++ struct MapStyleElement by copying all values to C++.
|
|
33
|
+
*/
|
|
34
|
+
[[maybe_unused]]
|
|
35
|
+
[[nodiscard]]
|
|
36
|
+
MapStyleElement toCpp() const {
|
|
37
|
+
static const auto clazz = javaClassStatic();
|
|
38
|
+
static const auto fieldFeatureType = clazz->getField<jni::JString>("featureType");
|
|
39
|
+
jni::local_ref<jni::JString> featureType = this->getFieldValue(fieldFeatureType);
|
|
40
|
+
static const auto fieldElementType = clazz->getField<jni::JString>("elementType");
|
|
41
|
+
jni::local_ref<jni::JString> elementType = this->getFieldValue(fieldElementType);
|
|
42
|
+
static const auto fieldStylers = clazz->getField<jni::JArrayClass<JMapStyler>>("stylers");
|
|
43
|
+
jni::local_ref<jni::JArrayClass<JMapStyler>> stylers = this->getFieldValue(fieldStylers);
|
|
44
|
+
return MapStyleElement(
|
|
45
|
+
featureType != nullptr ? std::make_optional(featureType->toStdString()) : std::nullopt,
|
|
46
|
+
elementType != nullptr ? std::make_optional(elementType->toStdString()) : std::nullopt,
|
|
47
|
+
[&]() {
|
|
48
|
+
size_t __size = stylers->size();
|
|
49
|
+
std::vector<MapStyler> __vector;
|
|
50
|
+
__vector.reserve(__size);
|
|
51
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
52
|
+
auto __element = stylers->getElement(__i);
|
|
53
|
+
__vector.push_back(__element->toCpp());
|
|
54
|
+
}
|
|
55
|
+
return __vector;
|
|
56
|
+
}()
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
/**
|
|
62
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
63
|
+
*/
|
|
64
|
+
[[maybe_unused]]
|
|
65
|
+
static jni::local_ref<JMapStyleElement::javaobject> fromCpp(const MapStyleElement& value) {
|
|
66
|
+
using JSignature = JMapStyleElement(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JArrayClass<JMapStyler>>);
|
|
67
|
+
static const auto clazz = javaClassStatic();
|
|
68
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
69
|
+
return create(
|
|
70
|
+
clazz,
|
|
71
|
+
value.featureType.has_value() ? jni::make_jstring(value.featureType.value()) : nullptr,
|
|
72
|
+
value.elementType.has_value() ? jni::make_jstring(value.elementType.value()) : nullptr,
|
|
73
|
+
[&]() {
|
|
74
|
+
size_t __size = value.stylers.size();
|
|
75
|
+
jni::local_ref<jni::JArrayClass<JMapStyler>> __array = jni::JArrayClass<JMapStyler>::newArray(__size);
|
|
76
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
77
|
+
const auto& __element = value.stylers[__i];
|
|
78
|
+
auto __elementJni = JMapStyler::fromCpp(__element);
|
|
79
|
+
__array->setElement(__i, *__elementJni);
|
|
80
|
+
}
|
|
81
|
+
return __array;
|
|
82
|
+
}()
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JMapStyler.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "MapStyler.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::nitromap {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "MapStyler" and the the Kotlin data class "MapStyler".
|
|
22
|
+
*/
|
|
23
|
+
struct JMapStyler final: public jni::JavaClass<JMapStyler> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/MapStyler;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct MapStyler by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
MapStyler toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldColor = clazz->getField<jni::JString>("color");
|
|
36
|
+
jni::local_ref<jni::JString> color = this->getFieldValue(fieldColor);
|
|
37
|
+
static const auto fieldVisibility = clazz->getField<jni::JString>("visibility");
|
|
38
|
+
jni::local_ref<jni::JString> visibility = this->getFieldValue(fieldVisibility);
|
|
39
|
+
static const auto fieldWeight = clazz->getField<jni::JDouble>("weight");
|
|
40
|
+
jni::local_ref<jni::JDouble> weight = this->getFieldValue(fieldWeight);
|
|
41
|
+
static const auto fieldSaturation = clazz->getField<jni::JDouble>("saturation");
|
|
42
|
+
jni::local_ref<jni::JDouble> saturation = this->getFieldValue(fieldSaturation);
|
|
43
|
+
static const auto fieldLightness = clazz->getField<jni::JDouble>("lightness");
|
|
44
|
+
jni::local_ref<jni::JDouble> lightness = this->getFieldValue(fieldLightness);
|
|
45
|
+
static const auto fieldGamma = clazz->getField<jni::JDouble>("gamma");
|
|
46
|
+
jni::local_ref<jni::JDouble> gamma = this->getFieldValue(fieldGamma);
|
|
47
|
+
return MapStyler(
|
|
48
|
+
color != nullptr ? std::make_optional(color->toStdString()) : std::nullopt,
|
|
49
|
+
visibility != nullptr ? std::make_optional(visibility->toStdString()) : std::nullopt,
|
|
50
|
+
weight != nullptr ? std::make_optional(weight->value()) : std::nullopt,
|
|
51
|
+
saturation != nullptr ? std::make_optional(saturation->value()) : std::nullopt,
|
|
52
|
+
lightness != nullptr ? std::make_optional(lightness->value()) : std::nullopt,
|
|
53
|
+
gamma != nullptr ? std::make_optional(gamma->value()) : std::nullopt
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
/**
|
|
59
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
60
|
+
*/
|
|
61
|
+
[[maybe_unused]]
|
|
62
|
+
static jni::local_ref<JMapStyler::javaobject> fromCpp(const MapStyler& value) {
|
|
63
|
+
using JSignature = JMapStyler(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>);
|
|
64
|
+
static const auto clazz = javaClassStatic();
|
|
65
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
66
|
+
return create(
|
|
67
|
+
clazz,
|
|
68
|
+
value.color.has_value() ? jni::make_jstring(value.color.value()) : nullptr,
|
|
69
|
+
value.visibility.has_value() ? jni::make_jstring(value.visibility.value()) : nullptr,
|
|
70
|
+
value.weight.has_value() ? jni::JDouble::valueOf(value.weight.value()) : nullptr,
|
|
71
|
+
value.saturation.has_value() ? jni::JDouble::valueOf(value.saturation.value()) : nullptr,
|
|
72
|
+
value.lightness.has_value() ? jni::JDouble::valueOf(value.lightness.value()) : nullptr,
|
|
73
|
+
value.gamma.has_value() ? jni::JDouble::valueOf(value.gamma.value()) : nullptr
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
} // namespace margelo::nitro::nitromap
|