@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.
Files changed (283) hide show
  1. package/LICENSE +20 -0
  2. package/NitroMap.podspec +42 -0
  3. package/README.md +172 -0
  4. package/android/CMakeLists.txt +27 -0
  5. package/android/build.gradle +141 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/src/main/AndroidManifest.xml +3 -0
  8. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  9. package/android/src/main/java/com/margelo/nitro/nitromap/ClusterIconGenerator.kt +108 -0
  10. package/android/src/main/java/com/margelo/nitro/nitromap/ColorUtils.kt +63 -0
  11. package/android/src/main/java/com/margelo/nitro/nitromap/HybridNitroMap.kt +408 -0
  12. package/android/src/main/java/com/margelo/nitro/nitromap/HybridNitroMapConfig.kt +68 -0
  13. package/android/src/main/java/com/margelo/nitro/nitromap/MarkerIconCache.kt +176 -0
  14. package/android/src/main/java/com/margelo/nitro/nitromap/MarkerIconFactory.kt +252 -0
  15. package/android/src/main/java/com/margelo/nitro/nitromap/NitroMapPackage.kt +33 -0
  16. package/android/src/main/java/com/margelo/nitro/nitromap/clustering/NitroClusterEngine.kt +252 -0
  17. package/android/src/main/java/com/margelo/nitro/nitromap/clustering/QuadTree.kt +195 -0
  18. package/android/src/main/java/com/margelo/nitro/nitromap/providers/GoogleMapProvider.kt +912 -0
  19. package/android/src/main/java/com/margelo/nitro/nitromap/providers/MapProviderInterface.kt +70 -0
  20. package/cpp/ClusterEngine.hpp +411 -0
  21. package/cpp/KDBush.hpp +238 -0
  22. package/cpp/QuadTree.hpp +246 -0
  23. package/ios/Clustering/ClusterEngineWrapper.h +58 -0
  24. package/ios/Clustering/ClusterEngineWrapper.mm +142 -0
  25. package/ios/Clustering/ClusterIconRenderer.swift +80 -0
  26. package/ios/Clustering/NitroClusterEngine.swift +117 -0
  27. package/ios/Clustering/NitroClusterIconGenerator.swift +35 -0
  28. package/ios/MarkerRenderer/MarkerIconFactory.swift +322 -0
  29. package/ios/MarkerRenderer/PriceMarkerRenderer.swift +140 -0
  30. package/ios/NitroMap.swift +332 -0
  31. package/ios/NitroMapConfig/HybridNitroMapConfig.swift +33 -0
  32. package/ios/Providers/GoogleMapDelegate.swift +310 -0
  33. package/ios/Providers/GoogleMapProvider+Camera.swift +164 -0
  34. package/ios/Providers/GoogleMapProvider.swift +924 -0
  35. package/ios/Providers/MapProviderProtocol.swift +78 -0
  36. package/ios/Shared/ClusterConfig+Factory.swift +58 -0
  37. package/ios/Shared/ClusteringManager.swift +211 -0
  38. package/ios/Shared/MapStyleProvider.swift +135 -0
  39. package/ios/Shared/MarkerSelectionHandler.swift +116 -0
  40. package/ios/Utils/ColorValueExtension.swift +54 -0
  41. package/lib/module/components/ImageMarker.js +146 -0
  42. package/lib/module/components/ImageMarker.js.map +1 -0
  43. package/lib/module/components/NitroMap.js +320 -0
  44. package/lib/module/components/NitroMap.js.map +1 -0
  45. package/lib/module/components/PriceMarker.js +165 -0
  46. package/lib/module/components/PriceMarker.js.map +1 -0
  47. package/lib/module/context/NitroMapContext.js +15 -0
  48. package/lib/module/context/NitroMapContext.js.map +1 -0
  49. package/lib/module/hooks/useNitroMarker.js +104 -0
  50. package/lib/module/hooks/useNitroMarker.js.map +1 -0
  51. package/lib/module/index.js +21 -0
  52. package/lib/module/index.js.map +1 -0
  53. package/lib/module/modules/index.js +4 -0
  54. package/lib/module/modules/index.js.map +1 -0
  55. package/lib/module/modules/module.js +30 -0
  56. package/lib/module/modules/module.js.map +1 -0
  57. package/lib/module/package.json +1 -0
  58. package/lib/module/specs/NitroMap.nitro.js +4 -0
  59. package/lib/module/specs/NitroMap.nitro.js.map +1 -0
  60. package/lib/module/specs/NitroMapConfig.nitro.js +4 -0
  61. package/lib/module/specs/NitroMapConfig.nitro.js.map +1 -0
  62. package/lib/module/types/map.js +2 -0
  63. package/lib/module/types/map.js.map +1 -0
  64. package/lib/module/types/marker.js +4 -0
  65. package/lib/module/types/marker.js.map +1 -0
  66. package/lib/module/utils/colors.js +147 -0
  67. package/lib/module/utils/colors.js.map +1 -0
  68. package/lib/typescript/package.json +1 -0
  69. package/lib/typescript/src/components/ImageMarker.d.ts +70 -0
  70. package/lib/typescript/src/components/ImageMarker.d.ts.map +1 -0
  71. package/lib/typescript/src/components/NitroMap.d.ts +14 -0
  72. package/lib/typescript/src/components/NitroMap.d.ts.map +1 -0
  73. package/lib/typescript/src/components/PriceMarker.d.ts +88 -0
  74. package/lib/typescript/src/components/PriceMarker.d.ts.map +1 -0
  75. package/lib/typescript/src/context/NitroMapContext.d.ts +16 -0
  76. package/lib/typescript/src/context/NitroMapContext.d.ts.map +1 -0
  77. package/lib/typescript/src/hooks/useNitroMarker.d.ts +78 -0
  78. package/lib/typescript/src/hooks/useNitroMarker.d.ts.map +1 -0
  79. package/lib/typescript/src/index.d.ts +12 -0
  80. package/lib/typescript/src/index.d.ts.map +1 -0
  81. package/lib/typescript/src/modules/index.d.ts +2 -0
  82. package/lib/typescript/src/modules/index.d.ts.map +1 -0
  83. package/lib/typescript/src/modules/module.d.ts +22 -0
  84. package/lib/typescript/src/modules/module.d.ts.map +1 -0
  85. package/lib/typescript/src/specs/NitroMap.nitro.d.ts +227 -0
  86. package/lib/typescript/src/specs/NitroMap.nitro.d.ts.map +1 -0
  87. package/lib/typescript/src/specs/NitroMapConfig.nitro.d.ts +10 -0
  88. package/lib/typescript/src/specs/NitroMapConfig.nitro.d.ts.map +1 -0
  89. package/lib/typescript/src/types/map.d.ts +154 -0
  90. package/lib/typescript/src/types/map.d.ts.map +1 -0
  91. package/lib/typescript/src/types/marker.d.ts +248 -0
  92. package/lib/typescript/src/types/marker.d.ts.map +1 -0
  93. package/lib/typescript/src/utils/colors.d.ts +82 -0
  94. package/lib/typescript/src/utils/colors.d.ts.map +1 -0
  95. package/nitro.json +21 -0
  96. package/nitrogen/generated/android/c++/JCamera.hpp +74 -0
  97. package/nitrogen/generated/android/c++/JClusterAnimationStyle.hpp +68 -0
  98. package/nitrogen/generated/android/c++/JClusterConfig.hpp +121 -0
  99. package/nitrogen/generated/android/c++/JClusterPressEvent.hpp +86 -0
  100. package/nitrogen/generated/android/c++/JClusterStrategy.hpp +59 -0
  101. package/nitrogen/generated/android/c++/JColorValue.cpp +26 -0
  102. package/nitrogen/generated/android/c++/JColorValue.hpp +70 -0
  103. package/nitrogen/generated/android/c++/JCoordinate.hpp +61 -0
  104. package/nitrogen/generated/android/c++/JEdgePadding.hpp +69 -0
  105. package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
  106. package/nitrogen/generated/android/c++/JFunc_void_ClusterPressEvent.hpp +81 -0
  107. package/nitrogen/generated/android/c++/JFunc_void_MapError.hpp +78 -0
  108. package/nitrogen/generated/android/c++/JFunc_void_MapPressEvent.hpp +81 -0
  109. package/nitrogen/generated/android/c++/JFunc_void_MarkerDragEvent.hpp +80 -0
  110. package/nitrogen/generated/android/c++/JFunc_void_MarkerPressEvent.hpp +80 -0
  111. package/nitrogen/generated/android/c++/JFunc_void_RegionChangeEvent.hpp +79 -0
  112. package/nitrogen/generated/android/c++/JHybridNitroMapConfigSpec.cpp +59 -0
  113. package/nitrogen/generated/android/c++/JHybridNitroMapConfigSpec.hpp +66 -0
  114. package/nitrogen/generated/android/c++/JHybridNitroMapSpec.cpp +593 -0
  115. package/nitrogen/generated/android/c++/JHybridNitroMapSpec.hpp +125 -0
  116. package/nitrogen/generated/android/c++/JImageMarkerConfig.hpp +86 -0
  117. package/nitrogen/generated/android/c++/JMapBoundaries.hpp +62 -0
  118. package/nitrogen/generated/android/c++/JMapError.hpp +61 -0
  119. package/nitrogen/generated/android/c++/JMapPressEvent.hpp +64 -0
  120. package/nitrogen/generated/android/c++/JMapProvider.hpp +62 -0
  121. package/nitrogen/generated/android/c++/JMapStyleElement.hpp +87 -0
  122. package/nitrogen/generated/android/c++/JMapStyler.hpp +78 -0
  123. package/nitrogen/generated/android/c++/JMapType.hpp +62 -0
  124. package/nitrogen/generated/android/c++/JMarkerAnimation.hpp +62 -0
  125. package/nitrogen/generated/android/c++/JMarkerColor.hpp +69 -0
  126. package/nitrogen/generated/android/c++/JMarkerConfig.hpp +77 -0
  127. package/nitrogen/generated/android/c++/JMarkerData.hpp +121 -0
  128. package/nitrogen/generated/android/c++/JMarkerDragEvent.hpp +63 -0
  129. package/nitrogen/generated/android/c++/JMarkerPressEvent.hpp +63 -0
  130. package/nitrogen/generated/android/c++/JMarkerStyle.hpp +62 -0
  131. package/nitrogen/generated/android/c++/JPoint.hpp +61 -0
  132. package/nitrogen/generated/android/c++/JPriceMarkerStyle.hpp +102 -0
  133. package/nitrogen/generated/android/c++/JRegion.hpp +69 -0
  134. package/nitrogen/generated/android/c++/JRegionChangeEvent.hpp +62 -0
  135. package/nitrogen/generated/android/c++/JVariant_String_MarkerColor.cpp +26 -0
  136. package/nitrogen/generated/android/c++/JVariant_String_MarkerColor.hpp +70 -0
  137. package/nitrogen/generated/android/c++/views/JHybridNitroMapStateUpdater.cpp +144 -0
  138. package/nitrogen/generated/android/c++/views/JHybridNitroMapStateUpdater.hpp +49 -0
  139. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Camera.kt +50 -0
  140. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ClusterAnimationStyle.kt +24 -0
  141. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ClusterConfig.kt +80 -0
  142. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ClusterPressEvent.kt +44 -0
  143. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ClusterStrategy.kt +21 -0
  144. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ColorValue.kt +59 -0
  145. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Coordinate.kt +41 -0
  146. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/EdgePadding.kt +47 -0
  147. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void.kt +80 -0
  148. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_ClusterPressEvent.kt +80 -0
  149. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_MapError.kt +80 -0
  150. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_MapPressEvent.kt +80 -0
  151. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_MarkerDragEvent.kt +80 -0
  152. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_MarkerPressEvent.kt +80 -0
  153. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Func_void_RegionChangeEvent.kt +80 -0
  154. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/HybridNitroMapConfigSpec.kt +61 -0
  155. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/HybridNitroMapSpec.kt +342 -0
  156. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/ImageMarkerConfig.kt +56 -0
  157. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapBoundaries.kt +41 -0
  158. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapError.kt +41 -0
  159. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapPressEvent.kt +41 -0
  160. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapProvider.kt +22 -0
  161. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapStyleElement.kt +44 -0
  162. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapStyler.kt +53 -0
  163. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MapType.kt +22 -0
  164. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerAnimation.kt +22 -0
  165. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerColor.kt +47 -0
  166. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerConfig.kt +44 -0
  167. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerData.kt +71 -0
  168. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerDragEvent.kt +41 -0
  169. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerPressEvent.kt +41 -0
  170. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/MarkerStyle.kt +22 -0
  171. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Point.kt +41 -0
  172. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/PriceMarkerStyle.kt +68 -0
  173. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Region.kt +47 -0
  174. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/RegionChangeEvent.kt +41 -0
  175. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/Variant_String_MarkerColor.kt +59 -0
  176. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/nitromapOnLoad.kt +35 -0
  177. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/views/HybridNitroMapManager.kt +50 -0
  178. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitromap/views/HybridNitroMapStateUpdater.kt +23 -0
  179. package/nitrogen/generated/android/nitromap+autolinking.cmake +87 -0
  180. package/nitrogen/generated/android/nitromap+autolinking.gradle +27 -0
  181. package/nitrogen/generated/android/nitromapOnLoad.cpp +70 -0
  182. package/nitrogen/generated/android/nitromapOnLoad.hpp +25 -0
  183. package/nitrogen/generated/ios/NitroMap+autolinking.rb +60 -0
  184. package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Bridge.cpp +130 -0
  185. package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Bridge.hpp +793 -0
  186. package/nitrogen/generated/ios/NitroMap-Swift-Cxx-Umbrella.hpp +132 -0
  187. package/nitrogen/generated/ios/NitroMapAutolinking.mm +41 -0
  188. package/nitrogen/generated/ios/NitroMapAutolinking.swift +40 -0
  189. package/nitrogen/generated/ios/c++/HybridNitroMapConfigSpecSwift.cpp +11 -0
  190. package/nitrogen/generated/ios/c++/HybridNitroMapConfigSpecSwift.hpp +84 -0
  191. package/nitrogen/generated/ios/c++/HybridNitroMapSpecSwift.cpp +11 -0
  192. package/nitrogen/generated/ios/c++/HybridNitroMapSpecSwift.hpp +410 -0
  193. package/nitrogen/generated/ios/c++/views/HybridNitroMapComponent.mm +206 -0
  194. package/nitrogen/generated/ios/swift/Camera.swift +80 -0
  195. package/nitrogen/generated/ios/swift/ClusterAnimationStyle.swift +52 -0
  196. package/nitrogen/generated/ios/swift/ClusterConfig.swift +268 -0
  197. package/nitrogen/generated/ios/swift/ClusterPressEvent.swift +70 -0
  198. package/nitrogen/generated/ios/swift/ClusterStrategy.swift +40 -0
  199. package/nitrogen/generated/ios/swift/ColorValue.swift +18 -0
  200. package/nitrogen/generated/ios/swift/Coordinate.swift +47 -0
  201. package/nitrogen/generated/ios/swift/EdgePadding.swift +69 -0
  202. package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
  203. package/nitrogen/generated/ios/swift/Func_void_Camera.swift +47 -0
  204. package/nitrogen/generated/ios/swift/Func_void_ClusterPressEvent.swift +47 -0
  205. package/nitrogen/generated/ios/swift/Func_void_MapBoundaries.swift +47 -0
  206. package/nitrogen/generated/ios/swift/Func_void_MapError.swift +47 -0
  207. package/nitrogen/generated/ios/swift/Func_void_MapPressEvent.swift +47 -0
  208. package/nitrogen/generated/ios/swift/Func_void_MarkerDragEvent.swift +47 -0
  209. package/nitrogen/generated/ios/swift/Func_void_MarkerPressEvent.swift +47 -0
  210. package/nitrogen/generated/ios/swift/Func_void_RegionChangeEvent.swift +47 -0
  211. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  212. package/nitrogen/generated/ios/swift/HybridNitroMapConfigSpec.swift +57 -0
  213. package/nitrogen/generated/ios/swift/HybridNitroMapConfigSpec_cxx.swift +142 -0
  214. package/nitrogen/generated/ios/swift/HybridNitroMapSpec.swift +93 -0
  215. package/nitrogen/generated/ios/swift/HybridNitroMapSpec_cxx.swift +953 -0
  216. package/nitrogen/generated/ios/swift/ImageMarkerConfig.swift +166 -0
  217. package/nitrogen/generated/ios/swift/MapBoundaries.swift +47 -0
  218. package/nitrogen/generated/ios/swift/MapError.swift +47 -0
  219. package/nitrogen/generated/ios/swift/MapPressEvent.swift +47 -0
  220. package/nitrogen/generated/ios/swift/MapProvider.swift +44 -0
  221. package/nitrogen/generated/ios/swift/MapStyleElement.swift +108 -0
  222. package/nitrogen/generated/ios/swift/MapStyler.swift +177 -0
  223. package/nitrogen/generated/ios/swift/MapType.swift +44 -0
  224. package/nitrogen/generated/ios/swift/MarkerAnimation.swift +44 -0
  225. package/nitrogen/generated/ios/swift/MarkerColor.swift +69 -0
  226. package/nitrogen/generated/ios/swift/MarkerConfig.swift +82 -0
  227. package/nitrogen/generated/ios/swift/MarkerData.swift +195 -0
  228. package/nitrogen/generated/ios/swift/MarkerDragEvent.swift +47 -0
  229. package/nitrogen/generated/ios/swift/MarkerPressEvent.swift +47 -0
  230. package/nitrogen/generated/ios/swift/MarkerStyle.swift +44 -0
  231. package/nitrogen/generated/ios/swift/Point.swift +47 -0
  232. package/nitrogen/generated/ios/swift/PriceMarkerStyle.swift +374 -0
  233. package/nitrogen/generated/ios/swift/Region.swift +69 -0
  234. package/nitrogen/generated/ios/swift/RegionChangeEvent.swift +47 -0
  235. package/nitrogen/generated/ios/swift/Variant_String_MarkerColor.swift +18 -0
  236. package/nitrogen/generated/shared/c++/Camera.hpp +92 -0
  237. package/nitrogen/generated/shared/c++/ClusterAnimationStyle.hpp +88 -0
  238. package/nitrogen/generated/shared/c++/ClusterConfig.hpp +140 -0
  239. package/nitrogen/generated/shared/c++/ClusterPressEvent.hpp +86 -0
  240. package/nitrogen/generated/shared/c++/ClusterStrategy.hpp +76 -0
  241. package/nitrogen/generated/shared/c++/Coordinate.hpp +79 -0
  242. package/nitrogen/generated/shared/c++/EdgePadding.hpp +87 -0
  243. package/nitrogen/generated/shared/c++/HybridNitroMapConfigSpec.cpp +22 -0
  244. package/nitrogen/generated/shared/c++/HybridNitroMapConfigSpec.hpp +65 -0
  245. package/nitrogen/generated/shared/c++/HybridNitroMapSpec.cpp +82 -0
  246. package/nitrogen/generated/shared/c++/HybridNitroMapSpec.hpp +173 -0
  247. package/nitrogen/generated/shared/c++/ImageMarkerConfig.hpp +103 -0
  248. package/nitrogen/generated/shared/c++/MapBoundaries.hpp +80 -0
  249. package/nitrogen/generated/shared/c++/MapError.hpp +79 -0
  250. package/nitrogen/generated/shared/c++/MapPressEvent.hpp +83 -0
  251. package/nitrogen/generated/shared/c++/MapProvider.hpp +80 -0
  252. package/nitrogen/generated/shared/c++/MapStyleElement.hpp +87 -0
  253. package/nitrogen/generated/shared/c++/MapStyler.hpp +96 -0
  254. package/nitrogen/generated/shared/c++/MapType.hpp +80 -0
  255. package/nitrogen/generated/shared/c++/MarkerAnimation.hpp +80 -0
  256. package/nitrogen/generated/shared/c++/MarkerColor.hpp +87 -0
  257. package/nitrogen/generated/shared/c++/MarkerConfig.hpp +91 -0
  258. package/nitrogen/generated/shared/c++/MarkerData.hpp +131 -0
  259. package/nitrogen/generated/shared/c++/MarkerDragEvent.hpp +81 -0
  260. package/nitrogen/generated/shared/c++/MarkerPressEvent.hpp +81 -0
  261. package/nitrogen/generated/shared/c++/MarkerStyle.hpp +80 -0
  262. package/nitrogen/generated/shared/c++/Point.hpp +79 -0
  263. package/nitrogen/generated/shared/c++/PriceMarkerStyle.hpp +119 -0
  264. package/nitrogen/generated/shared/c++/Region.hpp +87 -0
  265. package/nitrogen/generated/shared/c++/RegionChangeEvent.hpp +80 -0
  266. package/nitrogen/generated/shared/c++/views/HybridNitroMapComponent.cpp +351 -0
  267. package/nitrogen/generated/shared/c++/views/HybridNitroMapComponent.hpp +141 -0
  268. package/nitrogen/generated/shared/json/NitroMapConfig.json +32 -0
  269. package/package.json +176 -0
  270. package/react-native.config.js +16 -0
  271. package/src/components/ImageMarker.tsx +254 -0
  272. package/src/components/NitroMap.tsx +433 -0
  273. package/src/components/PriceMarker.tsx +311 -0
  274. package/src/context/NitroMapContext.tsx +33 -0
  275. package/src/hooks/useNitroMarker.ts +198 -0
  276. package/src/index.tsx +62 -0
  277. package/src/modules/index.ts +6 -0
  278. package/src/modules/module.ts +45 -0
  279. package/src/specs/NitroMap.nitro.ts +292 -0
  280. package/src/specs/NitroMapConfig.nitro.ts +8 -0
  281. package/src/types/map.ts +166 -0
  282. package/src/types/marker.ts +267 -0
  283. 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
+ }
@@ -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
+ };