@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,102 @@
1
+ ///
2
+ /// JPriceMarkerStyle.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 "PriceMarkerStyle.hpp"
12
+
13
+ #include "JMarkerColor.hpp"
14
+ #include "JVariant_String_MarkerColor.hpp"
15
+ #include "MarkerColor.hpp"
16
+ #include <optional>
17
+ #include <string>
18
+ #include <variant>
19
+
20
+ namespace margelo::nitro::nitromap {
21
+
22
+ using namespace facebook;
23
+
24
+ /**
25
+ * The C++ JNI bridge between the C++ struct "PriceMarkerStyle" and the the Kotlin data class "PriceMarkerStyle".
26
+ */
27
+ struct JPriceMarkerStyle final: public jni::JavaClass<JPriceMarkerStyle> {
28
+ public:
29
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/PriceMarkerStyle;";
30
+
31
+ public:
32
+ /**
33
+ * Convert this Java/Kotlin-based struct to the C++ struct PriceMarkerStyle by copying all values to C++.
34
+ */
35
+ [[maybe_unused]]
36
+ [[nodiscard]]
37
+ PriceMarkerStyle toCpp() const {
38
+ static const auto clazz = javaClassStatic();
39
+ static const auto fieldPrice = clazz->getField<jni::JString>("price");
40
+ jni::local_ref<jni::JString> price = this->getFieldValue(fieldPrice);
41
+ static const auto fieldCurrency = clazz->getField<jni::JString>("currency");
42
+ jni::local_ref<jni::JString> currency = this->getFieldValue(fieldCurrency);
43
+ static const auto fieldSelected = clazz->getField<jboolean>("selected");
44
+ jboolean selected = this->getFieldValue(fieldSelected);
45
+ static const auto fieldBackgroundColor = clazz->getField<JVariant_String_MarkerColor>("backgroundColor");
46
+ jni::local_ref<JVariant_String_MarkerColor> backgroundColor = this->getFieldValue(fieldBackgroundColor);
47
+ static const auto fieldSelectedBackgroundColor = clazz->getField<JVariant_String_MarkerColor>("selectedBackgroundColor");
48
+ jni::local_ref<JVariant_String_MarkerColor> selectedBackgroundColor = this->getFieldValue(fieldSelectedBackgroundColor);
49
+ static const auto fieldTextColor = clazz->getField<JVariant_String_MarkerColor>("textColor");
50
+ jni::local_ref<JVariant_String_MarkerColor> textColor = this->getFieldValue(fieldTextColor);
51
+ static const auto fieldSelectedTextColor = clazz->getField<JVariant_String_MarkerColor>("selectedTextColor");
52
+ jni::local_ref<JVariant_String_MarkerColor> selectedTextColor = this->getFieldValue(fieldSelectedTextColor);
53
+ static const auto fieldFontSize = clazz->getField<jni::JDouble>("fontSize");
54
+ jni::local_ref<jni::JDouble> fontSize = this->getFieldValue(fieldFontSize);
55
+ static const auto fieldPaddingHorizontal = clazz->getField<jni::JDouble>("paddingHorizontal");
56
+ jni::local_ref<jni::JDouble> paddingHorizontal = this->getFieldValue(fieldPaddingHorizontal);
57
+ static const auto fieldPaddingVertical = clazz->getField<jni::JDouble>("paddingVertical");
58
+ jni::local_ref<jni::JDouble> paddingVertical = this->getFieldValue(fieldPaddingVertical);
59
+ static const auto fieldShadowOpacity = clazz->getField<jni::JDouble>("shadowOpacity");
60
+ jni::local_ref<jni::JDouble> shadowOpacity = this->getFieldValue(fieldShadowOpacity);
61
+ return PriceMarkerStyle(
62
+ price->toStdString(),
63
+ currency->toStdString(),
64
+ static_cast<bool>(selected),
65
+ backgroundColor != nullptr ? std::make_optional(backgroundColor->toCpp()) : std::nullopt,
66
+ selectedBackgroundColor != nullptr ? std::make_optional(selectedBackgroundColor->toCpp()) : std::nullopt,
67
+ textColor != nullptr ? std::make_optional(textColor->toCpp()) : std::nullopt,
68
+ selectedTextColor != nullptr ? std::make_optional(selectedTextColor->toCpp()) : std::nullopt,
69
+ fontSize != nullptr ? std::make_optional(fontSize->value()) : std::nullopt,
70
+ paddingHorizontal != nullptr ? std::make_optional(paddingHorizontal->value()) : std::nullopt,
71
+ paddingVertical != nullptr ? std::make_optional(paddingVertical->value()) : std::nullopt,
72
+ shadowOpacity != nullptr ? std::make_optional(shadowOpacity->value()) : std::nullopt
73
+ );
74
+ }
75
+
76
+ public:
77
+ /**
78
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
79
+ */
80
+ [[maybe_unused]]
81
+ static jni::local_ref<JPriceMarkerStyle::javaobject> fromCpp(const PriceMarkerStyle& value) {
82
+ using JSignature = JPriceMarkerStyle(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jboolean, jni::alias_ref<JVariant_String_MarkerColor>, jni::alias_ref<JVariant_String_MarkerColor>, jni::alias_ref<JVariant_String_MarkerColor>, jni::alias_ref<JVariant_String_MarkerColor>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>);
83
+ static const auto clazz = javaClassStatic();
84
+ static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
85
+ return create(
86
+ clazz,
87
+ jni::make_jstring(value.price),
88
+ jni::make_jstring(value.currency),
89
+ value.selected,
90
+ value.backgroundColor.has_value() ? JVariant_String_MarkerColor::fromCpp(value.backgroundColor.value()) : nullptr,
91
+ value.selectedBackgroundColor.has_value() ? JVariant_String_MarkerColor::fromCpp(value.selectedBackgroundColor.value()) : nullptr,
92
+ value.textColor.has_value() ? JVariant_String_MarkerColor::fromCpp(value.textColor.value()) : nullptr,
93
+ value.selectedTextColor.has_value() ? JVariant_String_MarkerColor::fromCpp(value.selectedTextColor.value()) : nullptr,
94
+ value.fontSize.has_value() ? jni::JDouble::valueOf(value.fontSize.value()) : nullptr,
95
+ value.paddingHorizontal.has_value() ? jni::JDouble::valueOf(value.paddingHorizontal.value()) : nullptr,
96
+ value.paddingVertical.has_value() ? jni::JDouble::valueOf(value.paddingVertical.value()) : nullptr,
97
+ value.shadowOpacity.has_value() ? jni::JDouble::valueOf(value.shadowOpacity.value()) : nullptr
98
+ );
99
+ }
100
+ };
101
+
102
+ } // namespace margelo::nitro::nitromap
@@ -0,0 +1,69 @@
1
+ ///
2
+ /// JRegion.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 "Region.hpp"
12
+
13
+
14
+
15
+ namespace margelo::nitro::nitromap {
16
+
17
+ using namespace facebook;
18
+
19
+ /**
20
+ * The C++ JNI bridge between the C++ struct "Region" and the the Kotlin data class "Region".
21
+ */
22
+ struct JRegion final: public jni::JavaClass<JRegion> {
23
+ public:
24
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/Region;";
25
+
26
+ public:
27
+ /**
28
+ * Convert this Java/Kotlin-based struct to the C++ struct Region by copying all values to C++.
29
+ */
30
+ [[maybe_unused]]
31
+ [[nodiscard]]
32
+ Region toCpp() const {
33
+ static const auto clazz = javaClassStatic();
34
+ static const auto fieldLatitude = clazz->getField<double>("latitude");
35
+ double latitude = this->getFieldValue(fieldLatitude);
36
+ static const auto fieldLongitude = clazz->getField<double>("longitude");
37
+ double longitude = this->getFieldValue(fieldLongitude);
38
+ static const auto fieldLatitudeDelta = clazz->getField<double>("latitudeDelta");
39
+ double latitudeDelta = this->getFieldValue(fieldLatitudeDelta);
40
+ static const auto fieldLongitudeDelta = clazz->getField<double>("longitudeDelta");
41
+ double longitudeDelta = this->getFieldValue(fieldLongitudeDelta);
42
+ return Region(
43
+ latitude,
44
+ longitude,
45
+ latitudeDelta,
46
+ longitudeDelta
47
+ );
48
+ }
49
+
50
+ public:
51
+ /**
52
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
53
+ */
54
+ [[maybe_unused]]
55
+ static jni::local_ref<JRegion::javaobject> fromCpp(const Region& value) {
56
+ using JSignature = JRegion(double, double, double, double);
57
+ static const auto clazz = javaClassStatic();
58
+ static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
59
+ return create(
60
+ clazz,
61
+ value.latitude,
62
+ value.longitude,
63
+ value.latitudeDelta,
64
+ value.longitudeDelta
65
+ );
66
+ }
67
+ };
68
+
69
+ } // namespace margelo::nitro::nitromap
@@ -0,0 +1,62 @@
1
+ ///
2
+ /// JRegionChangeEvent.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 "RegionChangeEvent.hpp"
12
+
13
+ #include "JRegion.hpp"
14
+ #include "Region.hpp"
15
+
16
+ namespace margelo::nitro::nitromap {
17
+
18
+ using namespace facebook;
19
+
20
+ /**
21
+ * The C++ JNI bridge between the C++ struct "RegionChangeEvent" and the the Kotlin data class "RegionChangeEvent".
22
+ */
23
+ struct JRegionChangeEvent final: public jni::JavaClass<JRegionChangeEvent> {
24
+ public:
25
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/RegionChangeEvent;";
26
+
27
+ public:
28
+ /**
29
+ * Convert this Java/Kotlin-based struct to the C++ struct RegionChangeEvent by copying all values to C++.
30
+ */
31
+ [[maybe_unused]]
32
+ [[nodiscard]]
33
+ RegionChangeEvent toCpp() const {
34
+ static const auto clazz = javaClassStatic();
35
+ static const auto fieldRegion = clazz->getField<JRegion>("region");
36
+ jni::local_ref<JRegion> region = this->getFieldValue(fieldRegion);
37
+ static const auto fieldIsGesture = clazz->getField<jboolean>("isGesture");
38
+ jboolean isGesture = this->getFieldValue(fieldIsGesture);
39
+ return RegionChangeEvent(
40
+ region->toCpp(),
41
+ static_cast<bool>(isGesture)
42
+ );
43
+ }
44
+
45
+ public:
46
+ /**
47
+ * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
48
+ */
49
+ [[maybe_unused]]
50
+ static jni::local_ref<JRegionChangeEvent::javaobject> fromCpp(const RegionChangeEvent& value) {
51
+ using JSignature = JRegionChangeEvent(jni::alias_ref<JRegion>, jboolean);
52
+ static const auto clazz = javaClassStatic();
53
+ static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
54
+ return create(
55
+ clazz,
56
+ JRegion::fromCpp(value.region),
57
+ value.isGesture
58
+ );
59
+ }
60
+ };
61
+
62
+ } // namespace margelo::nitro::nitromap
@@ -0,0 +1,26 @@
1
+ ///
2
+ /// JVariant_String_MarkerColor.cpp
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
+ #include "JVariant_String_MarkerColor.hpp"
9
+
10
+ namespace margelo::nitro::nitromap {
11
+ /**
12
+ * Converts JVariant_String_MarkerColor to std::variant<std::string, MarkerColor>
13
+ */
14
+ std::variant<std::string, MarkerColor> JVariant_String_MarkerColor::toCpp() const {
15
+ if (isInstanceOf(JVariant_String_MarkerColor_impl::First::javaClassStatic())) {
16
+ // It's a `std::string`
17
+ auto jniValue = static_cast<const JVariant_String_MarkerColor_impl::First*>(this)->getValue();
18
+ return jniValue->toStdString();
19
+ } else if (isInstanceOf(JVariant_String_MarkerColor_impl::Second::javaClassStatic())) {
20
+ // It's a `MarkerColor`
21
+ auto jniValue = static_cast<const JVariant_String_MarkerColor_impl::Second*>(this)->getValue();
22
+ return jniValue->toCpp();
23
+ }
24
+ throw std::invalid_argument("Variant is unknown Kotlin instance!");
25
+ }
26
+ } // namespace margelo::nitro::nitromap
@@ -0,0 +1,70 @@
1
+ ///
2
+ /// JVariant_String_MarkerColor.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 <variant>
12
+
13
+ #include <string>
14
+ #include "MarkerColor.hpp"
15
+ #include <variant>
16
+ #include "JMarkerColor.hpp"
17
+
18
+ namespace margelo::nitro::nitromap {
19
+
20
+ using namespace facebook;
21
+
22
+ /**
23
+ * The C++ JNI bridge between the C++ std::variant and the Java class "Variant_String_MarkerColor".
24
+ */
25
+ class JVariant_String_MarkerColor: public jni::JavaClass<JVariant_String_MarkerColor> {
26
+ public:
27
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/Variant_String_MarkerColor;";
28
+
29
+ static jni::local_ref<JVariant_String_MarkerColor> create_0(jni::alias_ref<jni::JString> value) {
30
+ static const auto method = javaClassStatic()->getStaticMethod<JVariant_String_MarkerColor(jni::alias_ref<jni::JString>)>("create");
31
+ return method(javaClassStatic(), value);
32
+ }
33
+ static jni::local_ref<JVariant_String_MarkerColor> create_1(jni::alias_ref<JMarkerColor> value) {
34
+ static const auto method = javaClassStatic()->getStaticMethod<JVariant_String_MarkerColor(jni::alias_ref<JMarkerColor>)>("create");
35
+ return method(javaClassStatic(), value);
36
+ }
37
+
38
+ static jni::local_ref<JVariant_String_MarkerColor> fromCpp(const std::variant<std::string, MarkerColor>& variant) {
39
+ switch (variant.index()) {
40
+ case 0: return create_0(jni::make_jstring(std::get<0>(variant)));
41
+ case 1: return create_1(JMarkerColor::fromCpp(std::get<1>(variant)));
42
+ default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")");
43
+ }
44
+ }
45
+
46
+ [[nodiscard]] std::variant<std::string, MarkerColor> toCpp() const;
47
+ };
48
+
49
+ namespace JVariant_String_MarkerColor_impl {
50
+ class First: public jni::JavaClass<First, JVariant_String_MarkerColor> {
51
+ public:
52
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/Variant_String_MarkerColor$First;";
53
+
54
+ [[nodiscard]] jni::local_ref<jni::JString> getValue() const {
55
+ static const auto field = javaClassStatic()->getField<jni::JString>("value");
56
+ return getFieldValue(field);
57
+ }
58
+ };
59
+
60
+ class Second: public jni::JavaClass<Second, JVariant_String_MarkerColor> {
61
+ public:
62
+ static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitromap/Variant_String_MarkerColor$Second;";
63
+
64
+ [[nodiscard]] jni::local_ref<JMarkerColor> getValue() const {
65
+ static const auto field = javaClassStatic()->getField<JMarkerColor>("value");
66
+ return getFieldValue(field);
67
+ }
68
+ };
69
+ } // namespace JVariant_String_MarkerColor_impl
70
+ } // namespace margelo::nitro::nitromap
@@ -0,0 +1,144 @@
1
+ ///
2
+ /// JHybridNitroMapStateUpdater.cpp
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
+ #include "JHybridNitroMapStateUpdater.hpp"
9
+ #include "views/HybridNitroMapComponent.hpp"
10
+ #include <NitroModules/NitroDefines.hpp>
11
+
12
+ namespace margelo::nitro::nitromap::views {
13
+
14
+ using namespace facebook;
15
+ using ConcreteStateData = react::ConcreteState<HybridNitroMapState>;
16
+
17
+ void JHybridNitroMapStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /* class */,
18
+ jni::alias_ref<JHybridNitroMapSpec::javaobject> javaView,
19
+ jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface) {
20
+ JHybridNitroMapSpec* view = javaView->cthis();
21
+
22
+ // Get concrete StateWrapperImpl from passed StateWrapper interface object
23
+ jobject rawStateWrapper = stateWrapperInterface.get();
24
+ if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) {
25
+ throw std::runtime_error("StateWrapper is not a StateWrapperImpl");
26
+ }
27
+ auto stateWrapper = jni::alias_ref<react::StateWrapperImpl::javaobject>{
28
+ static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};
29
+
30
+ std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
31
+ auto concreteState = std::dynamic_pointer_cast<const ConcreteStateData>(state);
32
+ const HybridNitroMapState& data = concreteState->getData();
33
+ const std::optional<HybridNitroMapProps>& maybeProps = data.getProps();
34
+ if (!maybeProps.has_value()) {
35
+ // Props aren't set yet!
36
+ throw std::runtime_error("HybridNitroMapState's data doesn't contain any props!");
37
+ }
38
+ const HybridNitroMapProps& props = maybeProps.value();
39
+ if (props.provider.isDirty) {
40
+ view->setProvider(props.provider.value);
41
+ // TODO: Set isDirty = false
42
+ }
43
+ if (props.initialRegion.isDirty) {
44
+ view->setInitialRegion(props.initialRegion.value);
45
+ // TODO: Set isDirty = false
46
+ }
47
+ if (props.showsUserLocation.isDirty) {
48
+ view->setShowsUserLocation(props.showsUserLocation.value);
49
+ // TODO: Set isDirty = false
50
+ }
51
+ if (props.zoomEnabled.isDirty) {
52
+ view->setZoomEnabled(props.zoomEnabled.value);
53
+ // TODO: Set isDirty = false
54
+ }
55
+ if (props.scrollEnabled.isDirty) {
56
+ view->setScrollEnabled(props.scrollEnabled.value);
57
+ // TODO: Set isDirty = false
58
+ }
59
+ if (props.rotateEnabled.isDirty) {
60
+ view->setRotateEnabled(props.rotateEnabled.value);
61
+ // TODO: Set isDirty = false
62
+ }
63
+ if (props.pitchEnabled.isDirty) {
64
+ view->setPitchEnabled(props.pitchEnabled.value);
65
+ // TODO: Set isDirty = false
66
+ }
67
+ if (props.mapType.isDirty) {
68
+ view->setMapType(props.mapType.value);
69
+ // TODO: Set isDirty = false
70
+ }
71
+ if (props.customMapStyle.isDirty) {
72
+ view->setCustomMapStyle(props.customMapStyle.value);
73
+ // TODO: Set isDirty = false
74
+ }
75
+ if (props.showsMyLocationButton.isDirty) {
76
+ view->setShowsMyLocationButton(props.showsMyLocationButton.value);
77
+ // TODO: Set isDirty = false
78
+ }
79
+ if (props.clusterConfig.isDirty) {
80
+ view->setClusterConfig(props.clusterConfig.value);
81
+ // TODO: Set isDirty = false
82
+ }
83
+ if (props.darkMode.isDirty) {
84
+ view->setDarkMode(props.darkMode.value);
85
+ // TODO: Set isDirty = false
86
+ }
87
+ if (props.onPress.isDirty) {
88
+ view->setOnPress(props.onPress.value);
89
+ // TODO: Set isDirty = false
90
+ }
91
+ if (props.onLongPress.isDirty) {
92
+ view->setOnLongPress(props.onLongPress.value);
93
+ // TODO: Set isDirty = false
94
+ }
95
+ if (props.onMapReady.isDirty) {
96
+ view->setOnMapReady(props.onMapReady.value);
97
+ // TODO: Set isDirty = false
98
+ }
99
+ if (props.onRegionChange.isDirty) {
100
+ view->setOnRegionChange(props.onRegionChange.value);
101
+ // TODO: Set isDirty = false
102
+ }
103
+ if (props.onRegionChangeComplete.isDirty) {
104
+ view->setOnRegionChangeComplete(props.onRegionChangeComplete.value);
105
+ // TODO: Set isDirty = false
106
+ }
107
+ if (props.onMarkerPress.isDirty) {
108
+ view->setOnMarkerPress(props.onMarkerPress.value);
109
+ // TODO: Set isDirty = false
110
+ }
111
+ if (props.onMarkerDragStart.isDirty) {
112
+ view->setOnMarkerDragStart(props.onMarkerDragStart.value);
113
+ // TODO: Set isDirty = false
114
+ }
115
+ if (props.onMarkerDrag.isDirty) {
116
+ view->setOnMarkerDrag(props.onMarkerDrag.value);
117
+ // TODO: Set isDirty = false
118
+ }
119
+ if (props.onMarkerDragEnd.isDirty) {
120
+ view->setOnMarkerDragEnd(props.onMarkerDragEnd.value);
121
+ // TODO: Set isDirty = false
122
+ }
123
+ if (props.onClusterPress.isDirty) {
124
+ view->setOnClusterPress(props.onClusterPress.value);
125
+ // TODO: Set isDirty = false
126
+ }
127
+ if (props.onError.isDirty) {
128
+ view->setOnError(props.onError.value);
129
+ // TODO: Set isDirty = false
130
+ }
131
+
132
+ // Update hybridRef if it changed
133
+ if (props.hybridRef.isDirty) {
134
+ // hybridRef changed - call it with new this
135
+ const auto& maybeFunc = props.hybridRef.value;
136
+ if (maybeFunc.has_value()) {
137
+ std::shared_ptr<JHybridNitroMapSpec> shared = javaView->cthis()->shared_cast<JHybridNitroMapSpec>();
138
+ maybeFunc.value()(shared);
139
+ }
140
+ // TODO: Set isDirty = false
141
+ }
142
+ }
143
+
144
+ } // namespace margelo::nitro::nitromap::views
@@ -0,0 +1,49 @@
1
+ ///
2
+ /// JHybridNitroMapStateUpdater.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
+ #ifndef RN_SERIALIZABLE_STATE
11
+ #error nitromap was compiled without the 'RN_SERIALIZABLE_STATE' flag. This flag is required for Nitro Views - set it in your CMakeLists!
12
+ #endif
13
+
14
+ #include <fbjni/fbjni.h>
15
+ #include <react/fabric/StateWrapperImpl.h>
16
+ #include <react/fabric/CoreComponentsRegistry.h>
17
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
18
+ #include <NitroModules/NitroDefines.hpp>
19
+ #include <NitroModules/JStateWrapper.hpp>
20
+ #include "JHybridNitroMapSpec.hpp"
21
+ #include "views/HybridNitroMapComponent.hpp"
22
+
23
+ namespace margelo::nitro::nitromap::views {
24
+
25
+ using namespace facebook;
26
+
27
+ class JHybridNitroMapStateUpdater: public jni::JavaClass<JHybridNitroMapStateUpdater> {
28
+ public:
29
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitromap/views/HybridNitroMapStateUpdater;";
30
+
31
+ public:
32
+ static void updateViewProps(jni::alias_ref<jni::JClass> /* class */,
33
+ jni::alias_ref<JHybridNitroMapSpec::javaobject> view,
34
+ jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface);
35
+
36
+ public:
37
+ static void registerNatives() {
38
+ // Register JNI calls
39
+ javaClassStatic()->registerNatives({
40
+ makeNativeMethod("updateViewProps", JHybridNitroMapStateUpdater::updateViewProps),
41
+ });
42
+ // Register React Native view component descriptor
43
+ auto provider = react::concreteComponentDescriptorProvider<HybridNitroMapComponentDescriptor>();
44
+ auto providerRegistry = react::CoreComponentsRegistry::sharedProviderRegistry();
45
+ providerRegistry->add(provider);
46
+ }
47
+ };
48
+
49
+ } // namespace margelo::nitro::nitromap::views
@@ -0,0 +1,50 @@
1
+ ///
2
+ /// Camera.kt
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
+ package com.margelo.nitro.nitromap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "Camera".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class Camera(
20
+ @DoNotStrip
21
+ @Keep
22
+ val center: Coordinate,
23
+ @DoNotStrip
24
+ @Keep
25
+ val pitch: Double,
26
+ @DoNotStrip
27
+ @Keep
28
+ val heading: Double,
29
+ @DoNotStrip
30
+ @Keep
31
+ val altitude: Double,
32
+ @DoNotStrip
33
+ @Keep
34
+ val zoom: Double
35
+ ) {
36
+ /* primary constructor */
37
+
38
+ private companion object {
39
+ /**
40
+ * Constructor called from C++
41
+ */
42
+ @DoNotStrip
43
+ @Keep
44
+ @Suppress("unused")
45
+ @JvmStatic
46
+ private fun fromCpp(center: Coordinate, pitch: Double, heading: Double, altitude: Double, zoom: Double): Camera {
47
+ return Camera(center, pitch, heading, altitude, zoom)
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,24 @@
1
+ ///
2
+ /// ClusterAnimationStyle.kt
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
+ package com.margelo.nitro.nitromap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "ClusterAnimationStyle".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class ClusterAnimationStyle(@DoNotStrip @Keep val value: Int) {
19
+ DEFAULT(0),
20
+ BOUNCE(1),
21
+ SCALE(2),
22
+ FADE(3),
23
+ SPRING(4);
24
+ }
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// ClusterConfig.kt
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
+ package com.margelo.nitro.nitromap
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "ClusterConfig".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class ClusterConfig(
20
+ @DoNotStrip
21
+ @Keep
22
+ val enabled: Boolean,
23
+ @DoNotStrip
24
+ @Keep
25
+ val strategy: ClusterStrategy,
26
+ @DoNotStrip
27
+ @Keep
28
+ val radius: Double,
29
+ @DoNotStrip
30
+ @Keep
31
+ val minimumClusterSize: Double,
32
+ @DoNotStrip
33
+ @Keep
34
+ val maxZoom: Double,
35
+ @DoNotStrip
36
+ @Keep
37
+ val backgroundColor: ColorValue,
38
+ @DoNotStrip
39
+ @Keep
40
+ val textColor: ColorValue,
41
+ @DoNotStrip
42
+ @Keep
43
+ val borderWidth: Double,
44
+ @DoNotStrip
45
+ @Keep
46
+ val borderColor: ColorValue,
47
+ @DoNotStrip
48
+ @Keep
49
+ val animatesClusters: Boolean,
50
+ @DoNotStrip
51
+ @Keep
52
+ val animationDuration: Double,
53
+ @DoNotStrip
54
+ @Keep
55
+ val animationStyle: ClusterAnimationStyle,
56
+ @DoNotStrip
57
+ @Keep
58
+ val realtimeClustering: Boolean,
59
+ @DoNotStrip
60
+ @Keep
61
+ val renderBuffer: Double,
62
+ @DoNotStrip
63
+ @Keep
64
+ val throttleInterval: Double
65
+ ) {
66
+ /* primary constructor */
67
+
68
+ private companion object {
69
+ /**
70
+ * Constructor called from C++
71
+ */
72
+ @DoNotStrip
73
+ @Keep
74
+ @Suppress("unused")
75
+ @JvmStatic
76
+ private fun fromCpp(enabled: Boolean, strategy: ClusterStrategy, radius: Double, minimumClusterSize: Double, maxZoom: Double, backgroundColor: ColorValue, textColor: ColorValue, borderWidth: Double, borderColor: ColorValue, animatesClusters: Boolean, animationDuration: Double, animationStyle: ClusterAnimationStyle, realtimeClustering: Boolean, renderBuffer: Double, throttleInterval: Double): ClusterConfig {
77
+ return ClusterConfig(enabled, strategy, radius, minimumClusterSize, maxZoom, backgroundColor, textColor, borderWidth, borderColor, animatesClusters, animationDuration, animationStyle, realtimeClustering, renderBuffer, throttleInterval)
78
+ }
79
+ }
80
+ }