@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,248 @@
|
|
|
1
|
+
import type { Coordinate, Point } from './map';
|
|
2
|
+
import type { ColorValue } from '../utils/colors';
|
|
3
|
+
/**
|
|
4
|
+
* Visual style of the marker
|
|
5
|
+
* - `'default'` - Standard Google Maps marker
|
|
6
|
+
* - `'price'` - Simple price tag
|
|
7
|
+
* - `'image'` - Custom image marker
|
|
8
|
+
* - `'priceMarker'` - Full-featured price marker with currency
|
|
9
|
+
* - `'reactView'` - React Native view marker (internal use by NitroCustomMarker)
|
|
10
|
+
*
|
|
11
|
+
* Note: For React Native views as markers, use the NitroCustomMarker component.
|
|
12
|
+
*/
|
|
13
|
+
export type MarkerStyle = 'default' | 'image' | 'priceMarker';
|
|
14
|
+
/**
|
|
15
|
+
* Animation type for individual markers when they appear
|
|
16
|
+
* - `'none'` - No animation
|
|
17
|
+
* - `'pop'` - Pop/bounce effect
|
|
18
|
+
* - `'fadeIn'` - Fade in animation
|
|
19
|
+
*/
|
|
20
|
+
export type MarkerAnimation = 'none' | 'pop' | 'fadeIn';
|
|
21
|
+
/**
|
|
22
|
+
* Animation style for cluster expand/collapse
|
|
23
|
+
* - `'default'` - Standard Google Maps Utils animation
|
|
24
|
+
* - `'bounce'` - Markers bounce when appearing
|
|
25
|
+
* - `'scale'` - Scale up from 0 to full size
|
|
26
|
+
* - `'fade'` - Fade in/out
|
|
27
|
+
* - `'spring'` - Spring effect animation
|
|
28
|
+
*/
|
|
29
|
+
export type ClusterAnimationStyle = 'default' | 'bounce' | 'scale' | 'fade' | 'spring';
|
|
30
|
+
/**
|
|
31
|
+
* Style configuration for price markers
|
|
32
|
+
* Colors can be hex strings ("#FF0000", "#F00") or MarkerColor objects
|
|
33
|
+
*/
|
|
34
|
+
export type PriceMarkerStyle = {
|
|
35
|
+
/** Price text to display (e.g., "9M", "150K") */
|
|
36
|
+
price: string;
|
|
37
|
+
/** Currency code (e.g., "UZS", "USD", "EUR") */
|
|
38
|
+
currency: string;
|
|
39
|
+
/** Whether the marker is in selected state (changes colors) */
|
|
40
|
+
selected: boolean;
|
|
41
|
+
/** Background color in normal state (hex string or MarkerColor) */
|
|
42
|
+
backgroundColor?: ColorValue;
|
|
43
|
+
/** Background color when selected (hex string or MarkerColor) */
|
|
44
|
+
selectedBackgroundColor?: ColorValue;
|
|
45
|
+
/** Text color in normal state (hex string or MarkerColor) */
|
|
46
|
+
textColor?: ColorValue;
|
|
47
|
+
/** Text color when selected (hex string or MarkerColor) */
|
|
48
|
+
selectedTextColor?: ColorValue;
|
|
49
|
+
/** Font size in pixels */
|
|
50
|
+
fontSize?: number;
|
|
51
|
+
/** Horizontal padding in pixels */
|
|
52
|
+
paddingHorizontal?: number;
|
|
53
|
+
/** Vertical padding in pixels */
|
|
54
|
+
paddingVertical?: number;
|
|
55
|
+
/** Shadow opacity (0-1) */
|
|
56
|
+
shadowOpacity?: number;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* RGBA color representation
|
|
60
|
+
* All values range from 0-255
|
|
61
|
+
*/
|
|
62
|
+
export type MarkerColor = {
|
|
63
|
+
/** Red component (0-255) */
|
|
64
|
+
r: number;
|
|
65
|
+
/** Green component (0-255) */
|
|
66
|
+
g: number;
|
|
67
|
+
/** Blue component (0-255) */
|
|
68
|
+
b: number;
|
|
69
|
+
/** Alpha/opacity component (0-255) */
|
|
70
|
+
a: number;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Configuration for price-style markers
|
|
74
|
+
*/
|
|
75
|
+
export type PriceMarkerConfig = {
|
|
76
|
+
/** Price text to display */
|
|
77
|
+
price: string;
|
|
78
|
+
/** Background color */
|
|
79
|
+
backgroundColor: MarkerColor;
|
|
80
|
+
/** Text color */
|
|
81
|
+
textColor: MarkerColor;
|
|
82
|
+
/** Font size in pixels */
|
|
83
|
+
fontSize: number;
|
|
84
|
+
/** Corner radius in pixels */
|
|
85
|
+
cornerRadius: number;
|
|
86
|
+
/** Whether marker is in selected state */
|
|
87
|
+
selected: boolean;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Configuration for image-style markers
|
|
91
|
+
* Colors can be hex strings ("#FF0000", "#F00") or MarkerColor objects
|
|
92
|
+
*/
|
|
93
|
+
export type ImageMarkerConfig = {
|
|
94
|
+
/** URL of the image to display */
|
|
95
|
+
imageUrl?: string;
|
|
96
|
+
/** Base64-encoded image data (alternative to URL) */
|
|
97
|
+
imageBase64?: string;
|
|
98
|
+
/** Image width in pixels */
|
|
99
|
+
width: number;
|
|
100
|
+
/** Image height in pixels */
|
|
101
|
+
height: number;
|
|
102
|
+
/** Corner radius in pixels */
|
|
103
|
+
cornerRadius: number;
|
|
104
|
+
/** Border thickness in pixels */
|
|
105
|
+
borderWidth: number;
|
|
106
|
+
/** Border color (hex string or MarkerColor) */
|
|
107
|
+
borderColor: ColorValue;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Combined marker configuration based on style type
|
|
111
|
+
*/
|
|
112
|
+
export type MarkerConfig = {
|
|
113
|
+
/** The marker style type */
|
|
114
|
+
style: MarkerStyle;
|
|
115
|
+
/** Image marker config (when style is 'image') */
|
|
116
|
+
image?: ImageMarkerConfig;
|
|
117
|
+
/** Price marker style config (when style is 'priceMarker') */
|
|
118
|
+
priceMarker?: PriceMarkerStyle;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Complete marker data structure used internally
|
|
122
|
+
*/
|
|
123
|
+
export type MarkerData = {
|
|
124
|
+
/** Unique identifier for the marker */
|
|
125
|
+
id: string;
|
|
126
|
+
/** Geographic coordinates of the marker */
|
|
127
|
+
coordinate: Coordinate;
|
|
128
|
+
/** Title shown in info window */
|
|
129
|
+
title?: string;
|
|
130
|
+
/** Description shown in info window */
|
|
131
|
+
description?: string;
|
|
132
|
+
/** Whether the marker can be dragged */
|
|
133
|
+
draggable: boolean;
|
|
134
|
+
/** Marker opacity (0-1) */
|
|
135
|
+
opacity: number;
|
|
136
|
+
/** Rotation in degrees */
|
|
137
|
+
rotation: number;
|
|
138
|
+
/** Z-index for overlapping markers */
|
|
139
|
+
zIndex: number;
|
|
140
|
+
/** Anchor point for positioning (0-1 range) */
|
|
141
|
+
anchor: Point;
|
|
142
|
+
/** Visual configuration for the marker */
|
|
143
|
+
config: MarkerConfig;
|
|
144
|
+
/** Whether this marker should be included in clustering */
|
|
145
|
+
clusteringEnabled: boolean;
|
|
146
|
+
/** Animation when marker appears */
|
|
147
|
+
animation: MarkerAnimation;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Event data when a marker is pressed
|
|
151
|
+
*/
|
|
152
|
+
export type MarkerPressEvent = {
|
|
153
|
+
/** ID of the pressed marker */
|
|
154
|
+
id: string;
|
|
155
|
+
/** Coordinates where marker was pressed */
|
|
156
|
+
coordinate: Coordinate;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Event data during marker drag operations
|
|
160
|
+
*/
|
|
161
|
+
export type MarkerDragEvent = {
|
|
162
|
+
/** ID of the dragged marker */
|
|
163
|
+
id: string;
|
|
164
|
+
/** Current coordinates during drag */
|
|
165
|
+
coordinate: Coordinate;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Event data when a cluster is pressed
|
|
169
|
+
*/
|
|
170
|
+
export type ClusterPressEvent = {
|
|
171
|
+
/** Coordinates of the cluster */
|
|
172
|
+
coordinate: Coordinate;
|
|
173
|
+
/** IDs of all markers in the cluster */
|
|
174
|
+
markerIds: string[];
|
|
175
|
+
/** Number of markers in the cluster */
|
|
176
|
+
count: number;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Clustering strategy
|
|
180
|
+
* - `'supercluster'` - Pure geographic clustering. Overlapping icons are tolerated.
|
|
181
|
+
* This is what Mapbox and most map libraries use. User zooms in to resolve overlaps.
|
|
182
|
+
* - `'hideOnOverlap'` - After geographic clustering, overlapping icons are hidden
|
|
183
|
+
* (not merged). Every visible marker sits at its real geographic position.
|
|
184
|
+
* This is what Zillow/Airbnb use for property maps.
|
|
185
|
+
*/
|
|
186
|
+
export type ClusterStrategy = 'supercluster' | 'hideOnOverlap';
|
|
187
|
+
/**
|
|
188
|
+
* Configuration for marker clustering behavior
|
|
189
|
+
* Colors can be hex strings ("#FF0000", "#F00") or MarkerColor objects
|
|
190
|
+
*/
|
|
191
|
+
export type ClusterConfig = {
|
|
192
|
+
/** Enable or disable clustering */
|
|
193
|
+
enabled: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Clustering strategy
|
|
196
|
+
* - `'supercluster'` — overlaps tolerated, user zooms to resolve
|
|
197
|
+
* - `'hideOnOverlap'` — lower-priority overlapping icons hidden
|
|
198
|
+
* @default 'supercluster'
|
|
199
|
+
*/
|
|
200
|
+
strategy: ClusterStrategy;
|
|
201
|
+
/**
|
|
202
|
+
* Clustering radius in pixels.
|
|
203
|
+
* Controls how aggressively markers group together.
|
|
204
|
+
* Higher = fewer, larger clusters. Lower = more, smaller clusters.
|
|
205
|
+
* @default 80
|
|
206
|
+
*/
|
|
207
|
+
radius: number;
|
|
208
|
+
/** Minimum number of markers to form a cluster */
|
|
209
|
+
minimumClusterSize: number;
|
|
210
|
+
/** Maximum zoom level at which clustering occurs */
|
|
211
|
+
maxZoom: number;
|
|
212
|
+
/** Background color of cluster circles (hex string or MarkerColor) */
|
|
213
|
+
backgroundColor: ColorValue;
|
|
214
|
+
/** Text color for cluster count numbers (hex string or MarkerColor) */
|
|
215
|
+
textColor: ColorValue;
|
|
216
|
+
/** Border thickness in pixels */
|
|
217
|
+
borderWidth: number;
|
|
218
|
+
/** Border color of cluster circles (hex string or MarkerColor) */
|
|
219
|
+
borderColor: ColorValue;
|
|
220
|
+
/** Enable cluster animations */
|
|
221
|
+
animatesClusters: boolean;
|
|
222
|
+
/** Animation duration in seconds (e.g., 0.3) */
|
|
223
|
+
animationDuration: number;
|
|
224
|
+
/** Animation style for cluster expand/collapse */
|
|
225
|
+
animationStyle: ClusterAnimationStyle;
|
|
226
|
+
/**
|
|
227
|
+
* When true, clusters update live during pan/zoom gestures (throttled).
|
|
228
|
+
* When false, clusters only update after the gesture ends (debounced).
|
|
229
|
+
* Live mode provides smoother UX but uses more CPU.
|
|
230
|
+
* @default false
|
|
231
|
+
*/
|
|
232
|
+
realtimeClustering: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Extra buffer around the visible viewport for pre-computing clusters.
|
|
235
|
+
* Expressed as a fraction of the viewport size (0 = no buffer, 0.5 = 50% extra on each side).
|
|
236
|
+
* Prevents markers from "popping in" at edges during pan.
|
|
237
|
+
* @default 0
|
|
238
|
+
*/
|
|
239
|
+
renderBuffer: number;
|
|
240
|
+
/**
|
|
241
|
+
* Throttle interval in milliseconds for live clustering during gestures.
|
|
242
|
+
* Only used when `realtimeClustering` is true.
|
|
243
|
+
* Higher = better performance, lower = smoother updates.
|
|
244
|
+
* @default 150
|
|
245
|
+
*/
|
|
246
|
+
throttleInterval: number;
|
|
247
|
+
};
|
|
248
|
+
//# sourceMappingURL=marker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../../../src/types/marker.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { MarkerColor } from '../types/marker';
|
|
2
|
+
/**
|
|
3
|
+
* Color value that can be either a MarkerColor object or a hex string
|
|
4
|
+
* Hex strings can be in formats: "#RRGGBB", "RRGGBB", "#RGB", or "RGB"
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* const color1: ColorValue = "#FF0000"; // Hex string
|
|
8
|
+
* const color2: ColorValue = "#F00"; // Short hex
|
|
9
|
+
* const color3: ColorValue = { r: 255, g: 0, b: 0, a: 255 }; // MarkerColor
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export type ColorValue = MarkerColor | string;
|
|
13
|
+
/**
|
|
14
|
+
* Parse a ColorValue into a MarkerColor object
|
|
15
|
+
* Handles both hex strings and MarkerColor objects
|
|
16
|
+
* @param color - Color value (hex string or MarkerColor)
|
|
17
|
+
* @param defaultAlpha - Default alpha value (0-255) for hex strings
|
|
18
|
+
* @returns MarkerColor object
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare const parseColor: (color: ColorValue | undefined, defaultAlpha?: number) => MarkerColor | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Parse a ColorValue with a fallback default color
|
|
24
|
+
* @param color - Color value (hex string or MarkerColor)
|
|
25
|
+
* @param fallback - Fallback MarkerColor if parsing fails
|
|
26
|
+
* @returns MarkerColor object
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare const parseColorWithFallback: (color: ColorValue | undefined, fallback: MarkerColor) => MarkerColor;
|
|
30
|
+
/**
|
|
31
|
+
* Create a MarkerColor from RGB values
|
|
32
|
+
* @param r - Red component (0-255)
|
|
33
|
+
* @param g - Green component (0-255)
|
|
34
|
+
* @param b - Blue component (0-255)
|
|
35
|
+
* @param a - Alpha/opacity (0-255, default: 255)
|
|
36
|
+
* @returns MarkerColor object
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const customRed = rgb(255, 0, 0);
|
|
40
|
+
* const semiTransparent = rgb(0, 0, 255, 128);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const rgb: (r: number, g: number, b: number, a?: number) => MarkerColor;
|
|
44
|
+
/**
|
|
45
|
+
* Create a MarkerColor from a hex string
|
|
46
|
+
* @param hexStr - Hex color string (e.g., "#FF0000", "FF0000", "#F00", or "F00")
|
|
47
|
+
* @param alpha - Alpha/opacity (0-255, default: 255)
|
|
48
|
+
* @returns MarkerColor object
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const red = hex("#FF0000");
|
|
52
|
+
* const shortRed = hex("#F00");
|
|
53
|
+
* const semiTransparentBlue = hex("#0000FF", 128);
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare const hex: (hexStr: string, alpha?: number) => MarkerColor;
|
|
57
|
+
/**
|
|
58
|
+
* Preset colors for convenience
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* <NitroMarker backgroundColor={Colors.red} />
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare const Colors: {
|
|
65
|
+
/** White (255, 255, 255) */
|
|
66
|
+
white: MarkerColor;
|
|
67
|
+
/** Black (0, 0, 0) */
|
|
68
|
+
black: MarkerColor;
|
|
69
|
+
/** iOS system red (255, 59, 48) */
|
|
70
|
+
red: MarkerColor;
|
|
71
|
+
/** iOS system blue (0, 122, 255) */
|
|
72
|
+
blue: MarkerColor;
|
|
73
|
+
/** Material green (76, 175, 80) */
|
|
74
|
+
green: MarkerColor;
|
|
75
|
+
/** iOS system orange (255, 149, 0) */
|
|
76
|
+
orange: MarkerColor;
|
|
77
|
+
/** Dark gray (51, 51, 51) */
|
|
78
|
+
gray: MarkerColor;
|
|
79
|
+
/** Light gray (240, 240, 240) */
|
|
80
|
+
lightGray: MarkerColor;
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../src/utils/colors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,MAAM,CAAC;AAE9C;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,UAAU,GAAG,SAAS,EAC7B,eAAc,MAAY,KACzB,WAAW,GAAG,SA0BhB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,UAAU,GAAG,SAAS,EAC7B,UAAU,WAAW,KACpB,WAGF,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,GAAG,GACd,GAAG,MAAM,EACT,GAAG,MAAM,EACT,GAAG,MAAM,EACT,IAAG,MAAY,KACd,WAKD,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,GAAG,GAAI,QAAQ,MAAM,EAAE,QAAO,MAAY,KAAG,WAyBzD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;IACjB,4BAA4B;;IAE5B,sBAAsB;;IAEtB,mCAAmC;;IAEnC,oCAAoC;;IAEpC,mCAAmC;;IAEnC,sCAAsC;;IAEtC,6BAA6B;;IAE7B,iCAAiC;;CAElC,CAAC"}
|
package/nitro.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cxxNamespace": ["nitromap"],
|
|
3
|
+
"ios": {
|
|
4
|
+
"iosModuleName": "NitroMap"
|
|
5
|
+
},
|
|
6
|
+
"android": {
|
|
7
|
+
"androidNamespace": ["nitromap"],
|
|
8
|
+
"androidCxxLibName": "nitromap"
|
|
9
|
+
},
|
|
10
|
+
"autolinking": {
|
|
11
|
+
"NitroMap": {
|
|
12
|
+
"swift": "HybridNitroMap",
|
|
13
|
+
"kotlin": "HybridNitroMap"
|
|
14
|
+
},
|
|
15
|
+
"NitroMapConfig": {
|
|
16
|
+
"swift": "HybridNitroMapConfig",
|
|
17
|
+
"kotlin": "HybridNitroMapConfig"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"ignorePaths": ["node_modules"]
|
|
21
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCamera.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 "Camera.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 "Camera" and the the Kotlin data class "Camera".
|
|
22
|
+
*/
|
|
23
|
+
struct JCamera final: public jni::JavaClass<JCamera> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/Camera;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct Camera by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
Camera toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldCenter = clazz->getField<JCoordinate>("center");
|
|
36
|
+
jni::local_ref<JCoordinate> center = this->getFieldValue(fieldCenter);
|
|
37
|
+
static const auto fieldPitch = clazz->getField<double>("pitch");
|
|
38
|
+
double pitch = this->getFieldValue(fieldPitch);
|
|
39
|
+
static const auto fieldHeading = clazz->getField<double>("heading");
|
|
40
|
+
double heading = this->getFieldValue(fieldHeading);
|
|
41
|
+
static const auto fieldAltitude = clazz->getField<double>("altitude");
|
|
42
|
+
double altitude = this->getFieldValue(fieldAltitude);
|
|
43
|
+
static const auto fieldZoom = clazz->getField<double>("zoom");
|
|
44
|
+
double zoom = this->getFieldValue(fieldZoom);
|
|
45
|
+
return Camera(
|
|
46
|
+
center->toCpp(),
|
|
47
|
+
pitch,
|
|
48
|
+
heading,
|
|
49
|
+
altitude,
|
|
50
|
+
zoom
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
/**
|
|
56
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
57
|
+
*/
|
|
58
|
+
[[maybe_unused]]
|
|
59
|
+
static jni::local_ref<JCamera::javaobject> fromCpp(const Camera& value) {
|
|
60
|
+
using JSignature = JCamera(jni::alias_ref<JCoordinate>, double, double, double, double);
|
|
61
|
+
static const auto clazz = javaClassStatic();
|
|
62
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
63
|
+
return create(
|
|
64
|
+
clazz,
|
|
65
|
+
JCoordinate::fromCpp(value.center),
|
|
66
|
+
value.pitch,
|
|
67
|
+
value.heading,
|
|
68
|
+
value.altitude,
|
|
69
|
+
value.zoom
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JClusterAnimationStyle.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 "ClusterAnimationStyle.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitromap {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "ClusterAnimationStyle" and the the Kotlin enum "ClusterAnimationStyle".
|
|
19
|
+
*/
|
|
20
|
+
struct JClusterAnimationStyle final: public jni::JavaClass<JClusterAnimationStyle> {
|
|
21
|
+
public:
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/ClusterAnimationStyle;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum ClusterAnimationStyle.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
ClusterAnimationStyle 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<ClusterAnimationStyle>(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<JClusterAnimationStyle> fromCpp(ClusterAnimationStyle value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
static const auto fieldDEFAULT = clazz->getStaticField<JClusterAnimationStyle>("DEFAULT");
|
|
45
|
+
static const auto fieldBOUNCE = clazz->getStaticField<JClusterAnimationStyle>("BOUNCE");
|
|
46
|
+
static const auto fieldSCALE = clazz->getStaticField<JClusterAnimationStyle>("SCALE");
|
|
47
|
+
static const auto fieldFADE = clazz->getStaticField<JClusterAnimationStyle>("FADE");
|
|
48
|
+
static const auto fieldSPRING = clazz->getStaticField<JClusterAnimationStyle>("SPRING");
|
|
49
|
+
|
|
50
|
+
switch (value) {
|
|
51
|
+
case ClusterAnimationStyle::DEFAULT:
|
|
52
|
+
return clazz->getStaticFieldValue(fieldDEFAULT);
|
|
53
|
+
case ClusterAnimationStyle::BOUNCE:
|
|
54
|
+
return clazz->getStaticFieldValue(fieldBOUNCE);
|
|
55
|
+
case ClusterAnimationStyle::SCALE:
|
|
56
|
+
return clazz->getStaticFieldValue(fieldSCALE);
|
|
57
|
+
case ClusterAnimationStyle::FADE:
|
|
58
|
+
return clazz->getStaticFieldValue(fieldFADE);
|
|
59
|
+
case ClusterAnimationStyle::SPRING:
|
|
60
|
+
return clazz->getStaticFieldValue(fieldSPRING);
|
|
61
|
+
default:
|
|
62
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
63
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JClusterConfig.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 "ClusterConfig.hpp"
|
|
12
|
+
|
|
13
|
+
#include "ClusterAnimationStyle.hpp"
|
|
14
|
+
#include "ClusterStrategy.hpp"
|
|
15
|
+
#include "JClusterAnimationStyle.hpp"
|
|
16
|
+
#include "JClusterStrategy.hpp"
|
|
17
|
+
#include "JColorValue.hpp"
|
|
18
|
+
#include "JMarkerColor.hpp"
|
|
19
|
+
#include "MarkerColor.hpp"
|
|
20
|
+
#include <string>
|
|
21
|
+
#include <variant>
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::nitromap {
|
|
24
|
+
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The C++ JNI bridge between the C++ struct "ClusterConfig" and the the Kotlin data class "ClusterConfig".
|
|
29
|
+
*/
|
|
30
|
+
struct JClusterConfig final: public jni::JavaClass<JClusterConfig> {
|
|
31
|
+
public:
|
|
32
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/ClusterConfig;";
|
|
33
|
+
|
|
34
|
+
public:
|
|
35
|
+
/**
|
|
36
|
+
* Convert this Java/Kotlin-based struct to the C++ struct ClusterConfig by copying all values to C++.
|
|
37
|
+
*/
|
|
38
|
+
[[maybe_unused]]
|
|
39
|
+
[[nodiscard]]
|
|
40
|
+
ClusterConfig toCpp() const {
|
|
41
|
+
static const auto clazz = javaClassStatic();
|
|
42
|
+
static const auto fieldEnabled = clazz->getField<jboolean>("enabled");
|
|
43
|
+
jboolean enabled = this->getFieldValue(fieldEnabled);
|
|
44
|
+
static const auto fieldStrategy = clazz->getField<JClusterStrategy>("strategy");
|
|
45
|
+
jni::local_ref<JClusterStrategy> strategy = this->getFieldValue(fieldStrategy);
|
|
46
|
+
static const auto fieldRadius = clazz->getField<double>("radius");
|
|
47
|
+
double radius = this->getFieldValue(fieldRadius);
|
|
48
|
+
static const auto fieldMinimumClusterSize = clazz->getField<double>("minimumClusterSize");
|
|
49
|
+
double minimumClusterSize = this->getFieldValue(fieldMinimumClusterSize);
|
|
50
|
+
static const auto fieldMaxZoom = clazz->getField<double>("maxZoom");
|
|
51
|
+
double maxZoom = this->getFieldValue(fieldMaxZoom);
|
|
52
|
+
static const auto fieldBackgroundColor = clazz->getField<JColorValue>("backgroundColor");
|
|
53
|
+
jni::local_ref<JColorValue> backgroundColor = this->getFieldValue(fieldBackgroundColor);
|
|
54
|
+
static const auto fieldTextColor = clazz->getField<JColorValue>("textColor");
|
|
55
|
+
jni::local_ref<JColorValue> textColor = this->getFieldValue(fieldTextColor);
|
|
56
|
+
static const auto fieldBorderWidth = clazz->getField<double>("borderWidth");
|
|
57
|
+
double borderWidth = this->getFieldValue(fieldBorderWidth);
|
|
58
|
+
static const auto fieldBorderColor = clazz->getField<JColorValue>("borderColor");
|
|
59
|
+
jni::local_ref<JColorValue> borderColor = this->getFieldValue(fieldBorderColor);
|
|
60
|
+
static const auto fieldAnimatesClusters = clazz->getField<jboolean>("animatesClusters");
|
|
61
|
+
jboolean animatesClusters = this->getFieldValue(fieldAnimatesClusters);
|
|
62
|
+
static const auto fieldAnimationDuration = clazz->getField<double>("animationDuration");
|
|
63
|
+
double animationDuration = this->getFieldValue(fieldAnimationDuration);
|
|
64
|
+
static const auto fieldAnimationStyle = clazz->getField<JClusterAnimationStyle>("animationStyle");
|
|
65
|
+
jni::local_ref<JClusterAnimationStyle> animationStyle = this->getFieldValue(fieldAnimationStyle);
|
|
66
|
+
static const auto fieldRealtimeClustering = clazz->getField<jboolean>("realtimeClustering");
|
|
67
|
+
jboolean realtimeClustering = this->getFieldValue(fieldRealtimeClustering);
|
|
68
|
+
static const auto fieldRenderBuffer = clazz->getField<double>("renderBuffer");
|
|
69
|
+
double renderBuffer = this->getFieldValue(fieldRenderBuffer);
|
|
70
|
+
static const auto fieldThrottleInterval = clazz->getField<double>("throttleInterval");
|
|
71
|
+
double throttleInterval = this->getFieldValue(fieldThrottleInterval);
|
|
72
|
+
return ClusterConfig(
|
|
73
|
+
static_cast<bool>(enabled),
|
|
74
|
+
strategy->toCpp(),
|
|
75
|
+
radius,
|
|
76
|
+
minimumClusterSize,
|
|
77
|
+
maxZoom,
|
|
78
|
+
backgroundColor->toCpp(),
|
|
79
|
+
textColor->toCpp(),
|
|
80
|
+
borderWidth,
|
|
81
|
+
borderColor->toCpp(),
|
|
82
|
+
static_cast<bool>(animatesClusters),
|
|
83
|
+
animationDuration,
|
|
84
|
+
animationStyle->toCpp(),
|
|
85
|
+
static_cast<bool>(realtimeClustering),
|
|
86
|
+
renderBuffer,
|
|
87
|
+
throttleInterval
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public:
|
|
92
|
+
/**
|
|
93
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
94
|
+
*/
|
|
95
|
+
[[maybe_unused]]
|
|
96
|
+
static jni::local_ref<JClusterConfig::javaobject> fromCpp(const ClusterConfig& value) {
|
|
97
|
+
using JSignature = JClusterConfig(jboolean, jni::alias_ref<JClusterStrategy>, double, double, double, jni::alias_ref<JColorValue>, jni::alias_ref<JColorValue>, double, jni::alias_ref<JColorValue>, jboolean, double, jni::alias_ref<JClusterAnimationStyle>, jboolean, double, double);
|
|
98
|
+
static const auto clazz = javaClassStatic();
|
|
99
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
100
|
+
return create(
|
|
101
|
+
clazz,
|
|
102
|
+
value.enabled,
|
|
103
|
+
JClusterStrategy::fromCpp(value.strategy),
|
|
104
|
+
value.radius,
|
|
105
|
+
value.minimumClusterSize,
|
|
106
|
+
value.maxZoom,
|
|
107
|
+
JColorValue::fromCpp(value.backgroundColor),
|
|
108
|
+
JColorValue::fromCpp(value.textColor),
|
|
109
|
+
value.borderWidth,
|
|
110
|
+
JColorValue::fromCpp(value.borderColor),
|
|
111
|
+
value.animatesClusters,
|
|
112
|
+
value.animationDuration,
|
|
113
|
+
JClusterAnimationStyle::fromCpp(value.animationStyle),
|
|
114
|
+
value.realtimeClustering,
|
|
115
|
+
value.renderBuffer,
|
|
116
|
+
value.throttleInterval
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
} // namespace margelo::nitro::nitromap
|