@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,87 @@
1
+ ///
2
+ /// MapStyleElement.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
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ // Forward declaration of `MapStyler` to properly resolve imports.
27
+ namespace margelo::nitro::nitromap { struct MapStyler; }
28
+
29
+ #include <string>
30
+ #include <optional>
31
+ #include "MapStyler.hpp"
32
+ #include <vector>
33
+
34
+ namespace margelo::nitro::nitromap {
35
+
36
+ /**
37
+ * A struct which can be represented as a JavaScript object (MapStyleElement).
38
+ */
39
+ struct MapStyleElement {
40
+ public:
41
+ std::optional<std::string> featureType SWIFT_PRIVATE;
42
+ std::optional<std::string> elementType SWIFT_PRIVATE;
43
+ std::vector<MapStyler> stylers SWIFT_PRIVATE;
44
+
45
+ public:
46
+ MapStyleElement() = default;
47
+ explicit MapStyleElement(std::optional<std::string> featureType, std::optional<std::string> elementType, std::vector<MapStyler> stylers): featureType(featureType), elementType(elementType), stylers(stylers) {}
48
+ };
49
+
50
+ } // namespace margelo::nitro::nitromap
51
+
52
+ namespace margelo::nitro {
53
+
54
+ // C++ MapStyleElement <> JS MapStyleElement (object)
55
+ template <>
56
+ struct JSIConverter<margelo::nitro::nitromap::MapStyleElement> final {
57
+ static inline margelo::nitro::nitromap::MapStyleElement fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
+ jsi::Object obj = arg.asObject(runtime);
59
+ return margelo::nitro::nitromap::MapStyleElement(
60
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "featureType")),
61
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "elementType")),
62
+ JSIConverter<std::vector<margelo::nitro::nitromap::MapStyler>>::fromJSI(runtime, obj.getProperty(runtime, "stylers"))
63
+ );
64
+ }
65
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::MapStyleElement& arg) {
66
+ jsi::Object obj(runtime);
67
+ obj.setProperty(runtime, "featureType", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.featureType));
68
+ obj.setProperty(runtime, "elementType", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.elementType));
69
+ obj.setProperty(runtime, "stylers", JSIConverter<std::vector<margelo::nitro::nitromap::MapStyler>>::toJSI(runtime, arg.stylers));
70
+ return obj;
71
+ }
72
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
73
+ if (!value.isObject()) {
74
+ return false;
75
+ }
76
+ jsi::Object obj = value.getObject(runtime);
77
+ if (!nitro::isPlainObject(runtime, obj)) {
78
+ return false;
79
+ }
80
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "featureType"))) return false;
81
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "elementType"))) return false;
82
+ if (!JSIConverter<std::vector<margelo::nitro::nitromap::MapStyler>>::canConvert(runtime, obj.getProperty(runtime, "stylers"))) return false;
83
+ return true;
84
+ }
85
+ };
86
+
87
+ } // namespace margelo::nitro
@@ -0,0 +1,96 @@
1
+ ///
2
+ /// MapStyler.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
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+
27
+
28
+ #include <string>
29
+ #include <optional>
30
+
31
+ namespace margelo::nitro::nitromap {
32
+
33
+ /**
34
+ * A struct which can be represented as a JavaScript object (MapStyler).
35
+ */
36
+ struct MapStyler {
37
+ public:
38
+ std::optional<std::string> color SWIFT_PRIVATE;
39
+ std::optional<std::string> visibility SWIFT_PRIVATE;
40
+ std::optional<double> weight SWIFT_PRIVATE;
41
+ std::optional<double> saturation SWIFT_PRIVATE;
42
+ std::optional<double> lightness SWIFT_PRIVATE;
43
+ std::optional<double> gamma SWIFT_PRIVATE;
44
+
45
+ public:
46
+ MapStyler() = default;
47
+ explicit MapStyler(std::optional<std::string> color, std::optional<std::string> visibility, std::optional<double> weight, std::optional<double> saturation, std::optional<double> lightness, std::optional<double> gamma): color(color), visibility(visibility), weight(weight), saturation(saturation), lightness(lightness), gamma(gamma) {}
48
+ };
49
+
50
+ } // namespace margelo::nitro::nitromap
51
+
52
+ namespace margelo::nitro {
53
+
54
+ // C++ MapStyler <> JS MapStyler (object)
55
+ template <>
56
+ struct JSIConverter<margelo::nitro::nitromap::MapStyler> final {
57
+ static inline margelo::nitro::nitromap::MapStyler fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
+ jsi::Object obj = arg.asObject(runtime);
59
+ return margelo::nitro::nitromap::MapStyler(
60
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "color")),
61
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "visibility")),
62
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "weight")),
63
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "saturation")),
64
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "lightness")),
65
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "gamma"))
66
+ );
67
+ }
68
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::MapStyler& arg) {
69
+ jsi::Object obj(runtime);
70
+ obj.setProperty(runtime, "color", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.color));
71
+ obj.setProperty(runtime, "visibility", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.visibility));
72
+ obj.setProperty(runtime, "weight", JSIConverter<std::optional<double>>::toJSI(runtime, arg.weight));
73
+ obj.setProperty(runtime, "saturation", JSIConverter<std::optional<double>>::toJSI(runtime, arg.saturation));
74
+ obj.setProperty(runtime, "lightness", JSIConverter<std::optional<double>>::toJSI(runtime, arg.lightness));
75
+ obj.setProperty(runtime, "gamma", JSIConverter<std::optional<double>>::toJSI(runtime, arg.gamma));
76
+ return obj;
77
+ }
78
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
79
+ if (!value.isObject()) {
80
+ return false;
81
+ }
82
+ jsi::Object obj = value.getObject(runtime);
83
+ if (!nitro::isPlainObject(runtime, obj)) {
84
+ return false;
85
+ }
86
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "color"))) return false;
87
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "visibility"))) return false;
88
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "weight"))) return false;
89
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "saturation"))) return false;
90
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "lightness"))) return false;
91
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "gamma"))) return false;
92
+ return true;
93
+ }
94
+ };
95
+
96
+ } // namespace margelo::nitro
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// MapType.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
+ #if __has_include(<NitroModules/NitroHash.hpp>)
11
+ #include <NitroModules/NitroHash.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
16
+ #include <NitroModules/JSIConverter.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
21
+ #include <NitroModules/NitroDefines.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ namespace margelo::nitro::nitromap {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (MapType).
30
+ */
31
+ enum class MapType {
32
+ STANDARD SWIFT_NAME(standard) = 0,
33
+ SATELLITE SWIFT_NAME(satellite) = 1,
34
+ HYBRID SWIFT_NAME(hybrid) = 2,
35
+ } CLOSED_ENUM;
36
+
37
+ } // namespace margelo::nitro::nitromap
38
+
39
+ namespace margelo::nitro {
40
+
41
+ // C++ MapType <> JS MapType (union)
42
+ template <>
43
+ struct JSIConverter<margelo::nitro::nitromap::MapType> final {
44
+ static inline margelo::nitro::nitromap::MapType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
45
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
46
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
47
+ case hashString("standard"): return margelo::nitro::nitromap::MapType::STANDARD;
48
+ case hashString("satellite"): return margelo::nitro::nitromap::MapType::SATELLITE;
49
+ case hashString("hybrid"): return margelo::nitro::nitromap::MapType::HYBRID;
50
+ default: [[unlikely]]
51
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum MapType - invalid value!");
52
+ }
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitromap::MapType arg) {
55
+ switch (arg) {
56
+ case margelo::nitro::nitromap::MapType::STANDARD: return JSIConverter<std::string>::toJSI(runtime, "standard");
57
+ case margelo::nitro::nitromap::MapType::SATELLITE: return JSIConverter<std::string>::toJSI(runtime, "satellite");
58
+ case margelo::nitro::nitromap::MapType::HYBRID: return JSIConverter<std::string>::toJSI(runtime, "hybrid");
59
+ default: [[unlikely]]
60
+ throw std::invalid_argument("Cannot convert MapType to JS - invalid value: "
61
+ + std::to_string(static_cast<int>(arg)) + "!");
62
+ }
63
+ }
64
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
65
+ if (!value.isString()) {
66
+ return false;
67
+ }
68
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
69
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
70
+ case hashString("standard"):
71
+ case hashString("satellite"):
72
+ case hashString("hybrid"):
73
+ return true;
74
+ default:
75
+ return false;
76
+ }
77
+ }
78
+ };
79
+
80
+ } // namespace margelo::nitro
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// MarkerAnimation.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
+ #if __has_include(<NitroModules/NitroHash.hpp>)
11
+ #include <NitroModules/NitroHash.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
16
+ #include <NitroModules/JSIConverter.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
21
+ #include <NitroModules/NitroDefines.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ namespace margelo::nitro::nitromap {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (MarkerAnimation).
30
+ */
31
+ enum class MarkerAnimation {
32
+ NONE SWIFT_NAME(none) = 0,
33
+ POP SWIFT_NAME(pop) = 1,
34
+ FADEIN SWIFT_NAME(fadein) = 2,
35
+ } CLOSED_ENUM;
36
+
37
+ } // namespace margelo::nitro::nitromap
38
+
39
+ namespace margelo::nitro {
40
+
41
+ // C++ MarkerAnimation <> JS MarkerAnimation (union)
42
+ template <>
43
+ struct JSIConverter<margelo::nitro::nitromap::MarkerAnimation> final {
44
+ static inline margelo::nitro::nitromap::MarkerAnimation fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
45
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
46
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
47
+ case hashString("none"): return margelo::nitro::nitromap::MarkerAnimation::NONE;
48
+ case hashString("pop"): return margelo::nitro::nitromap::MarkerAnimation::POP;
49
+ case hashString("fadeIn"): return margelo::nitro::nitromap::MarkerAnimation::FADEIN;
50
+ default: [[unlikely]]
51
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum MarkerAnimation - invalid value!");
52
+ }
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitromap::MarkerAnimation arg) {
55
+ switch (arg) {
56
+ case margelo::nitro::nitromap::MarkerAnimation::NONE: return JSIConverter<std::string>::toJSI(runtime, "none");
57
+ case margelo::nitro::nitromap::MarkerAnimation::POP: return JSIConverter<std::string>::toJSI(runtime, "pop");
58
+ case margelo::nitro::nitromap::MarkerAnimation::FADEIN: return JSIConverter<std::string>::toJSI(runtime, "fadeIn");
59
+ default: [[unlikely]]
60
+ throw std::invalid_argument("Cannot convert MarkerAnimation to JS - invalid value: "
61
+ + std::to_string(static_cast<int>(arg)) + "!");
62
+ }
63
+ }
64
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
65
+ if (!value.isString()) {
66
+ return false;
67
+ }
68
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
69
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
70
+ case hashString("none"):
71
+ case hashString("pop"):
72
+ case hashString("fadeIn"):
73
+ return true;
74
+ default:
75
+ return false;
76
+ }
77
+ }
78
+ };
79
+
80
+ } // namespace margelo::nitro
@@ -0,0 +1,87 @@
1
+ ///
2
+ /// 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
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+
27
+
28
+
29
+
30
+ namespace margelo::nitro::nitromap {
31
+
32
+ /**
33
+ * A struct which can be represented as a JavaScript object (MarkerColor).
34
+ */
35
+ struct MarkerColor {
36
+ public:
37
+ double r SWIFT_PRIVATE;
38
+ double g SWIFT_PRIVATE;
39
+ double b SWIFT_PRIVATE;
40
+ double a SWIFT_PRIVATE;
41
+
42
+ public:
43
+ MarkerColor() = default;
44
+ explicit MarkerColor(double r, double g, double b, double a): r(r), g(g), b(b), a(a) {}
45
+ };
46
+
47
+ } // namespace margelo::nitro::nitromap
48
+
49
+ namespace margelo::nitro {
50
+
51
+ // C++ MarkerColor <> JS MarkerColor (object)
52
+ template <>
53
+ struct JSIConverter<margelo::nitro::nitromap::MarkerColor> final {
54
+ static inline margelo::nitro::nitromap::MarkerColor fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
55
+ jsi::Object obj = arg.asObject(runtime);
56
+ return margelo::nitro::nitromap::MarkerColor(
57
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "r")),
58
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "g")),
59
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "b")),
60
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "a"))
61
+ );
62
+ }
63
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::MarkerColor& arg) {
64
+ jsi::Object obj(runtime);
65
+ obj.setProperty(runtime, "r", JSIConverter<double>::toJSI(runtime, arg.r));
66
+ obj.setProperty(runtime, "g", JSIConverter<double>::toJSI(runtime, arg.g));
67
+ obj.setProperty(runtime, "b", JSIConverter<double>::toJSI(runtime, arg.b));
68
+ obj.setProperty(runtime, "a", JSIConverter<double>::toJSI(runtime, arg.a));
69
+ return obj;
70
+ }
71
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
72
+ if (!value.isObject()) {
73
+ return false;
74
+ }
75
+ jsi::Object obj = value.getObject(runtime);
76
+ if (!nitro::isPlainObject(runtime, obj)) {
77
+ return false;
78
+ }
79
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "r"))) return false;
80
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "g"))) return false;
81
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "b"))) return false;
82
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "a"))) return false;
83
+ return true;
84
+ }
85
+ };
86
+
87
+ } // namespace margelo::nitro
@@ -0,0 +1,91 @@
1
+ ///
2
+ /// MarkerConfig.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
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ // Forward declaration of `MarkerStyle` to properly resolve imports.
27
+ namespace margelo::nitro::nitromap { enum class MarkerStyle; }
28
+ // Forward declaration of `ImageMarkerConfig` to properly resolve imports.
29
+ namespace margelo::nitro::nitromap { struct ImageMarkerConfig; }
30
+ // Forward declaration of `PriceMarkerStyle` to properly resolve imports.
31
+ namespace margelo::nitro::nitromap { struct PriceMarkerStyle; }
32
+
33
+ #include "MarkerStyle.hpp"
34
+ #include "ImageMarkerConfig.hpp"
35
+ #include <optional>
36
+ #include "PriceMarkerStyle.hpp"
37
+
38
+ namespace margelo::nitro::nitromap {
39
+
40
+ /**
41
+ * A struct which can be represented as a JavaScript object (MarkerConfig).
42
+ */
43
+ struct MarkerConfig {
44
+ public:
45
+ MarkerStyle style SWIFT_PRIVATE;
46
+ std::optional<ImageMarkerConfig> image SWIFT_PRIVATE;
47
+ std::optional<PriceMarkerStyle> priceMarker SWIFT_PRIVATE;
48
+
49
+ public:
50
+ MarkerConfig() = default;
51
+ explicit MarkerConfig(MarkerStyle style, std::optional<ImageMarkerConfig> image, std::optional<PriceMarkerStyle> priceMarker): style(style), image(image), priceMarker(priceMarker) {}
52
+ };
53
+
54
+ } // namespace margelo::nitro::nitromap
55
+
56
+ namespace margelo::nitro {
57
+
58
+ // C++ MarkerConfig <> JS MarkerConfig (object)
59
+ template <>
60
+ struct JSIConverter<margelo::nitro::nitromap::MarkerConfig> final {
61
+ static inline margelo::nitro::nitromap::MarkerConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
62
+ jsi::Object obj = arg.asObject(runtime);
63
+ return margelo::nitro::nitromap::MarkerConfig(
64
+ JSIConverter<margelo::nitro::nitromap::MarkerStyle>::fromJSI(runtime, obj.getProperty(runtime, "style")),
65
+ JSIConverter<std::optional<margelo::nitro::nitromap::ImageMarkerConfig>>::fromJSI(runtime, obj.getProperty(runtime, "image")),
66
+ JSIConverter<std::optional<margelo::nitro::nitromap::PriceMarkerStyle>>::fromJSI(runtime, obj.getProperty(runtime, "priceMarker"))
67
+ );
68
+ }
69
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::MarkerConfig& arg) {
70
+ jsi::Object obj(runtime);
71
+ obj.setProperty(runtime, "style", JSIConverter<margelo::nitro::nitromap::MarkerStyle>::toJSI(runtime, arg.style));
72
+ obj.setProperty(runtime, "image", JSIConverter<std::optional<margelo::nitro::nitromap::ImageMarkerConfig>>::toJSI(runtime, arg.image));
73
+ obj.setProperty(runtime, "priceMarker", JSIConverter<std::optional<margelo::nitro::nitromap::PriceMarkerStyle>>::toJSI(runtime, arg.priceMarker));
74
+ return obj;
75
+ }
76
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
77
+ if (!value.isObject()) {
78
+ return false;
79
+ }
80
+ jsi::Object obj = value.getObject(runtime);
81
+ if (!nitro::isPlainObject(runtime, obj)) {
82
+ return false;
83
+ }
84
+ if (!JSIConverter<margelo::nitro::nitromap::MarkerStyle>::canConvert(runtime, obj.getProperty(runtime, "style"))) return false;
85
+ if (!JSIConverter<std::optional<margelo::nitro::nitromap::ImageMarkerConfig>>::canConvert(runtime, obj.getProperty(runtime, "image"))) return false;
86
+ if (!JSIConverter<std::optional<margelo::nitro::nitromap::PriceMarkerStyle>>::canConvert(runtime, obj.getProperty(runtime, "priceMarker"))) return false;
87
+ return true;
88
+ }
89
+ };
90
+
91
+ } // namespace margelo::nitro
@@ -0,0 +1,131 @@
1
+ ///
2
+ /// MarkerData.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
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ // Forward declaration of `Coordinate` to properly resolve imports.
27
+ namespace margelo::nitro::nitromap { struct Coordinate; }
28
+ // Forward declaration of `Point` to properly resolve imports.
29
+ namespace margelo::nitro::nitromap { struct Point; }
30
+ // Forward declaration of `MarkerConfig` to properly resolve imports.
31
+ namespace margelo::nitro::nitromap { struct MarkerConfig; }
32
+ // Forward declaration of `MarkerAnimation` to properly resolve imports.
33
+ namespace margelo::nitro::nitromap { enum class MarkerAnimation; }
34
+
35
+ #include <string>
36
+ #include "Coordinate.hpp"
37
+ #include <optional>
38
+ #include "Point.hpp"
39
+ #include "MarkerConfig.hpp"
40
+ #include "MarkerAnimation.hpp"
41
+
42
+ namespace margelo::nitro::nitromap {
43
+
44
+ /**
45
+ * A struct which can be represented as a JavaScript object (MarkerData).
46
+ */
47
+ struct MarkerData {
48
+ public:
49
+ std::string id SWIFT_PRIVATE;
50
+ Coordinate coordinate SWIFT_PRIVATE;
51
+ std::optional<std::string> title SWIFT_PRIVATE;
52
+ std::optional<std::string> description SWIFT_PRIVATE;
53
+ bool draggable SWIFT_PRIVATE;
54
+ double opacity SWIFT_PRIVATE;
55
+ double rotation SWIFT_PRIVATE;
56
+ double zIndex SWIFT_PRIVATE;
57
+ Point anchor SWIFT_PRIVATE;
58
+ MarkerConfig config SWIFT_PRIVATE;
59
+ bool clusteringEnabled SWIFT_PRIVATE;
60
+ MarkerAnimation animation SWIFT_PRIVATE;
61
+
62
+ public:
63
+ MarkerData() = default;
64
+ explicit MarkerData(std::string id, Coordinate coordinate, std::optional<std::string> title, std::optional<std::string> description, bool draggable, double opacity, double rotation, double zIndex, Point anchor, MarkerConfig config, bool clusteringEnabled, MarkerAnimation animation): id(id), coordinate(coordinate), title(title), description(description), draggable(draggable), opacity(opacity), rotation(rotation), zIndex(zIndex), anchor(anchor), config(config), clusteringEnabled(clusteringEnabled), animation(animation) {}
65
+ };
66
+
67
+ } // namespace margelo::nitro::nitromap
68
+
69
+ namespace margelo::nitro {
70
+
71
+ // C++ MarkerData <> JS MarkerData (object)
72
+ template <>
73
+ struct JSIConverter<margelo::nitro::nitromap::MarkerData> final {
74
+ static inline margelo::nitro::nitromap::MarkerData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
75
+ jsi::Object obj = arg.asObject(runtime);
76
+ return margelo::nitro::nitromap::MarkerData(
77
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
78
+ JSIConverter<margelo::nitro::nitromap::Coordinate>::fromJSI(runtime, obj.getProperty(runtime, "coordinate")),
79
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "title")),
80
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "description")),
81
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "draggable")),
82
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "opacity")),
83
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "rotation")),
84
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
85
+ JSIConverter<margelo::nitro::nitromap::Point>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
86
+ JSIConverter<margelo::nitro::nitromap::MarkerConfig>::fromJSI(runtime, obj.getProperty(runtime, "config")),
87
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "clusteringEnabled")),
88
+ JSIConverter<margelo::nitro::nitromap::MarkerAnimation>::fromJSI(runtime, obj.getProperty(runtime, "animation"))
89
+ );
90
+ }
91
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitromap::MarkerData& arg) {
92
+ jsi::Object obj(runtime);
93
+ obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
94
+ obj.setProperty(runtime, "coordinate", JSIConverter<margelo::nitro::nitromap::Coordinate>::toJSI(runtime, arg.coordinate));
95
+ obj.setProperty(runtime, "title", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.title));
96
+ obj.setProperty(runtime, "description", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.description));
97
+ obj.setProperty(runtime, "draggable", JSIConverter<bool>::toJSI(runtime, arg.draggable));
98
+ obj.setProperty(runtime, "opacity", JSIConverter<double>::toJSI(runtime, arg.opacity));
99
+ obj.setProperty(runtime, "rotation", JSIConverter<double>::toJSI(runtime, arg.rotation));
100
+ obj.setProperty(runtime, "zIndex", JSIConverter<double>::toJSI(runtime, arg.zIndex));
101
+ obj.setProperty(runtime, "anchor", JSIConverter<margelo::nitro::nitromap::Point>::toJSI(runtime, arg.anchor));
102
+ obj.setProperty(runtime, "config", JSIConverter<margelo::nitro::nitromap::MarkerConfig>::toJSI(runtime, arg.config));
103
+ obj.setProperty(runtime, "clusteringEnabled", JSIConverter<bool>::toJSI(runtime, arg.clusteringEnabled));
104
+ obj.setProperty(runtime, "animation", JSIConverter<margelo::nitro::nitromap::MarkerAnimation>::toJSI(runtime, arg.animation));
105
+ return obj;
106
+ }
107
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
108
+ if (!value.isObject()) {
109
+ return false;
110
+ }
111
+ jsi::Object obj = value.getObject(runtime);
112
+ if (!nitro::isPlainObject(runtime, obj)) {
113
+ return false;
114
+ }
115
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
116
+ if (!JSIConverter<margelo::nitro::nitromap::Coordinate>::canConvert(runtime, obj.getProperty(runtime, "coordinate"))) return false;
117
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "title"))) return false;
118
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "description"))) return false;
119
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "draggable"))) return false;
120
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "opacity"))) return false;
121
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "rotation"))) return false;
122
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
123
+ if (!JSIConverter<margelo::nitro::nitromap::Point>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
124
+ if (!JSIConverter<margelo::nitro::nitromap::MarkerConfig>::canConvert(runtime, obj.getProperty(runtime, "config"))) return false;
125
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "clusteringEnabled"))) return false;
126
+ if (!JSIConverter<margelo::nitro::nitromap::MarkerAnimation>::canConvert(runtime, obj.getProperty(runtime, "animation"))) return false;
127
+ return true;
128
+ }
129
+ };
130
+
131
+ } // namespace margelo::nitro