@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,292 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
HybridView,
|
|
3
|
+
HybridViewMethods,
|
|
4
|
+
HybridViewProps,
|
|
5
|
+
} from 'react-native-nitro-modules';
|
|
6
|
+
import type {
|
|
7
|
+
Camera,
|
|
8
|
+
Coordinate,
|
|
9
|
+
EdgePadding,
|
|
10
|
+
MapBoundaries,
|
|
11
|
+
MapError,
|
|
12
|
+
MapPressEvent,
|
|
13
|
+
MapProvider,
|
|
14
|
+
MapStyle,
|
|
15
|
+
MapType,
|
|
16
|
+
Region,
|
|
17
|
+
RegionChangeEvent,
|
|
18
|
+
} from '../types/map';
|
|
19
|
+
import type {
|
|
20
|
+
ClusterConfig,
|
|
21
|
+
ClusterPressEvent,
|
|
22
|
+
MarkerData,
|
|
23
|
+
MarkerDragEvent,
|
|
24
|
+
MarkerPressEvent,
|
|
25
|
+
} from '../types/marker';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Props for the NitroMap component
|
|
29
|
+
*/
|
|
30
|
+
export interface NitroMapProps extends HybridViewProps {
|
|
31
|
+
/**
|
|
32
|
+
* Map provider to use for rendering.
|
|
33
|
+
* Currently only `'google'` is supported.
|
|
34
|
+
* @default 'google'
|
|
35
|
+
*/
|
|
36
|
+
provider?: MapProvider;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Initial region to display when the map loads
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* initialRegion={{
|
|
43
|
+
* latitude: 41.299496,
|
|
44
|
+
* longitude: 69.240073,
|
|
45
|
+
* latitudeDelta: 0.0922,
|
|
46
|
+
* longitudeDelta: 0.0421,
|
|
47
|
+
* }}
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
initialRegion?: Region;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Show the user's current location on the map
|
|
54
|
+
* Requires location permissions
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
showsUserLocation?: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Enable pinch-to-zoom gesture
|
|
61
|
+
* @default true
|
|
62
|
+
*/
|
|
63
|
+
zoomEnabled?: boolean;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Enable pan/scroll gesture
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
69
|
+
scrollEnabled?: boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Enable rotation gesture (two-finger rotate)
|
|
73
|
+
* @default true
|
|
74
|
+
*/
|
|
75
|
+
rotateEnabled?: boolean;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Enable 3D tilt gesture (two-finger vertical pan)
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
81
|
+
pitchEnabled?: boolean;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Map display type
|
|
85
|
+
* - `'standard'` - Normal map with roads and labels
|
|
86
|
+
* - `'satellite'` - Satellite imagery
|
|
87
|
+
* - `'hybrid'` - Satellite with roads/labels overlay
|
|
88
|
+
* @default 'standard'
|
|
89
|
+
*/
|
|
90
|
+
mapType?: MapType;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Custom JSON styling for the map
|
|
94
|
+
* @see https://mapstyle.withgoogle.com/
|
|
95
|
+
*/
|
|
96
|
+
customMapStyle?: MapStyle;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Show the "my location" button on the map
|
|
100
|
+
* @default true
|
|
101
|
+
*/
|
|
102
|
+
showsMyLocationButton?: boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Configuration for marker clustering behavior
|
|
106
|
+
*/
|
|
107
|
+
clusterConfig?: ClusterConfig;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Enable dark mode styling for the map
|
|
111
|
+
* @default false
|
|
112
|
+
*/
|
|
113
|
+
darkMode?: boolean;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Called when the user taps on the map (not on a marker)
|
|
117
|
+
* @param event - Contains the coordinate and screen position of the tap
|
|
118
|
+
*/
|
|
119
|
+
onPress?: (event: MapPressEvent) => void;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Called when the user long-presses on the map
|
|
123
|
+
* @param event - Contains the coordinate and screen position of the press
|
|
124
|
+
*/
|
|
125
|
+
onLongPress?: (event: MapPressEvent) => void;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Called when the map has finished loading and is ready to use
|
|
129
|
+
*/
|
|
130
|
+
onMapReady?: () => void;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Called continuously during region/camera changes
|
|
134
|
+
* Use for live updates while user is panning/zooming
|
|
135
|
+
* @param region - Current region information
|
|
136
|
+
*/
|
|
137
|
+
onRegionChange?: (region: RegionChangeEvent) => void;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Called after region/camera change has completed
|
|
141
|
+
* Use for final updates after user finishes panning/zooming
|
|
142
|
+
* @param region - Final region information
|
|
143
|
+
*/
|
|
144
|
+
onRegionChangeComplete?: (region: RegionChangeEvent) => void;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Called when any marker on the map is pressed
|
|
148
|
+
* @param event - Contains the marker ID and coordinate
|
|
149
|
+
*/
|
|
150
|
+
onMarkerPress?: (event: MarkerPressEvent) => void;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Called when a draggable marker starts being dragged
|
|
154
|
+
* @param event - Contains the marker ID and starting coordinate
|
|
155
|
+
*/
|
|
156
|
+
onMarkerDragStart?: (event: MarkerDragEvent) => void;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Called continuously while a marker is being dragged
|
|
160
|
+
* @param event - Contains the marker ID and current coordinate
|
|
161
|
+
*/
|
|
162
|
+
onMarkerDrag?: (event: MarkerDragEvent) => void;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Called when a draggable marker is dropped (drag ends)
|
|
166
|
+
* @param event - Contains the marker ID and final coordinate
|
|
167
|
+
*/
|
|
168
|
+
onMarkerDragEnd?: (event: MarkerDragEvent) => void;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Called when a cluster of markers is tapped
|
|
172
|
+
* @param event - Contains the cluster coordinate, marker IDs, and count
|
|
173
|
+
*/
|
|
174
|
+
onClusterPress?: (event: ClusterPressEvent) => void;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Called when an error occurs in the map or marker operations
|
|
178
|
+
* @param error - Error information with code and message
|
|
179
|
+
*/
|
|
180
|
+
onError?: (error: MapError) => void;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Methods available on the NitroMap ref
|
|
185
|
+
* Access via `mapRef.current?.methodName()`
|
|
186
|
+
*/
|
|
187
|
+
export interface NitroMapMethods extends HybridViewMethods {
|
|
188
|
+
/**
|
|
189
|
+
* Animate the map to a new region
|
|
190
|
+
* @param region - Target region to animate to
|
|
191
|
+
* @param duration - Animation duration in milliseconds (default: 500)
|
|
192
|
+
*/
|
|
193
|
+
animateToRegion(region: Region, duration?: number): void;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Fit the map to show all provided coordinates
|
|
197
|
+
* @param coordinates - Array of coordinates to fit
|
|
198
|
+
* @param edgePadding - Optional padding from edges
|
|
199
|
+
* @param animated - Whether to animate the transition (default: true)
|
|
200
|
+
*/
|
|
201
|
+
fitToCoordinates(
|
|
202
|
+
coordinates: Coordinate[],
|
|
203
|
+
edgePadding?: EdgePadding,
|
|
204
|
+
animated?: boolean
|
|
205
|
+
): void;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Animate the camera to a specific position
|
|
209
|
+
* @param camera - Target camera configuration
|
|
210
|
+
* @param duration - Animation duration in milliseconds (default: 500)
|
|
211
|
+
*/
|
|
212
|
+
animateCamera(camera: Camera, duration?: number): void;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Get the current camera position and configuration
|
|
216
|
+
* @returns Promise resolving to current Camera state
|
|
217
|
+
*/
|
|
218
|
+
getCamera(): Promise<Camera>;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Set the camera position instantly (no animation)
|
|
222
|
+
* @param camera - Camera configuration to apply
|
|
223
|
+
*/
|
|
224
|
+
setCamera(camera: Camera): void;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Apply a custom style to the map
|
|
228
|
+
* @param style - Map style array (pass undefined to reset to default)
|
|
229
|
+
*/
|
|
230
|
+
setMapStyle(style?: MapStyle): void;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Get the current visible map boundaries
|
|
234
|
+
* @returns Promise resolving to northeast/southwest corners
|
|
235
|
+
*/
|
|
236
|
+
getMapBoundaries(): Promise<MapBoundaries>;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Enable or disable dark mode styling
|
|
240
|
+
* @param enabled - Whether dark mode should be enabled
|
|
241
|
+
*/
|
|
242
|
+
setIsDarkMode(enabled: boolean): void;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Add a single marker to the map
|
|
246
|
+
* @param marker - Full marker data configuration
|
|
247
|
+
*/
|
|
248
|
+
addMarker(marker: MarkerData): void;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Add multiple markers at once (more efficient than multiple addMarker calls)
|
|
252
|
+
* @param markers - Array of marker data configurations
|
|
253
|
+
*/
|
|
254
|
+
addMarkers(markers: MarkerData[]): void;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Update an existing marker's properties
|
|
258
|
+
* @param marker - Updated marker data (must include existing ID)
|
|
259
|
+
*/
|
|
260
|
+
updateMarker(marker: MarkerData): void;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Remove a marker from the map
|
|
264
|
+
* @param id - ID of the marker to remove
|
|
265
|
+
*/
|
|
266
|
+
removeMarker(id: string): void;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Select/highlight a marker (shows info window if available)
|
|
270
|
+
* @param id - ID of the marker to select
|
|
271
|
+
*/
|
|
272
|
+
selectMarker(id: string): void;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Remove all markers from the map
|
|
276
|
+
*/
|
|
277
|
+
clearMarkers(): void;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Enable or disable marker clustering
|
|
281
|
+
* @param enabled - Whether clustering should be enabled
|
|
282
|
+
*/
|
|
283
|
+
setClusteringEnabled(enabled: boolean): void;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Force recalculation of clusters
|
|
287
|
+
* Call after dynamically adding/removing markers
|
|
288
|
+
*/
|
|
289
|
+
refreshClusters(): void;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export type NitroMap = HybridView<NitroMapProps, NitroMapMethods>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
import type { MapProvider } from '../types/map';
|
|
3
|
+
|
|
4
|
+
export interface NitroMapConfig
|
|
5
|
+
extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
|
|
6
|
+
NitroMapInitialize(apiKey: string, provider: MapProvider): void;
|
|
7
|
+
IsNitroMapInitialized(): boolean;
|
|
8
|
+
}
|
package/src/types/map.ts
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geographic region definition
|
|
3
|
+
* Defines a rectangular region on the map using center point and deltas
|
|
4
|
+
*/
|
|
5
|
+
export type Region = {
|
|
6
|
+
/** Center latitude of the region */
|
|
7
|
+
latitude: number;
|
|
8
|
+
/** Center longitude of the region */
|
|
9
|
+
longitude: number;
|
|
10
|
+
/** Latitude span (height of visible region) */
|
|
11
|
+
latitudeDelta: number;
|
|
12
|
+
/** Longitude span (width of visible region) */
|
|
13
|
+
longitudeDelta: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Geographic coordinate (latitude/longitude pair)
|
|
18
|
+
*/
|
|
19
|
+
export type Coordinate = {
|
|
20
|
+
/** Latitude in degrees (-90 to 90) */
|
|
21
|
+
latitude: number;
|
|
22
|
+
/** Longitude in degrees (-180 to 180) */
|
|
23
|
+
longitude: number;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Map display type
|
|
28
|
+
* - `'standard'` - Normal map with roads and labels
|
|
29
|
+
* - `'satellite'` - Satellite imagery
|
|
30
|
+
* - `'hybrid'` - Satellite with roads/labels overlay
|
|
31
|
+
*/
|
|
32
|
+
export type MapType = 'standard' | 'satellite' | 'hybrid';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Map provider to use for rendering.
|
|
36
|
+
* Currently only `'google'` is implemented. Apple and Yandex will be
|
|
37
|
+
* added once Google Maps is solid on both platforms.
|
|
38
|
+
* - `'google'` - Google Maps (iOS & Android) ✅
|
|
39
|
+
* - `'apple'` - Apple Maps (not yet implemented)
|
|
40
|
+
* - `'yandex'` - Yandex Maps (not yet implemented)
|
|
41
|
+
*/
|
|
42
|
+
export type MapProvider = 'google' | 'apple' | 'yandex';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Screen point (x/y coordinates in pixels)
|
|
46
|
+
*/
|
|
47
|
+
export type Point = {
|
|
48
|
+
/** X coordinate in pixels */
|
|
49
|
+
x: number;
|
|
50
|
+
/** Y coordinate in pixels */
|
|
51
|
+
y: number;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Event data when map is pressed
|
|
56
|
+
*/
|
|
57
|
+
export type MapPressEvent = {
|
|
58
|
+
/** Geographic coordinates of the press location */
|
|
59
|
+
coordinate: Coordinate;
|
|
60
|
+
/** Screen position of the press in pixels */
|
|
61
|
+
position: Point;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Event data during map region changes
|
|
66
|
+
*/
|
|
67
|
+
export type RegionChangeEvent = {
|
|
68
|
+
/** The new/current region */
|
|
69
|
+
region: Region;
|
|
70
|
+
/** Whether the change was caused by user gesture */
|
|
71
|
+
isGesture: boolean;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Padding values for map edges (in pixels)
|
|
76
|
+
*/
|
|
77
|
+
export type EdgePadding = {
|
|
78
|
+
/** Top padding in pixels */
|
|
79
|
+
top: number;
|
|
80
|
+
/** Right padding in pixels */
|
|
81
|
+
right: number;
|
|
82
|
+
/** Bottom padding in pixels */
|
|
83
|
+
bottom: number;
|
|
84
|
+
/** Left padding in pixels */
|
|
85
|
+
left: number;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Camera position and orientation
|
|
90
|
+
*/
|
|
91
|
+
export type Camera = {
|
|
92
|
+
/** Center point the camera is looking at */
|
|
93
|
+
center: Coordinate;
|
|
94
|
+
/** Tilt angle in degrees (0 = looking straight down, 90 = looking at horizon) */
|
|
95
|
+
pitch: number;
|
|
96
|
+
/** Rotation/bearing in degrees (0 = north up) */
|
|
97
|
+
heading: number;
|
|
98
|
+
/** Altitude/elevation in meters */
|
|
99
|
+
altitude: number;
|
|
100
|
+
/** Zoom level (higher = closer) */
|
|
101
|
+
zoom: number;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Visible map boundaries (bounding box)
|
|
106
|
+
*/
|
|
107
|
+
export type MapBoundaries = {
|
|
108
|
+
/** Northeast corner of visible area */
|
|
109
|
+
northEast: Coordinate;
|
|
110
|
+
/** Southwest corner of visible area */
|
|
111
|
+
southWest: Coordinate;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Individual style element for Google Maps styling
|
|
116
|
+
*/
|
|
117
|
+
export type MapStyler = {
|
|
118
|
+
/** Color in hex format (e.g., "#FF0000") */
|
|
119
|
+
color?: string;
|
|
120
|
+
/** Visibility: "on", "off", or "simplified" */
|
|
121
|
+
visibility?: string;
|
|
122
|
+
/** Stroke/line weight in pixels */
|
|
123
|
+
weight?: number;
|
|
124
|
+
/** Color saturation adjustment (-100 to 100) */
|
|
125
|
+
saturation?: number;
|
|
126
|
+
/** Lightness adjustment (-100 to 100) */
|
|
127
|
+
lightness?: number;
|
|
128
|
+
/** Gamma adjustment (0.01 to 10.0) */
|
|
129
|
+
gamma?: number;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Map style element targeting specific features
|
|
134
|
+
* @see https://developers.google.com/maps/documentation/javascript/style-reference
|
|
135
|
+
*/
|
|
136
|
+
export type MapStyleElement = {
|
|
137
|
+
/** Feature type to style (e.g., "road", "water", "poi") */
|
|
138
|
+
featureType?: string;
|
|
139
|
+
/** Element type to style (e.g., "geometry", "labels") */
|
|
140
|
+
elementType?: string;
|
|
141
|
+
/** Style modifications to apply */
|
|
142
|
+
stylers: MapStyler[];
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Complete map style definition
|
|
147
|
+
* Array of style elements to customize map appearance
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* const darkStyle: MapStyle = [
|
|
151
|
+
* { featureType: "all", stylers: [{ saturation: -100 }] },
|
|
152
|
+
* { featureType: "water", stylers: [{ color: "#0e171d" }] }
|
|
153
|
+
* ];
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export type MapStyle = MapStyleElement[];
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Error reported from native map operations
|
|
160
|
+
*/
|
|
161
|
+
export type MapError = {
|
|
162
|
+
/** Error code identifying the type of error */
|
|
163
|
+
code: string;
|
|
164
|
+
/** Human-readable error description */
|
|
165
|
+
message: string;
|
|
166
|
+
};
|