@maydon_tech/react-native-nitro-maps 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/NitroMap.podspec +1 -1
- package/README.md +82 -9
- package/android/CMakeLists.txt +4 -1
- package/android/gradle.properties +4 -4
- package/android/src/main/cpp/ClusterEngineJNI.cpp +198 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/NitroMap.kt +397 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/NitroMapConfig.kt +53 -0
- package/android/src/main/{java → kotlin}/com/margelo/nitro/nitromap/NitroMapPackage.kt +4 -4
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/NitroMapView.kt +73 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/UserLocationManager.kt +295 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/clustering/ClusterIconRenderer.kt +111 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/clustering/ClusteringManager.kt +104 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/clustering/NitroClusterEngine.kt +166 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/markers/MarkerIconFactory.kt +303 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/markers/MarkerSelectionHandler.kt +72 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/markers/PriceMarkerRenderer.kt +159 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/MapProviderFactory.kt +24 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/MapProviderInterface.kt +128 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapDelegate.kt +317 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+Clustering.kt +524 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+Markers.kt +358 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+Overlays.kt +272 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider+UserLocation.kt +296 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/GoogleMapProvider.kt +815 -0
- package/android/src/main/kotlin/com/margelo/nitro/nitromap/providers/google/MarkerTagData.kt +19 -0
- package/ios/Clustering/ClusterIconRenderer.swift +3 -3
- package/ios/Location/NitroLocationManager.swift +116 -0
- package/ios/MarkerRenderer/MarkerIconFactory.swift +1 -3
- package/ios/MarkerRenderer/PriceMarkerRenderer.swift +10 -6
- package/ios/NitroMap.swift +279 -13
- package/ios/NitroMapConfig/NitroMapConfig.swift +45 -0
- package/ios/Providers/{GoogleMapDelegate.swift → Google/GoogleMapDelegate.swift} +48 -23
- package/ios/Providers/Google/GoogleMapProvider+Camera.swift +180 -0
- package/ios/Providers/Google/GoogleMapProvider+Clustering.swift +541 -0
- package/ios/Providers/Google/GoogleMapProvider+Markers.swift +270 -0
- package/ios/Providers/Google/GoogleMapProvider+Overlays.swift +245 -0
- package/ios/Providers/Google/GoogleMapProvider+UserLocation.swift +180 -0
- package/ios/Providers/Google/GoogleMapProvider.swift +342 -0
- package/ios/Providers/MapProviderFactory.swift +17 -0
- package/ios/Providers/MapProviderProtocol.swift +48 -1
- package/ios/Shared/ClusterConfig+Factory.swift +2 -2
- package/ios/Shared/MapStyleProvider.swift +6 -4
- package/ios/Shared/MarkerSelectionHandler.swift +4 -1
- package/ios/Utils/ColorValueExtension.swift +46 -67
- package/lib/module/components/ImageMarker.js +39 -29
- package/lib/module/components/ImageMarker.js.map +1 -1
- package/lib/module/components/Marker.js +118 -0
- package/lib/module/components/Marker.js.map +1 -0
- package/lib/module/components/NitroCircle.js +92 -0
- package/lib/module/components/NitroCircle.js.map +1 -0
- package/lib/module/components/NitroMap.js +216 -76
- package/lib/module/components/NitroMap.js.map +1 -1
- package/lib/module/components/NitroPolygon.js +135 -0
- package/lib/module/components/NitroPolygon.js.map +1 -0
- package/lib/module/components/NitroPolyline.js +115 -0
- package/lib/module/components/NitroPolyline.js.map +1 -0
- package/lib/module/components/PriceMarker.js +16 -29
- package/lib/module/components/PriceMarker.js.map +1 -1
- package/lib/module/context/NitroMapContext.js.map +1 -1
- package/lib/module/hooks/useNitroCircle.js +18 -0
- package/lib/module/hooks/useNitroCircle.js.map +1 -0
- package/lib/module/hooks/useNitroMarker.js +26 -9
- package/lib/module/hooks/useNitroMarker.js.map +1 -1
- package/lib/module/hooks/useNitroOverlay.js +59 -0
- package/lib/module/hooks/useNitroOverlay.js.map +1 -0
- package/lib/module/hooks/useNitroPolygon.js +18 -0
- package/lib/module/hooks/useNitroPolygon.js.map +1 -0
- package/lib/module/hooks/useNitroPolyline.js +18 -0
- package/lib/module/hooks/useNitroPolyline.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/overlay.js +4 -0
- package/lib/module/types/overlay.js.map +1 -0
- package/lib/module/types/theme.js +4 -0
- package/lib/module/types/theme.js.map +1 -0
- package/lib/module/utils/colors.js +41 -13
- package/lib/module/utils/colors.js.map +1 -1
- package/lib/module/utils/validation.js +45 -0
- package/lib/module/utils/validation.js.map +1 -0
- package/lib/typescript/src/components/ImageMarker.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.d.ts +34 -0
- package/lib/typescript/src/components/Marker.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroCircle.d.ts +70 -0
- package/lib/typescript/src/components/NitroCircle.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroMap.d.ts +60 -3
- package/lib/typescript/src/components/NitroMap.d.ts.map +1 -1
- package/lib/typescript/src/components/NitroPolygon.d.ts +86 -0
- package/lib/typescript/src/components/NitroPolygon.d.ts.map +1 -0
- package/lib/typescript/src/components/NitroPolyline.d.ts +84 -0
- package/lib/typescript/src/components/NitroPolyline.d.ts.map +1 -0
- package/lib/typescript/src/components/PriceMarker.d.ts +0 -5
- package/lib/typescript/src/components/PriceMarker.d.ts.map +1 -1
- package/lib/typescript/src/context/NitroMapContext.d.ts +2 -0
- package/lib/typescript/src/context/NitroMapContext.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useNitroCircle.d.ts +7 -0
- package/lib/typescript/src/hooks/useNitroCircle.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNitroMarker.d.ts +20 -0
- package/lib/typescript/src/hooks/useNitroMarker.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useNitroOverlay.d.ts +26 -0
- package/lib/typescript/src/hooks/useNitroOverlay.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNitroPolygon.d.ts +7 -0
- package/lib/typescript/src/hooks/useNitroPolygon.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNitroPolyline.d.ts +7 -0
- package/lib/typescript/src/hooks/useNitroPolyline.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +15 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/NitroMap.nitro.d.ts +248 -6
- package/lib/typescript/src/specs/NitroMap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types/map.d.ts +34 -4
- package/lib/typescript/src/types/map.d.ts.map +1 -1
- package/lib/typescript/src/types/marker.d.ts +24 -36
- package/lib/typescript/src/types/marker.d.ts.map +1 -1
- package/lib/typescript/src/types/overlay.d.ts +75 -0
- package/lib/typescript/src/types/overlay.d.ts.map +1 -0
- package/lib/typescript/src/types/theme.d.ts +93 -0
- package/lib/typescript/src/types/theme.d.ts.map +1 -0
- package/lib/typescript/src/utils/colors.d.ts +6 -8
- package/lib/typescript/src/utils/colors.d.ts.map +1 -1
- package/lib/typescript/src/utils/validation.d.ts +12 -0
- package/lib/typescript/src/utils/validation.d.ts.map +1 -0
- package/nitrogen/generated/android/c++/JCircleData.hpp +94 -0
- package/nitrogen/generated/android/c++/JClusterConfig.hpp +5 -7
- package/nitrogen/generated/android/c++/JFunc_void_UserLocationChangeEvent.hpp +79 -0
- package/nitrogen/generated/android/c++/JFunc_void_UserTrackingMode.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridNitroMapSpec.cpp +328 -21
- package/nitrogen/generated/android/c++/JHybridNitroMapSpec.hpp +53 -2
- package/nitrogen/generated/android/c++/JMarkerAnimation.hpp +3 -6
- package/nitrogen/generated/android/c++/JMarkerData.hpp +15 -3
- package/nitrogen/generated/android/c++/JPolygonData.hpp +149 -0
- package/nitrogen/generated/android/c++/JPolylineData.hpp +113 -0
- package/nitrogen/generated/android/c++/JUserLocationChangeEvent.hpp +70 -0
- package/nitrogen/generated/android/c++/JUserTrackingMode.hpp +62 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroMapStateUpdater.cpp +72 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/CircleData.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ClusterConfig.kt +4 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_UserLocationChangeEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_UserTrackingMode.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/HybridNitroMapSpec.kt +228 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerAnimation.kt +1 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerData.kt +12 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/PolygonData.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/PolylineData.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/UserLocationChangeEvent.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/{ClusterAnimationStyle.kt → UserTrackingMode.kt} +6 -8
- package/nitrogen/generated/android/nitromapOnLoad.cpp +6 -0
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Bridge.cpp +24 -0
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Bridge.hpp +175 -17
- package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Umbrella.hpp +15 -3
- package/nitrogen/generated/ios/c++/HybridNitroMapSpecSwift.hpp +249 -16
- package/nitrogen/generated/ios/c++/views/HybridNitroMapComponent.mm +90 -5
- package/nitrogen/generated/ios/swift/CircleData.swift +143 -0
- package/nitrogen/generated/ios/swift/ClusterConfig.swift +22 -15
- package/nitrogen/generated/ios/swift/Func_void_UserLocationChangeEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_UserTrackingMode.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridNitroMapSpec.swift +35 -1
- package/nitrogen/generated/ios/swift/HybridNitroMapSpec_cxx.swift +582 -8
- package/nitrogen/generated/ios/swift/MarkerAnimation.swift +4 -8
- package/nitrogen/generated/ios/swift/MarkerData.swift +54 -2
- package/nitrogen/generated/ios/swift/PolygonData.swift +179 -0
- package/nitrogen/generated/ios/swift/PolylineData.swift +155 -0
- package/nitrogen/generated/ios/swift/UserLocationChangeEvent.swift +69 -0
- package/nitrogen/generated/ios/swift/UserTrackingMode.swift +44 -0
- package/nitrogen/generated/shared/c++/CircleData.hpp +113 -0
- package/nitrogen/generated/shared/c++/ClusterConfig.hpp +5 -8
- package/nitrogen/generated/shared/c++/HybridNitroMapSpec.cpp +53 -2
- package/nitrogen/generated/shared/c++/HybridNitroMapSpec.hpp +75 -6
- package/nitrogen/generated/shared/c++/MarkerAnimation.hpp +4 -8
- package/nitrogen/generated/shared/c++/MarkerData.hpp +14 -2
- package/nitrogen/generated/shared/c++/PolygonData.hpp +114 -0
- package/nitrogen/generated/shared/c++/PolylineData.hpp +114 -0
- package/nitrogen/generated/shared/c++/UserLocationChangeEvent.hpp +88 -0
- package/nitrogen/generated/shared/c++/UserTrackingMode.hpp +80 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroMapComponent.cpp +216 -12
- package/nitrogen/generated/shared/c++/views/HybridNitroMapComponent.hpp +23 -1
- package/nitrogen/generated/shared/json/NitroMapConfig.json +18 -1
- package/package.json +36 -5
- package/src/components/ImageMarker.tsx +58 -42
- package/src/components/Marker.tsx +161 -0
- package/src/components/NitroCircle.tsx +183 -0
- package/src/components/NitroMap.tsx +328 -78
- package/src/components/NitroPolygon.tsx +229 -0
- package/src/components/NitroPolyline.tsx +208 -0
- package/src/components/PriceMarker.tsx +23 -48
- package/src/context/NitroMapContext.tsx +4 -0
- package/src/hooks/useNitroCircle.ts +25 -0
- package/src/hooks/useNitroMarker.ts +49 -10
- package/src/hooks/useNitroOverlay.ts +68 -0
- package/src/hooks/useNitroPolygon.ts +25 -0
- package/src/hooks/useNitroPolyline.ts +25 -0
- package/src/index.tsx +23 -2
- package/src/specs/NitroMap.nitro.ts +294 -5
- package/src/types/map.ts +36 -4
- package/src/types/marker.ts +24 -44
- package/src/types/overlay.ts +77 -0
- package/src/types/theme.ts +101 -0
- package/src/utils/colors.ts +48 -16
- package/src/utils/validation.ts +69 -0
- package/android/src/main/java/com/margelo/nitro/nitromap/ClusterIconGenerator.kt +0 -108
- package/android/src/main/java/com/margelo/nitro/nitromap/ColorUtils.kt +0 -63
- package/android/src/main/java/com/margelo/nitro/nitromap/HybridNitroMap.kt +0 -408
- package/android/src/main/java/com/margelo/nitro/nitromap/HybridNitroMapConfig.kt +0 -68
- package/android/src/main/java/com/margelo/nitro/nitromap/MarkerIconCache.kt +0 -176
- package/android/src/main/java/com/margelo/nitro/nitromap/MarkerIconFactory.kt +0 -252
- package/android/src/main/java/com/margelo/nitro/nitromap/clustering/NitroClusterEngine.kt +0 -252
- package/android/src/main/java/com/margelo/nitro/nitromap/clustering/QuadTree.kt +0 -195
- package/android/src/main/java/com/margelo/nitro/nitromap/providers/GoogleMapProvider.kt +0 -912
- package/android/src/main/java/com/margelo/nitro/nitromap/providers/MapProviderInterface.kt +0 -70
- package/cpp/QuadTree.hpp +0 -246
- package/ios/NitroMapConfig/HybridNitroMapConfig.swift +0 -33
- package/ios/Providers/GoogleMapProvider+Camera.swift +0 -164
- package/ios/Providers/GoogleMapProvider.swift +0 -924
- package/nitrogen/generated/android/c++/JClusterAnimationStyle.hpp +0 -68
- package/nitrogen/generated/ios/swift/ClusterAnimationStyle.swift +0 -52
- package/nitrogen/generated/shared/c++/ClusterAnimationStyle.hpp +0 -88
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { MapStyle } from './map';
|
|
2
|
+
/**
|
|
3
|
+
* Google Maps theme — JSON-based styling.
|
|
4
|
+
* Array of style elements targeting map features with visual modifiers.
|
|
5
|
+
*
|
|
6
|
+
* @see https://mapstyle.withgoogle.com/
|
|
7
|
+
* @see https://developers.google.com/maps/documentation/javascript/style-reference
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const darkTheme: GoogleMapTheme = [
|
|
12
|
+
* { featureType: 'water', stylers: [{ color: '#0e171d' }] },
|
|
13
|
+
* { featureType: 'road', stylers: [{ visibility: 'simplified' }] },
|
|
14
|
+
* ];
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export type GoogleMapTheme = MapStyle;
|
|
18
|
+
/**
|
|
19
|
+
* Apple Maps theme — configuration-based styling.
|
|
20
|
+
*
|
|
21
|
+
* Maps to `MKMapConfiguration` on iOS. Unlike Google's element-level JSON
|
|
22
|
+
* styling, Apple Maps uses high-level configuration categories.
|
|
23
|
+
*
|
|
24
|
+
* **Not yet implemented** — will be available when the Apple Maps provider
|
|
25
|
+
* is added (Phase 3).
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const appleTheme: AppleMapTheme = {
|
|
30
|
+
* colorScheme: 'dark',
|
|
31
|
+
* emphasisStyle: 'muted',
|
|
32
|
+
* showsTraffic: true,
|
|
33
|
+
* pointOfInterestFilter: {
|
|
34
|
+
* includes: ['restaurant', 'cafe', 'hotel'],
|
|
35
|
+
* },
|
|
36
|
+
* };
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export type AppleMapTheme = {
|
|
40
|
+
/** Color scheme for the map. @default 'light' */
|
|
41
|
+
colorScheme?: 'light' | 'dark';
|
|
42
|
+
/** Emphasis style — 'muted' reduces visual clutter. @default 'default' */
|
|
43
|
+
emphasisStyle?: 'default' | 'muted';
|
|
44
|
+
/** Show real-time traffic overlay. @default false */
|
|
45
|
+
showsTraffic?: boolean;
|
|
46
|
+
/** Filter which points of interest are visible. */
|
|
47
|
+
pointOfInterestFilter?: {
|
|
48
|
+
/** Only show these POI categories. Mutually exclusive with `excludes`. */
|
|
49
|
+
includes?: string[];
|
|
50
|
+
/** Hide these POI categories. Mutually exclusive with `includes`. */
|
|
51
|
+
excludes?: string[];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Yandex Maps theme — style URI or night mode toggle.
|
|
56
|
+
*
|
|
57
|
+
* **Not yet implemented** — will be available when the Yandex Maps provider
|
|
58
|
+
* is added (Phase 4).
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const yandexTheme: YandexMapTheme = {
|
|
63
|
+
* nightModeEnabled: true,
|
|
64
|
+
* };
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export type YandexMapTheme = {
|
|
68
|
+
/** Custom style URI (e.g., from Yandex Style Editor). */
|
|
69
|
+
styleUri?: string;
|
|
70
|
+
/** Enable built-in night/dark mode. @default false */
|
|
71
|
+
nightModeEnabled?: boolean;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Maps each provider to its theme type.
|
|
75
|
+
* Used by the generic `NitroMapProps<P>` to enforce type-safe themes.
|
|
76
|
+
*
|
|
77
|
+
* When you write `<NitroMap provider="google" theme={...} />`,
|
|
78
|
+
* TypeScript narrows `theme` to `GoogleMapTheme`.
|
|
79
|
+
*
|
|
80
|
+
* When you write `<NitroMap provider="apple" theme={...} />`,
|
|
81
|
+
* TypeScript narrows `theme` to `AppleMapTheme`.
|
|
82
|
+
*/
|
|
83
|
+
export type ThemeForProvider = {
|
|
84
|
+
google: GoogleMapTheme;
|
|
85
|
+
apple: AppleMapTheme;
|
|
86
|
+
yandex: YandexMapTheme;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Union of all possible theme types.
|
|
90
|
+
* Use `ThemeForProvider[P]` for type-safe narrowing instead.
|
|
91
|
+
*/
|
|
92
|
+
export type MapTheme = GoogleMapTheme | AppleMapTheme | YandexMapTheme;
|
|
93
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/types/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAItC;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC/B,0EAA0E;IAC1E,aAAa,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACpC,qDAAqD;IACrD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mDAAmD;IACnD,qBAAqB,CAAC,EAAE;QACtB,0EAA0E;QAC1E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,qEAAqE;QACrE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAIF;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,CAAC"}
|
|
@@ -19,14 +19,6 @@ export type ColorValue = MarkerColor | string;
|
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
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
22
|
/**
|
|
31
23
|
* Create a MarkerColor from RGB values
|
|
32
24
|
* @param r - Red component (0-255)
|
|
@@ -79,4 +71,10 @@ export declare const Colors: {
|
|
|
79
71
|
/** Light gray (240, 240, 240) */
|
|
80
72
|
lightGray: MarkerColor;
|
|
81
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Compare two ColorValue values for equality.
|
|
76
|
+
* Handles both hex strings and MarkerColor objects.
|
|
77
|
+
* @internal Used by component memo comparators to avoid duplication.
|
|
78
|
+
*/
|
|
79
|
+
export declare const areColorsEqual: (a: ColorValue | undefined, b: ColorValue | undefined) => boolean;
|
|
82
80
|
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -1 +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
|
|
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;;;;;;;;;;;;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,WAsDzD,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;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GACzB,GAAG,UAAU,GAAG,SAAS,EACzB,GAAG,UAAU,GAAG,SAAS,KACxB,OAQF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Coordinate } from '../types/map';
|
|
2
|
+
/**
|
|
3
|
+
* Validate a coordinate in __DEV__ mode.
|
|
4
|
+
* Warns on NaN, Infinity, or out-of-range values.
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateCoordinate(coordinate: Coordinate, context: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Validate an array of coordinates in __DEV__ mode.
|
|
9
|
+
* Only reports the first invalid coordinate to avoid console spam.
|
|
10
|
+
*/
|
|
11
|
+
export declare function validateCoordinates(coordinates: Coordinate[], context: string): void;
|
|
12
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/utils/validation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,MAAM,GACd,IAAI,CA2BN;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,UAAU,EAAE,EACzB,OAAO,EAAE,MAAM,GACd,IAAI,CAqBN"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JCircleData.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 "CircleData.hpp"
|
|
12
|
+
|
|
13
|
+
#include "Coordinate.hpp"
|
|
14
|
+
#include "JCoordinate.hpp"
|
|
15
|
+
#include "JMarkerColor.hpp"
|
|
16
|
+
#include "MarkerColor.hpp"
|
|
17
|
+
#include <optional>
|
|
18
|
+
#include <string>
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::nitromap {
|
|
21
|
+
|
|
22
|
+
using namespace facebook;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The C++ JNI bridge between the C++ struct "CircleData" and the the Kotlin data class "CircleData".
|
|
26
|
+
*/
|
|
27
|
+
struct JCircleData final: public jni::JavaClass<JCircleData> {
|
|
28
|
+
public:
|
|
29
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/CircleData;";
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
/**
|
|
33
|
+
* Convert this Java/Kotlin-based struct to the C++ struct CircleData by copying all values to C++.
|
|
34
|
+
*/
|
|
35
|
+
[[maybe_unused]]
|
|
36
|
+
[[nodiscard]]
|
|
37
|
+
CircleData toCpp() const {
|
|
38
|
+
static const auto clazz = javaClassStatic();
|
|
39
|
+
static const auto fieldId = clazz->getField<jni::JString>("id");
|
|
40
|
+
jni::local_ref<jni::JString> id = this->getFieldValue(fieldId);
|
|
41
|
+
static const auto fieldCenter = clazz->getField<JCoordinate>("center");
|
|
42
|
+
jni::local_ref<JCoordinate> center = this->getFieldValue(fieldCenter);
|
|
43
|
+
static const auto fieldRadius = clazz->getField<double>("radius");
|
|
44
|
+
double radius = this->getFieldValue(fieldRadius);
|
|
45
|
+
static const auto fieldFillColor = clazz->getField<JMarkerColor>("fillColor");
|
|
46
|
+
jni::local_ref<JMarkerColor> fillColor = this->getFieldValue(fieldFillColor);
|
|
47
|
+
static const auto fieldStrokeColor = clazz->getField<JMarkerColor>("strokeColor");
|
|
48
|
+
jni::local_ref<JMarkerColor> strokeColor = this->getFieldValue(fieldStrokeColor);
|
|
49
|
+
static const auto fieldStrokeWidth = clazz->getField<double>("strokeWidth");
|
|
50
|
+
double strokeWidth = this->getFieldValue(fieldStrokeWidth);
|
|
51
|
+
static const auto fieldZIndex = clazz->getField<double>("zIndex");
|
|
52
|
+
double zIndex = this->getFieldValue(fieldZIndex);
|
|
53
|
+
static const auto fieldTappable = clazz->getField<jboolean>("tappable");
|
|
54
|
+
jboolean tappable = this->getFieldValue(fieldTappable);
|
|
55
|
+
static const auto fieldAccessibilityLabel = clazz->getField<jni::JString>("accessibilityLabel");
|
|
56
|
+
jni::local_ref<jni::JString> accessibilityLabel = this->getFieldValue(fieldAccessibilityLabel);
|
|
57
|
+
return CircleData(
|
|
58
|
+
id->toStdString(),
|
|
59
|
+
center->toCpp(),
|
|
60
|
+
radius,
|
|
61
|
+
fillColor->toCpp(),
|
|
62
|
+
strokeColor->toCpp(),
|
|
63
|
+
strokeWidth,
|
|
64
|
+
zIndex,
|
|
65
|
+
static_cast<bool>(tappable),
|
|
66
|
+
accessibilityLabel != nullptr ? std::make_optional(accessibilityLabel->toStdString()) : std::nullopt
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public:
|
|
71
|
+
/**
|
|
72
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
73
|
+
*/
|
|
74
|
+
[[maybe_unused]]
|
|
75
|
+
static jni::local_ref<JCircleData::javaobject> fromCpp(const CircleData& value) {
|
|
76
|
+
using JSignature = JCircleData(jni::alias_ref<jni::JString>, jni::alias_ref<JCoordinate>, double, jni::alias_ref<JMarkerColor>, jni::alias_ref<JMarkerColor>, double, double, jboolean, jni::alias_ref<jni::JString>);
|
|
77
|
+
static const auto clazz = javaClassStatic();
|
|
78
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
79
|
+
return create(
|
|
80
|
+
clazz,
|
|
81
|
+
jni::make_jstring(value.id),
|
|
82
|
+
JCoordinate::fromCpp(value.center),
|
|
83
|
+
value.radius,
|
|
84
|
+
JMarkerColor::fromCpp(value.fillColor),
|
|
85
|
+
JMarkerColor::fromCpp(value.strokeColor),
|
|
86
|
+
value.strokeWidth,
|
|
87
|
+
value.zIndex,
|
|
88
|
+
value.tappable,
|
|
89
|
+
value.accessibilityLabel.has_value() ? jni::make_jstring(value.accessibilityLabel.value()) : nullptr
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
11
|
#include "ClusterConfig.hpp"
|
|
12
12
|
|
|
13
|
-
#include "ClusterAnimationStyle.hpp"
|
|
14
13
|
#include "ClusterStrategy.hpp"
|
|
15
|
-
#include "JClusterAnimationStyle.hpp"
|
|
16
14
|
#include "JClusterStrategy.hpp"
|
|
17
15
|
#include "JMarkerColor.hpp"
|
|
18
16
|
#include "JVariant_String_MarkerColor.hpp"
|
|
@@ -60,10 +58,10 @@ namespace margelo::nitro::nitromap {
|
|
|
60
58
|
jni::local_ref<JVariant_String_MarkerColor> borderColor = this->getFieldValue(fieldBorderColor);
|
|
61
59
|
static const auto fieldAnimatesClusters = clazz->getField<jni::JBoolean>("animatesClusters");
|
|
62
60
|
jni::local_ref<jni::JBoolean> animatesClusters = this->getFieldValue(fieldAnimatesClusters);
|
|
61
|
+
static const auto fieldAnimateOnReappear = clazz->getField<jni::JBoolean>("animateOnReappear");
|
|
62
|
+
jni::local_ref<jni::JBoolean> animateOnReappear = this->getFieldValue(fieldAnimateOnReappear);
|
|
63
63
|
static const auto fieldAnimationDuration = clazz->getField<jni::JDouble>("animationDuration");
|
|
64
64
|
jni::local_ref<jni::JDouble> animationDuration = this->getFieldValue(fieldAnimationDuration);
|
|
65
|
-
static const auto fieldAnimationStyle = clazz->getField<JClusterAnimationStyle>("animationStyle");
|
|
66
|
-
jni::local_ref<JClusterAnimationStyle> animationStyle = this->getFieldValue(fieldAnimationStyle);
|
|
67
65
|
static const auto fieldRealtimeClustering = clazz->getField<jni::JBoolean>("realtimeClustering");
|
|
68
66
|
jni::local_ref<jni::JBoolean> realtimeClustering = this->getFieldValue(fieldRealtimeClustering);
|
|
69
67
|
static const auto fieldRenderBuffer = clazz->getField<jni::JDouble>("renderBuffer");
|
|
@@ -81,8 +79,8 @@ namespace margelo::nitro::nitromap {
|
|
|
81
79
|
borderWidth != nullptr ? std::make_optional(borderWidth->value()) : std::nullopt,
|
|
82
80
|
borderColor != nullptr ? std::make_optional(borderColor->toCpp()) : std::nullopt,
|
|
83
81
|
animatesClusters != nullptr ? std::make_optional(static_cast<bool>(animatesClusters->value())) : std::nullopt,
|
|
82
|
+
animateOnReappear != nullptr ? std::make_optional(static_cast<bool>(animateOnReappear->value())) : std::nullopt,
|
|
84
83
|
animationDuration != nullptr ? std::make_optional(animationDuration->value()) : std::nullopt,
|
|
85
|
-
animationStyle != nullptr ? std::make_optional(animationStyle->toCpp()) : std::nullopt,
|
|
86
84
|
realtimeClustering != nullptr ? std::make_optional(static_cast<bool>(realtimeClustering->value())) : std::nullopt,
|
|
87
85
|
renderBuffer != nullptr ? std::make_optional(renderBuffer->value()) : std::nullopt,
|
|
88
86
|
throttleInterval != nullptr ? std::make_optional(throttleInterval->value()) : std::nullopt
|
|
@@ -95,7 +93,7 @@ namespace margelo::nitro::nitromap {
|
|
|
95
93
|
*/
|
|
96
94
|
[[maybe_unused]]
|
|
97
95
|
static jni::local_ref<JClusterConfig::javaobject> fromCpp(const ClusterConfig& value) {
|
|
98
|
-
using JSignature = JClusterConfig(jboolean, jni::alias_ref<JClusterStrategy>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JVariant_String_MarkerColor>, jni::alias_ref<JVariant_String_MarkerColor>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JVariant_String_MarkerColor>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::
|
|
96
|
+
using JSignature = JClusterConfig(jboolean, jni::alias_ref<JClusterStrategy>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JVariant_String_MarkerColor>, jni::alias_ref<JVariant_String_MarkerColor>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JVariant_String_MarkerColor>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>);
|
|
99
97
|
static const auto clazz = javaClassStatic();
|
|
100
98
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
101
99
|
return create(
|
|
@@ -110,8 +108,8 @@ namespace margelo::nitro::nitromap {
|
|
|
110
108
|
value.borderWidth.has_value() ? jni::JDouble::valueOf(value.borderWidth.value()) : nullptr,
|
|
111
109
|
value.borderColor.has_value() ? JVariant_String_MarkerColor::fromCpp(value.borderColor.value()) : nullptr,
|
|
112
110
|
value.animatesClusters.has_value() ? jni::JBoolean::valueOf(value.animatesClusters.value()) : nullptr,
|
|
111
|
+
value.animateOnReappear.has_value() ? jni::JBoolean::valueOf(value.animateOnReappear.value()) : nullptr,
|
|
113
112
|
value.animationDuration.has_value() ? jni::JDouble::valueOf(value.animationDuration.value()) : nullptr,
|
|
114
|
-
value.animationStyle.has_value() ? JClusterAnimationStyle::fromCpp(value.animationStyle.value()) : nullptr,
|
|
115
113
|
value.realtimeClustering.has_value() ? jni::JBoolean::valueOf(value.realtimeClustering.value()) : nullptr,
|
|
116
114
|
value.renderBuffer.has_value() ? jni::JDouble::valueOf(value.renderBuffer.value()) : nullptr,
|
|
117
115
|
value.throttleInterval.has_value() ? jni::JDouble::valueOf(value.throttleInterval.value()) : nullptr
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_UserLocationChangeEvent.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 <functional>
|
|
12
|
+
|
|
13
|
+
#include "UserLocationChangeEvent.hpp"
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
#include "JUserLocationChangeEvent.hpp"
|
|
17
|
+
#include "Coordinate.hpp"
|
|
18
|
+
#include "JCoordinate.hpp"
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::nitromap {
|
|
21
|
+
|
|
22
|
+
using namespace facebook;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Represents the Java/Kotlin callback `(event: UserLocationChangeEvent) -> Unit`.
|
|
26
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
27
|
+
*/
|
|
28
|
+
struct JFunc_void_UserLocationChangeEvent: public jni::JavaClass<JFunc_void_UserLocationChangeEvent> {
|
|
29
|
+
public:
|
|
30
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/Func_void_UserLocationChangeEvent;";
|
|
31
|
+
|
|
32
|
+
public:
|
|
33
|
+
/**
|
|
34
|
+
* Invokes the function this `JFunc_void_UserLocationChangeEvent` instance holds through JNI.
|
|
35
|
+
*/
|
|
36
|
+
void invoke(const UserLocationChangeEvent& event) const {
|
|
37
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JUserLocationChangeEvent> /* event */)>("invoke");
|
|
38
|
+
method(self(), JUserLocationChangeEvent::fromCpp(event));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* An implementation of Func_void_UserLocationChangeEvent that is backed by a C++ implementation (using `std::function<...>`)
|
|
44
|
+
*/
|
|
45
|
+
class JFunc_void_UserLocationChangeEvent_cxx final: public jni::HybridClass<JFunc_void_UserLocationChangeEvent_cxx, JFunc_void_UserLocationChangeEvent> {
|
|
46
|
+
public:
|
|
47
|
+
static jni::local_ref<JFunc_void_UserLocationChangeEvent::javaobject> fromCpp(const std::function<void(const UserLocationChangeEvent& /* event */)>& func) {
|
|
48
|
+
return JFunc_void_UserLocationChangeEvent_cxx::newObjectCxxArgs(func);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
/**
|
|
53
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_UserLocationChangeEvent_cxx` instance holds.
|
|
54
|
+
*/
|
|
55
|
+
void invoke_cxx(jni::alias_ref<JUserLocationChangeEvent> event) {
|
|
56
|
+
_func(event->toCpp());
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
[[nodiscard]]
|
|
61
|
+
inline const std::function<void(const UserLocationChangeEvent& /* event */)>& getFunction() const {
|
|
62
|
+
return _func;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public:
|
|
66
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/Func_void_UserLocationChangeEvent_cxx;";
|
|
67
|
+
static void registerNatives() {
|
|
68
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_UserLocationChangeEvent_cxx::invoke_cxx)});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private:
|
|
72
|
+
explicit JFunc_void_UserLocationChangeEvent_cxx(const std::function<void(const UserLocationChangeEvent& /* event */)>& func): _func(func) { }
|
|
73
|
+
|
|
74
|
+
private:
|
|
75
|
+
friend HybridBase;
|
|
76
|
+
std::function<void(const UserLocationChangeEvent& /* event */)> _func;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_UserTrackingMode.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 <functional>
|
|
12
|
+
|
|
13
|
+
#include "UserTrackingMode.hpp"
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
#include "JUserTrackingMode.hpp"
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::nitromap {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents the Java/Kotlin callback `(mode: UserTrackingMode) -> Unit`.
|
|
24
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
25
|
+
*/
|
|
26
|
+
struct JFunc_void_UserTrackingMode: public jni::JavaClass<JFunc_void_UserTrackingMode> {
|
|
27
|
+
public:
|
|
28
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/Func_void_UserTrackingMode;";
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
/**
|
|
32
|
+
* Invokes the function this `JFunc_void_UserTrackingMode` instance holds through JNI.
|
|
33
|
+
*/
|
|
34
|
+
void invoke(UserTrackingMode mode) const {
|
|
35
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JUserTrackingMode> /* mode */)>("invoke");
|
|
36
|
+
method(self(), JUserTrackingMode::fromCpp(mode));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* An implementation of Func_void_UserTrackingMode that is backed by a C++ implementation (using `std::function<...>`)
|
|
42
|
+
*/
|
|
43
|
+
class JFunc_void_UserTrackingMode_cxx final: public jni::HybridClass<JFunc_void_UserTrackingMode_cxx, JFunc_void_UserTrackingMode> {
|
|
44
|
+
public:
|
|
45
|
+
static jni::local_ref<JFunc_void_UserTrackingMode::javaobject> fromCpp(const std::function<void(UserTrackingMode /* mode */)>& func) {
|
|
46
|
+
return JFunc_void_UserTrackingMode_cxx::newObjectCxxArgs(func);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
/**
|
|
51
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_UserTrackingMode_cxx` instance holds.
|
|
52
|
+
*/
|
|
53
|
+
void invoke_cxx(jni::alias_ref<JUserTrackingMode> mode) {
|
|
54
|
+
_func(mode->toCpp());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
[[nodiscard]]
|
|
59
|
+
inline const std::function<void(UserTrackingMode /* mode */)>& getFunction() const {
|
|
60
|
+
return _func;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/Func_void_UserTrackingMode_cxx;";
|
|
65
|
+
static void registerNatives() {
|
|
66
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_UserTrackingMode_cxx::invoke_cxx)});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
explicit JFunc_void_UserTrackingMode_cxx(const std::function<void(UserTrackingMode /* mode */)>& func): _func(func) { }
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
friend HybridBase;
|
|
74
|
+
std::function<void(UserTrackingMode /* mode */)> _func;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro::nitromap
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_std__string.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 <functional>
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::nitromap {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Represents the Java/Kotlin callback `(id: String) -> Unit`.
|
|
23
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
24
|
+
*/
|
|
25
|
+
struct JFunc_void_std__string: public jni::JavaClass<JFunc_void_std__string> {
|
|
26
|
+
public:
|
|
27
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/Func_void_std__string;";
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
/**
|
|
31
|
+
* Invokes the function this `JFunc_void_std__string` instance holds through JNI.
|
|
32
|
+
*/
|
|
33
|
+
void invoke(const std::string& id) const {
|
|
34
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* id */)>("invoke");
|
|
35
|
+
method(self(), jni::make_jstring(id));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* An implementation of Func_void_std__string that is backed by a C++ implementation (using `std::function<...>`)
|
|
41
|
+
*/
|
|
42
|
+
class JFunc_void_std__string_cxx final: public jni::HybridClass<JFunc_void_std__string_cxx, JFunc_void_std__string> {
|
|
43
|
+
public:
|
|
44
|
+
static jni::local_ref<JFunc_void_std__string::javaobject> fromCpp(const std::function<void(const std::string& /* id */)>& func) {
|
|
45
|
+
return JFunc_void_std__string_cxx::newObjectCxxArgs(func);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
/**
|
|
50
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_std__string_cxx` instance holds.
|
|
51
|
+
*/
|
|
52
|
+
void invoke_cxx(jni::alias_ref<jni::JString> id) {
|
|
53
|
+
_func(id->toStdString());
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public:
|
|
57
|
+
[[nodiscard]]
|
|
58
|
+
inline const std::function<void(const std::string& /* id */)>& getFunction() const {
|
|
59
|
+
return _func;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/Func_void_std__string_cxx;";
|
|
64
|
+
static void registerNatives() {
|
|
65
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__string_cxx::invoke_cxx)});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private:
|
|
69
|
+
explicit JFunc_void_std__string_cxx(const std::function<void(const std::string& /* id */)>& func): _func(func) { }
|
|
70
|
+
|
|
71
|
+
private:
|
|
72
|
+
friend HybridBase;
|
|
73
|
+
std::function<void(const std::string& /* id */)> _func;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro::nitromap
|