@aguacerowx/react-native 0.0.52 → 0.0.54

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 (265) hide show
  1. package/LICENSE +21 -0
  2. package/android/src/main/cpp/satellite_ktx_jni.cpp +6 -1
  3. package/android/src/main/java/com/aguacerowx/reactnative/NexradRadarLayerView.java +14 -2
  4. package/android/src/main/java/com/aguacerowx/reactnative/SatelliteLayer.java +121 -1
  5. package/android/src/main/java/com/aguacerowx/reactnative/SatelliteLayerView.java +556 -392
  6. package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +77 -0
  7. package/index.js +1 -1
  8. package/ios/SatelliteLayerView.swift +517 -517
  9. package/ios/WeatherFrameProcessorModule.m +19 -15
  10. package/ios/WeatherFrameProcessorModule.swift +65 -0
  11. package/lib/commonjs/AguaceroContext.js +0 -4
  12. package/lib/commonjs/AguaceroContext.js.map +1 -1
  13. package/lib/commonjs/GridRenderLayer.js +62 -76
  14. package/lib/commonjs/GridRenderLayer.js.map +1 -1
  15. package/lib/commonjs/MapManager.js +110 -224
  16. package/lib/commonjs/MapManager.js.map +1 -1
  17. package/lib/commonjs/MapRegistry.js +21 -33
  18. package/lib/commonjs/MapRegistry.js.map +1 -1
  19. package/lib/commonjs/NexradRadarLayer.android.js +28 -100
  20. package/lib/commonjs/NexradRadarLayer.android.js.map +1 -1
  21. package/lib/commonjs/NexradRadarLayer.ios.js +26 -97
  22. package/lib/commonjs/NexradRadarLayer.ios.js.map +1 -1
  23. package/lib/commonjs/NexradSitesMapLayer.js +41 -61
  24. package/lib/commonjs/NexradSitesMapLayer.js.map +1 -1
  25. package/lib/commonjs/SatelliteLayer.android.js +26 -38
  26. package/lib/commonjs/SatelliteLayer.android.js.map +1 -1
  27. package/lib/commonjs/SatelliteLayer.ios.js +30 -42
  28. package/lib/commonjs/SatelliteLayer.ios.js.map +1 -1
  29. package/lib/commonjs/StyleApplicator.js +129 -175
  30. package/lib/commonjs/StyleApplicator.js.map +1 -1
  31. package/lib/commonjs/WeatherLayerManager.js +996 -1627
  32. package/lib/commonjs/WeatherLayerManager.js.map +1 -1
  33. package/lib/commonjs/aguaceroCoreDebugHooks.js +58 -130
  34. package/lib/commonjs/aguaceroCoreDebugHooks.js.map +1 -1
  35. package/lib/commonjs/aguaceroRnDebug.js +147 -287
  36. package/lib/commonjs/aguaceroRnDebug.js.map +1 -1
  37. package/lib/commonjs/cdnAuthenticatedFetch.js +104 -0
  38. package/lib/commonjs/cdnAuthenticatedFetch.js.map +1 -0
  39. package/lib/commonjs/dispatchViewManagerCommandCompat.js +51 -88
  40. package/lib/commonjs/dispatchViewManagerCommandCompat.js.map +1 -1
  41. package/lib/commonjs/gridCdnAuth.js +41 -50
  42. package/lib/commonjs/gridCdnAuth.js.map +1 -1
  43. package/lib/commonjs/index.js +51 -0
  44. package/lib/commonjs/index.js.map +1 -1
  45. package/lib/commonjs/nexrad/nexradAndroidController.js +851 -863
  46. package/lib/commonjs/nexrad/nexradAndroidController.js.map +1 -1
  47. package/lib/commonjs/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +62 -85
  48. package/lib/commonjs/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js.map +1 -1
  49. package/lib/commonjs/nexrad/nexradDiag.js +32 -148
  50. package/lib/commonjs/nexrad/nexradDiag.js.map +1 -1
  51. package/lib/commonjs/nexrad/nexradLevel2Keys.js +261 -0
  52. package/lib/commonjs/nexrad/nexradLevel2Keys.js.map +1 -0
  53. package/lib/commonjs/nexrad/nexradLutBuild.js +64 -111
  54. package/lib/commonjs/nexrad/nexradLutBuild.js.map +1 -1
  55. package/lib/commonjs/nexrad/nexradMapboxFrameOpts.bundled.js +136 -164
  56. package/lib/commonjs/nexrad/nexradMapboxFrameOpts.bundled.js.map +1 -1
  57. package/lib/commonjs/nexrad/nexradSdkImports.js +51 -0
  58. package/lib/commonjs/nexrad/nexradSdkImports.js.map +1 -0
  59. package/lib/commonjs/nexrad/radarArchiveCore.bundled.js +2848 -4455
  60. package/lib/commonjs/nexrad/radarArchiveCore.bundled.js.map +1 -1
  61. package/lib/commonjs/nexrad/radarDecode.worker.bundled.js +445 -648
  62. package/lib/commonjs/nexrad/radarDecode.worker.bundled.js.map +1 -1
  63. package/lib/commonjs/nexrad/radarFrameGpuMatch.bundled.js +52 -68
  64. package/lib/commonjs/nexrad/radarFrameGpuMatch.bundled.js.map +1 -1
  65. package/lib/commonjs/nexradNativeCommandIds.js +24 -0
  66. package/lib/commonjs/nexradNativeCommandIds.js.map +1 -0
  67. package/lib/commonjs/nws/NwsAlertsOverlay.android.js.map +1 -1
  68. package/lib/commonjs/nws/NwsAlertsOverlay.ios.js.map +1 -1
  69. package/lib/commonjs/nws/NwsAlertsOverlay.js +3 -3
  70. package/lib/commonjs/nws/NwsAlertsOverlay.js.map +1 -1
  71. package/lib/commonjs/nws/NwsAlertsOverlay.native.js +235 -361
  72. package/lib/commonjs/nws/NwsAlertsOverlay.native.js.map +1 -1
  73. package/lib/commonjs/nws/eventSourceRnPolyfill.js +92 -146
  74. package/lib/commonjs/nws/eventSourceRnPolyfill.js.map +1 -1
  75. package/lib/commonjs/nws/nwsAndroidConstants.js +2 -8
  76. package/lib/commonjs/nws/nwsAndroidConstants.js.map +1 -1
  77. package/lib/commonjs/satellite/satelliteAndroidController.js +122 -199
  78. package/lib/commonjs/satellite/satelliteAndroidController.js.map +1 -1
  79. package/lib/commonjs/satelliteBridgeDiag.js +3 -13
  80. package/lib/commonjs/satelliteBridgeDiag.js.map +1 -1
  81. package/lib/commonjs/satelliteRnDebug.js +160 -0
  82. package/lib/commonjs/satelliteRnDebug.js.map +1 -0
  83. package/lib/module/AguaceroContext.js +2 -7
  84. package/lib/module/AguaceroContext.js.map +1 -1
  85. package/lib/module/GridRenderLayer.js +66 -80
  86. package/lib/module/GridRenderLayer.js.map +1 -1
  87. package/lib/module/MapManager.js +125 -239
  88. package/lib/module/MapManager.js.map +1 -1
  89. package/lib/module/MapRegistry.js +21 -33
  90. package/lib/module/MapRegistry.js.map +1 -1
  91. package/lib/module/NexradRadarLayer.android.js +32 -104
  92. package/lib/module/NexradRadarLayer.android.js.map +1 -1
  93. package/lib/module/NexradRadarLayer.ios.js +30 -101
  94. package/lib/module/NexradRadarLayer.ios.js.map +1 -1
  95. package/lib/module/NexradSitesMapLayer.js +44 -63
  96. package/lib/module/NexradSitesMapLayer.js.map +1 -1
  97. package/lib/module/SatelliteLayer.android.js +32 -44
  98. package/lib/module/SatelliteLayer.android.js.map +1 -1
  99. package/lib/module/SatelliteLayer.ios.js +36 -48
  100. package/lib/module/SatelliteLayer.ios.js.map +1 -1
  101. package/lib/module/StyleApplicator.js +144 -191
  102. package/lib/module/StyleApplicator.js.map +1 -1
  103. package/lib/module/WeatherLayerManager.js +1024 -1655
  104. package/lib/module/WeatherLayerManager.js.map +1 -1
  105. package/lib/module/aguaceroCoreDebugHooks.js +59 -130
  106. package/lib/module/aguaceroCoreDebugHooks.js.map +1 -1
  107. package/lib/module/aguaceroRnDebug.js +151 -291
  108. package/lib/module/aguaceroRnDebug.js.map +1 -1
  109. package/lib/module/cdnAuthenticatedFetch.js +97 -0
  110. package/lib/module/cdnAuthenticatedFetch.js.map +1 -0
  111. package/lib/module/dispatchViewManagerCommandCompat.js +52 -90
  112. package/lib/module/dispatchViewManagerCommandCompat.js.map +1 -1
  113. package/lib/module/gridCdnAuth.js +38 -50
  114. package/lib/module/gridCdnAuth.js.map +1 -1
  115. package/lib/module/index.js +9 -6
  116. package/lib/module/index.js.map +1 -1
  117. package/lib/module/nexrad/nexradAndroidController.js +865 -876
  118. package/lib/module/nexrad/nexradAndroidController.js.map +1 -1
  119. package/lib/module/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +62 -85
  120. package/lib/module/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js.map +1 -1
  121. package/lib/module/nexrad/nexradDiag.js +31 -145
  122. package/lib/module/nexrad/nexradDiag.js.map +1 -1
  123. package/lib/module/nexrad/nexradLevel2Keys.js +245 -0
  124. package/lib/module/nexrad/nexradLevel2Keys.js.map +1 -0
  125. package/lib/module/nexrad/nexradLutBuild.js +64 -110
  126. package/lib/module/nexrad/nexradLutBuild.js.map +1 -1
  127. package/lib/module/nexrad/nexradMapboxFrameOpts.bundled.js +136 -163
  128. package/lib/module/nexrad/nexradMapboxFrameOpts.bundled.js.map +1 -1
  129. package/lib/module/nexrad/nexradSdkImports.js +4 -0
  130. package/lib/module/nexrad/nexradSdkImports.js.map +1 -0
  131. package/lib/module/nexrad/radarArchiveCore.bundled.js +2839 -4448
  132. package/lib/module/nexrad/radarArchiveCore.bundled.js.map +1 -1
  133. package/lib/module/nexrad/radarDecode.worker.bundled.js +445 -648
  134. package/lib/module/nexrad/radarDecode.worker.bundled.js.map +1 -1
  135. package/lib/module/nexrad/radarFrameGpuMatch.bundled.js +50 -66
  136. package/lib/module/nexrad/radarFrameGpuMatch.bundled.js.map +1 -1
  137. package/lib/module/nexradNativeCommandIds.js +18 -0
  138. package/lib/module/nexradNativeCommandIds.js.map +1 -0
  139. package/lib/module/nws/NwsAlertsOverlay.android.js +1 -1
  140. package/lib/module/nws/NwsAlertsOverlay.android.js.map +1 -1
  141. package/lib/module/nws/NwsAlertsOverlay.ios.js +1 -1
  142. package/lib/module/nws/NwsAlertsOverlay.ios.js.map +1 -1
  143. package/lib/module/nws/NwsAlertsOverlay.js +5 -5
  144. package/lib/module/nws/NwsAlertsOverlay.js.map +1 -1
  145. package/lib/module/nws/NwsAlertsOverlay.native.js +248 -373
  146. package/lib/module/nws/NwsAlertsOverlay.native.js.map +1 -1
  147. package/lib/module/nws/eventSourceRnPolyfill.js +92 -146
  148. package/lib/module/nws/eventSourceRnPolyfill.js.map +1 -1
  149. package/lib/module/nws/nwsAndroidConstants.js +2 -8
  150. package/lib/module/nws/nwsAndroidConstants.js.map +1 -1
  151. package/lib/module/satellite/satelliteAndroidController.js +125 -202
  152. package/lib/module/satellite/satelliteAndroidController.js.map +1 -1
  153. package/lib/module/satelliteBridgeDiag.js +3 -13
  154. package/lib/module/satelliteBridgeDiag.js.map +1 -1
  155. package/lib/module/satelliteRnDebug.js +148 -0
  156. package/lib/module/satelliteRnDebug.js.map +1 -0
  157. package/lib/typescript/AguaceroContext.d.ts +0 -4
  158. package/lib/typescript/AguaceroContext.d.ts.map +1 -1
  159. package/lib/typescript/GridRenderLayer.d.ts.map +1 -1
  160. package/lib/typescript/MapManager.d.ts +0 -12
  161. package/lib/typescript/MapManager.d.ts.map +1 -1
  162. package/lib/typescript/MapRegistry.d.ts +10 -12
  163. package/lib/typescript/MapRegistry.d.ts.map +1 -1
  164. package/lib/typescript/NexradRadarLayer.android.d.ts.map +1 -1
  165. package/lib/typescript/NexradRadarLayer.ios.d.ts.map +1 -1
  166. package/lib/typescript/NexradSitesMapLayer.d.ts +4 -10
  167. package/lib/typescript/NexradSitesMapLayer.d.ts.map +1 -1
  168. package/lib/typescript/SatelliteLayer.android.d.ts.map +1 -1
  169. package/lib/typescript/SatelliteLayer.ios.d.ts.map +1 -1
  170. package/lib/typescript/StyleApplicator.d.ts +1 -1
  171. package/lib/typescript/StyleApplicator.d.ts.map +1 -1
  172. package/lib/typescript/WeatherLayerManager.d.ts.map +1 -1
  173. package/lib/typescript/aguaceroCoreDebugHooks.d.ts +2 -9
  174. package/lib/typescript/aguaceroCoreDebugHooks.d.ts.map +1 -1
  175. package/lib/typescript/aguaceroRnDebug.d.ts +47 -66
  176. package/lib/typescript/aguaceroRnDebug.d.ts.map +1 -1
  177. package/lib/typescript/cdnAuthenticatedFetch.d.ts +10 -0
  178. package/lib/typescript/cdnAuthenticatedFetch.d.ts.map +1 -0
  179. package/lib/typescript/dispatchViewManagerCommandCompat.d.ts +1 -17
  180. package/lib/typescript/dispatchViewManagerCommandCompat.d.ts.map +1 -1
  181. package/lib/typescript/gridCdnAuth.d.ts +16 -21
  182. package/lib/typescript/gridCdnAuth.d.ts.map +1 -1
  183. package/lib/typescript/index.d.ts +2 -0
  184. package/lib/typescript/nexrad/nexradAndroidController.d.ts +39 -89
  185. package/lib/typescript/nexrad/nexradAndroidController.d.ts.map +1 -1
  186. package/lib/typescript/nexrad/nexradCrossSectionSampleAtLatLon.bundled.d.ts +2 -1
  187. package/lib/typescript/nexrad/nexradCrossSectionSampleAtLatLon.bundled.d.ts.map +1 -1
  188. package/lib/typescript/nexrad/nexradDiag.d.ts +13 -101
  189. package/lib/typescript/nexrad/nexradDiag.d.ts.map +1 -1
  190. package/lib/typescript/nexrad/nexradLevel2Keys.d.ts +36 -0
  191. package/lib/typescript/nexrad/nexradLevel2Keys.d.ts.map +1 -0
  192. package/lib/typescript/nexrad/nexradLutBuild.d.ts +3 -10
  193. package/lib/typescript/nexrad/nexradLutBuild.d.ts.map +1 -1
  194. package/lib/typescript/nexrad/nexradMapboxFrameOpts.bundled.d.ts +4 -3
  195. package/lib/typescript/nexrad/nexradMapboxFrameOpts.bundled.d.ts.map +1 -1
  196. package/lib/typescript/nexrad/nexradSdkImports.d.ts +2 -0
  197. package/lib/typescript/nexrad/nexradSdkImports.d.ts.map +1 -0
  198. package/lib/typescript/nexrad/radarArchiveCore.bundled.d.ts +12 -7
  199. package/lib/typescript/nexrad/radarArchiveCore.bundled.d.ts.map +1 -1
  200. package/lib/typescript/nexrad/radarDecode.worker.bundled.d.ts +20 -20
  201. package/lib/typescript/nexrad/radarDecode.worker.bundled.d.ts.map +1 -1
  202. package/lib/typescript/nexrad/radarFrameGpuMatch.bundled.d.ts +4 -3
  203. package/lib/typescript/nexrad/radarFrameGpuMatch.bundled.d.ts.map +1 -1
  204. package/lib/typescript/nexradNativeCommandIds.d.ts +2 -0
  205. package/lib/typescript/nexradNativeCommandIds.d.ts.map +1 -0
  206. package/lib/typescript/nws/NwsAlertsOverlay.native.d.ts +6 -17
  207. package/lib/typescript/nws/NwsAlertsOverlay.native.d.ts.map +1 -1
  208. package/lib/typescript/nws/eventSourceRnPolyfill.d.ts +0 -3
  209. package/lib/typescript/nws/eventSourceRnPolyfill.d.ts.map +1 -1
  210. package/lib/typescript/nws/nwsAndroidConstants.d.ts +0 -5
  211. package/lib/typescript/nws/nwsAndroidConstants.d.ts.map +1 -1
  212. package/lib/typescript/satellite/satelliteAndroidController.d.ts +9 -47
  213. package/lib/typescript/satellite/satelliteAndroidController.d.ts.map +1 -1
  214. package/lib/typescript/satelliteBridgeDiag.d.ts +1 -5
  215. package/lib/typescript/satelliteBridgeDiag.d.ts.map +1 -1
  216. package/lib/typescript/satelliteRnDebug.d.ts +75 -0
  217. package/lib/typescript/satelliteRnDebug.d.ts.map +1 -0
  218. package/package.json +75 -74
  219. package/src/AguaceroContext.js +1 -7
  220. package/src/GridRenderLayer.js +1 -128
  221. package/src/MapManager.js +1 -277
  222. package/src/MapRegistry.js +1 -56
  223. package/src/NexradRadarLayer.android.js +1 -121
  224. package/src/NexradRadarLayer.ios.js +1 -115
  225. package/src/NexradSitesMapLayer.js +1 -75
  226. package/src/SatelliteLayer.android.js +1 -63
  227. package/src/SatelliteLayer.ios.js +1 -70
  228. package/src/StyleApplicator.js +1 -241
  229. package/src/WeatherLayerManager.js +1 -2025
  230. package/src/aguaceroCoreDebugHooks.js +1 -142
  231. package/src/aguaceroRnDebug.js +1 -335
  232. package/src/cdnAuthenticatedFetch.js +1 -0
  233. package/src/dispatchViewManagerCommandCompat.js +1 -100
  234. package/src/gridCdnAuth.js +1 -56
  235. package/src/index.js +1 -19
  236. package/src/nexrad/nexradAndroidController.js +1 -1078
  237. package/src/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +1 -91
  238. package/src/nexrad/nexradDiag.js +1 -150
  239. package/src/nexrad/nexradLevel2Keys.js +1 -0
  240. package/src/nexrad/nexradLutBuild.js +1 -126
  241. package/src/nexrad/nexradMapboxFrameOpts.bundled.js +1 -245
  242. package/src/nexrad/nexradSdkImports.js +1 -0
  243. package/src/nexrad/radarArchiveCore.bundled.js +1 -7085
  244. package/src/nexrad/radarDecode.worker.bundled.js +1 -813
  245. package/src/nexrad/radarFrameGpuMatch.bundled.js +1 -79
  246. package/src/nexradNativeCommandIds.js +1 -0
  247. package/src/nws/NwsAlertsOverlay.android.js +1 -1
  248. package/src/nws/NwsAlertsOverlay.ios.js +1 -1
  249. package/src/nws/NwsAlertsOverlay.js +1 -7
  250. package/src/nws/NwsAlertsOverlay.native.js +1 -463
  251. package/src/nws/eventSourceRnPolyfill.js +7 -193
  252. package/src/nws/nwsAndroidConstants.js +1 -8
  253. package/src/satellite/satelliteAndroidController.js +1 -245
  254. package/src/satelliteBridgeDiag.js +1 -15
  255. package/src/satelliteRnDebug.js +1 -0
  256. package/lib/commonjs/nexrad/nexradNativeCommandIds.js +0 -51
  257. package/lib/commonjs/nexrad/nexradNativeCommandIds.js.map +0 -1
  258. package/lib/module/nexrad/nexradNativeCommandIds.js +0 -44
  259. package/lib/module/nexrad/nexradNativeCommandIds.js.map +0 -1
  260. package/lib/typescript/nexrad/nexradNativeCommandIds.d.ts +0 -9
  261. package/lib/typescript/nexrad/nexradNativeCommandIds.d.ts.map +0 -1
  262. package/src/nexrad/nexradNativeCommandIds.js +0 -44
  263. /package/lib/commonjs/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
  264. /package/lib/module/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
  265. /package/src/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
package/package.json CHANGED
@@ -1,74 +1,75 @@
1
- {
2
- "name": "@aguacerowx/react-native",
3
- "version": "0.0.52",
4
- "description": "Native weather rendering for React Native",
5
- "license": "ISC",
6
- "author": "Michael Barletta",
7
- "keywords": [
8
- "react-native",
9
- "android",
10
- "weather",
11
- "map"
12
- ],
13
- "main": "lib/commonjs/index.js",
14
- "module": "lib/module/index.js",
15
- "types": "lib/typescript/index.d.ts",
16
- "react-native": "index.js",
17
- "source": "index.js",
18
- "files": [
19
- "src",
20
- "index.js",
21
- "lib",
22
- "android",
23
- "ios",
24
- "cpp",
25
- "*.podspec",
26
- "ios/generated",
27
- "ios/compiled-shaders",
28
- "android/src/main/java/com/facebook/react/viewmanagers"
29
- ],
30
- "scripts": {
31
- "bundle-nexrad": "node ../mapsgl/scripts/bundle-nexrad-rn.mjs",
32
- "compile-shaders": "node scripts/compile-shaders.js",
33
- "clean": "node -e \"require('fs').rmSync('lib', {recursive: true, force: true})\"",
34
- "build": "npm run compile-shaders && npm run clean && bob build",
35
- "prepare": "npm run build"
36
- },
37
- "devDependencies": {
38
- "proj4": "^2.11.0",
39
- "react-native-builder-bob": "^0.23.2",
40
- "typescript": "^5.0.2"
41
- },
42
- "peerDependencies": {
43
- "@rnmapbox/maps": "*",
44
- "react": "*",
45
- "react-native": "*",
46
- "react-native-device-info": ">=10.0.0"
47
- },
48
- "dependencies": {
49
- "@aguacerowx/javascript-sdk": "^0.0.29",
50
- "base64-js": "^1.5.1"
51
- },
52
- "react-native-builder-bob": {
53
- "source": "src",
54
- "output": "lib",
55
- "targets": [
56
- "commonjs",
57
- "module",
58
- [
59
- "typescript",
60
- {
61
- "project": "tsconfig.json"
62
- }
63
- ]
64
- ]
65
- },
66
- "codegenConfig": {
67
- "name": "AguaceroWxReactNativeSpec",
68
- "type": "components",
69
- "jsSrcsDir": "src",
70
- "android": {
71
- "javaPackageName": "com.aguacerowx.reactnative"
72
- }
73
- }
74
- }
1
+ {
2
+ "name": "@aguacerowx/react-native",
3
+ "version": "0.0.54",
4
+ "description": "Native weather rendering for React Native",
5
+ "license": "MIT",
6
+ "author": "Michael Barletta",
7
+ "keywords": [
8
+ "react-native",
9
+ "android",
10
+ "weather",
11
+ "map"
12
+ ],
13
+ "main": "lib/commonjs/index.js",
14
+ "module": "lib/module/index.js",
15
+ "types": "lib/typescript/index.d.ts",
16
+ "react-native": "index.js",
17
+ "source": "index.js",
18
+ "files": [
19
+ "LICENSE",
20
+ "src",
21
+ "index.js",
22
+ "lib",
23
+ "android",
24
+ "ios",
25
+ "cpp",
26
+ "*.podspec",
27
+ "ios/generated",
28
+ "ios/compiled-shaders",
29
+ "android/src/main/java/com/facebook/react/viewmanagers"
30
+ ],
31
+ "scripts": {
32
+ "compile-shaders": "node scripts/compile-shaders.js",
33
+ "clean": "node -e \"require('fs').rmSync('lib', {recursive: true, force: true})\"",
34
+ "build": "npm run compile-shaders && npm run clean && bob build",
35
+ "prepare": "npm run build",
36
+ "prepublishOnly": "npm run build && node ../../scripts/minify-js-tree.mjs lib src index.js"
37
+ },
38
+ "devDependencies": {
39
+ "proj4": "^2.11.0",
40
+ "react-native-builder-bob": "^0.23.2",
41
+ "typescript": "^5.0.2"
42
+ },
43
+ "peerDependencies": {
44
+ "@rnmapbox/maps": "*",
45
+ "react": "*",
46
+ "react-native": "*",
47
+ "react-native-device-info": ">=10.0.0"
48
+ },
49
+ "dependencies": {
50
+ "@aguacerowx/javascript-sdk": "^0.0.31",
51
+ "base64-js": "^1.5.1"
52
+ },
53
+ "react-native-builder-bob": {
54
+ "source": "src",
55
+ "output": "lib",
56
+ "targets": [
57
+ "commonjs",
58
+ "module",
59
+ [
60
+ "typescript",
61
+ {
62
+ "project": "tsconfig.json"
63
+ }
64
+ ]
65
+ ]
66
+ },
67
+ "codegenConfig": {
68
+ "name": "AguaceroWxReactNativeSpec",
69
+ "type": "components",
70
+ "jsSrcsDir": "src",
71
+ "android": {
72
+ "javaPackageName": "com.aguacerowx.reactnative"
73
+ }
74
+ }
75
+ }
@@ -1,7 +1 @@
1
- import React from 'react';
2
-
3
- /**
4
- * Map + anchors from {@link MapManager}: `getMap`, `getCenter`, `weatherBeforeLayerId`, `resolvedStyleURL`.
5
- * When `weatherBeforeLayerId` is null, weather layers use `AML_-_terrain` (Aguacero base style).
6
- */
7
- export const AguaceroContext = React.createContext(null);
1
+ import t from"react";export const AguaceroContext=t.createContext(null);
@@ -1,128 +1 @@
1
- // packages/react-native/src/GridRenderLayer.js
2
-
3
- import React, { useRef, useImperativeHandle, forwardRef } from 'react';
4
- import { UIManager, findNodeHandle, StyleSheet } from 'react-native';
5
- import GridRenderView from './GridRenderLayerNativeComponent';
6
-
7
- const NATIVE_COMPONENT_NAME = 'GridRenderLayer';
8
-
9
- export const GridRenderLayer = forwardRef((props, ref) => {
10
- const nativeRef = useRef(null);
11
-
12
- const getCommandId = (commandName) => {
13
- try {
14
- const config = UIManager.getViewManagerConfig(NATIVE_COMPONENT_NAME);
15
- return config?.Commands?.[commandName] ?? null;
16
- } catch {
17
- return null;
18
- }
19
- };
20
-
21
- useImperativeHandle(ref, () => ({
22
- updateGeometry: (corners, gridDef) => {
23
- if (!nativeRef.current) return;
24
- const commandId = getCommandId('updateGeometry');
25
- if (commandId == null) return;
26
- const handle = findNodeHandle(nativeRef.current);
27
- UIManager.dispatchViewManagerCommand(handle, commandId, [corners, gridDef]);
28
- },
29
-
30
- setVariable: (variableName) => {
31
- if (!nativeRef.current) return;
32
- const commandId = getCommandId('setVariable');
33
- if (commandId == null) return;
34
- UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, [variableName]);
35
- },
36
-
37
- updateDataTextureFromFile: (filePath, nx, ny, scale, offset, missing, scaleType) => {
38
- if (!nativeRef.current) return;
39
- const commandId = getCommandId('updateDataTexture');
40
- if (commandId == null) return;
41
- UIManager.dispatchViewManagerCommand(
42
- findNodeHandle(nativeRef.current),
43
- commandId,
44
- [filePath, Number(nx), Number(ny), Number(scale), Number(offset), Number(missing), scaleType || 'linear'],
45
- );
46
- },
47
-
48
- updateDataTexture: (base64Data, nx, ny, scale, offset, missing, scaleType) => {
49
- if (!nativeRef.current) return;
50
- const commandId = getCommandId('updateDataTexture');
51
- if (commandId == null) return;
52
- UIManager.dispatchViewManagerCommand(
53
- findNodeHandle(nativeRef.current),
54
- commandId,
55
- [base64Data, Number(nx), Number(ny), Number(scale), Number(offset), Number(missing), scaleType || 'linear'],
56
- );
57
- },
58
-
59
- updateColormapTexture: (colormapArray) => {
60
- if (!nativeRef.current) return;
61
- const commandId = getCommandId('updateColormapTexture');
62
- if (commandId == null) return;
63
- UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, [colormapArray]);
64
- },
65
-
66
- updateDataParameters: (scale, offset, missing, scaleType) => {
67
- if (!nativeRef.current) return;
68
- const commandId = getCommandId('updateDataParameters');
69
- if (commandId == null) return;
70
- UIManager.dispatchViewManagerCommand(
71
- findNodeHandle(nativeRef.current),
72
- commandId,
73
- [Number(scale), Number(offset), Number(missing), Number(scaleType)],
74
- );
75
- },
76
-
77
- setSmoothing: (enabled) => {
78
- if (!nativeRef.current) return;
79
- nativeRef.current.setNativeProps({ smoothing: enabled });
80
- },
81
-
82
- clear: () => {
83
- if (!nativeRef.current) return;
84
- const commandId = getCommandId('clear');
85
- if (commandId == null) return;
86
- UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, []);
87
- },
88
-
89
- primeGpuCache: (frameInfo) => {
90
- if (!nativeRef.current) return;
91
- const commandId = getCommandId('primeGpuCache');
92
- if (commandId == null) return;
93
- UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, [frameInfo]);
94
- },
95
-
96
- setActiveFrame: (cacheKey) => {
97
- if (!nativeRef.current) return;
98
- const commandId = getCommandId('setActiveFrame');
99
- if (commandId == null) return;
100
- UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, [cacheKey]);
101
- },
102
-
103
- clearGpuCache: () => {
104
- if (!nativeRef.current) return;
105
- const commandId = getCommandId('clearGpuCache');
106
- if (commandId == null) return;
107
- UIManager.dispatchViewManagerCommand(findNodeHandle(nativeRef.current), commandId, []);
108
- },
109
- }));
110
-
111
- return (
112
- <GridRenderView
113
- ref={nativeRef}
114
- opacity={props.opacity}
115
- dataRange={props.dataRange}
116
- belowID={props.belowID}
117
- smoothing={true}
118
- style={styles.overlay}
119
- pointerEvents="none"
120
- />
121
- );
122
- });
123
-
124
- const styles = StyleSheet.create({
125
- overlay: {
126
- ...StyleSheet.absoluteFillObject,
127
- },
128
- });
1
+ import f,{useRef as g,useImperativeHandle as h,forwardRef as C}from"react";import{UIManager as a,findNodeHandle as u,StyleSheet as p}from"react-native";import N from"./GridRenderLayerNativeComponent";const w="GridRenderLayer";export const GridRenderLayer=C((l,b)=>{const r=g(null),n=e=>{try{return a.getViewManagerConfig(w)?.Commands?.[e]??null}catch{return null}};return h(b,()=>({updateGeometry:(e,t)=>{if(!r.current)return;const c=n("updateGeometry");if(c==null)return;const o=u(r.current);a.dispatchViewManagerCommand(o,c,[e,t])},setVariable:e=>{if(!r.current)return;const t=n("setVariable");t!=null&&a.dispatchViewManagerCommand(u(r.current),t,[e])},updateDataTextureFromFile:(e,t,c,o,m,s,d)=>{if(!r.current)return;const i=n("updateDataTexture");i!=null&&a.dispatchViewManagerCommand(u(r.current),i,[e,Number(t),Number(c),Number(o),Number(m),Number(s),d||"linear"])},updateDataTexture:(e,t,c,o,m,s,d)=>{if(!r.current)return;const i=n("updateDataTexture");i!=null&&a.dispatchViewManagerCommand(u(r.current),i,[e,Number(t),Number(c),Number(o),Number(m),Number(s),d||"linear"])},updateColormapTexture:e=>{if(!r.current)return;const t=n("updateColormapTexture");t!=null&&a.dispatchViewManagerCommand(u(r.current),t,[e])},updateDataParameters:(e,t,c,o)=>{if(!r.current)return;const m=n("updateDataParameters");m!=null&&a.dispatchViewManagerCommand(u(r.current),m,[Number(e),Number(t),Number(c),Number(o)])},setSmoothing:e=>{r.current&&r.current.setNativeProps({smoothing:e})},clear:()=>{if(!r.current)return;const e=n("clear");e!=null&&a.dispatchViewManagerCommand(u(r.current),e,[])},primeGpuCache:e=>{if(!r.current)return;const t=n("primeGpuCache");t!=null&&a.dispatchViewManagerCommand(u(r.current),t,[e])},setActiveFrame:e=>{if(!r.current)return;const t=n("setActiveFrame");t!=null&&a.dispatchViewManagerCommand(u(r.current),t,[e])},clearGpuCache:()=>{if(!r.current)return;const e=n("clearGpuCache");e!=null&&a.dispatchViewManagerCommand(u(r.current),e,[])}})),f.createElement(N,{ref:r,opacity:l.opacity,dataRange:l.dataRange,belowID:l.belowID,smoothing:!0,style:V.overlay,pointerEvents:"none"})});const V=p.create({overlay:{...p.absoluteFillObject}});
package/src/MapManager.js CHANGED
@@ -1,277 +1 @@
1
- // packages/react-native/src/MapManager.js
2
-
3
- import React, { useMemo, useEffect, useState, useRef, forwardRef, useImperativeHandle } from 'react';
4
- import { View, StyleSheet, Text } from 'react-native';
5
- import Mapbox from '@rnmapbox/maps';
6
- import { THEME_CONFIGS } from '@aguacerowx/javascript-sdk';
7
- import { StyleApplicator } from './StyleApplicator';
8
- import { AguaceroContext } from './AguaceroContext';
9
- import { mapRegistry } from './MapRegistry';
10
-
11
- const BASE_STYLE_URL = 'mapbox://styles/aguacerowx/cmfvox8mq004u01qm5nlg7qkt';
12
-
13
- // --- UTILITIES ---
14
- function isObject(item) {
15
- return (item && typeof item === 'object' && !Array.isArray(item));
16
- }
17
-
18
- function deepMerge(target, source) {
19
- const output = { ...target };
20
- if (isObject(target) && isObject(source)) {
21
- Object.keys(source).forEach(key => {
22
- if (isObject(source[key])) {
23
- if (!(key in target)) {
24
- Object.assign(output, { [key]: source[key] });
25
- } else {
26
- output[key] = deepMerge(target[key], source[key]);
27
- }
28
- } else {
29
- Object.assign(output, { [key]: source[key] });
30
- }
31
- });
32
- }
33
- return output;
34
- }
35
-
36
- /**
37
- * @param {object} props
38
- * @param {string} props.mapboxToken
39
- * @param {object} [props.customStyles]
40
- * @param {'light'|'dark'} [props.theme]
41
- * @param {object} [props.mapOptions] - `style` / `styleURL` / `styleUrl` set the map style when no top-level custom style pair is used (mapsgl parity).
42
- * @param {string} [props.styleURL] - Custom Mapbox style URL (alias: `styleUrl`).
43
- * @param {string} [props.styleUrl]
44
- * @param {string} [props.belowID] - Style layer id to insert Aguacero weather **below** (alias: `weatherBeforeLayerId`). With `styleURL`, required for correct stacking; may be set alone to override the default `AML_-_terrain` anchor on the default style.
45
- * @param {string} [props.weatherBeforeLayerId]
46
- * @param {import('react').ReactNode} [props.children] - Render inside Mapbox.MapView; use for WeatherLayerManager so map sources (e.g. NEXRAD site circles) register on the map.
47
- */
48
- export const MapManager = forwardRef(({
49
- mapboxToken,
50
- customStyles,
51
- theme = 'light',
52
- mapOptions = {},
53
- styleURL: styleURLProp,
54
- styleUrl: styleUrlProp,
55
- belowID: belowIDProp,
56
- weatherBeforeLayerId: weatherBeforeLayerIdProp,
57
- children,
58
- }, ref) => {
59
- const mapRef = useRef(null);
60
- const cameraRef = useRef(null);
61
- const [mapStyle, setMapStyle] = useState(null);
62
-
63
- const { resolvedStyleURL, weatherBeforeLayerId } = useMemo(() => {
64
- const mo = mapOptions || {};
65
- let resolved = BASE_STYLE_URL;
66
- if (mo.style !== undefined) {
67
- resolved = mo.style;
68
- } else if (mo.styleURL !== undefined) {
69
- resolved = mo.styleURL;
70
- } else if (mo.styleUrl !== undefined) {
71
- resolved = mo.styleUrl;
72
- }
73
-
74
- let anchor = null;
75
- const customStyleUrl = styleURLProp || styleUrlProp;
76
- const customBeforeId = belowIDProp || weatherBeforeLayerIdProp;
77
- if (customStyleUrl) {
78
- if (customBeforeId && String(customBeforeId).trim()) {
79
- resolved = customStyleUrl;
80
- anchor = String(customBeforeId).trim();
81
- } else if (mo.style === undefined && mo.styleURL === undefined && mo.styleUrl === undefined) {
82
- resolved = BASE_STYLE_URL;
83
- }
84
- } else if (customBeforeId && String(customBeforeId).trim()) {
85
- anchor = String(customBeforeId).trim();
86
- }
87
-
88
- return { resolvedStyleURL: resolved, weatherBeforeLayerId: anchor };
89
- }, [mapOptions, styleURLProp, styleUrlProp, belowIDProp, weatherBeforeLayerIdProp]);
90
-
91
- // Expose camera and map methods via ref
92
- useImperativeHandle(ref, () => ({
93
- // Camera methods
94
- flyTo: (config) => {
95
- if (cameraRef.current) {
96
- cameraRef.current.flyTo(config);
97
- }
98
- },
99
- moveTo: (config) => {
100
- if (cameraRef.current) {
101
- cameraRef.current.moveTo(config);
102
- }
103
- },
104
- zoomTo: (zoomLevel, duration = 2000) => {
105
- if (cameraRef.current) {
106
- cameraRef.current.zoomTo(zoomLevel, duration);
107
- }
108
- },
109
- setCamera: (config) => {
110
- if (cameraRef.current) {
111
- cameraRef.current.setCamera(config);
112
- }
113
- },
114
-
115
- // Map methods
116
- getCenter: async () => {
117
- if (mapRef.current) {
118
- return await mapRef.current.getCenter();
119
- }
120
- return null;
121
- },
122
- getZoom: async () => {
123
- if (mapRef.current) {
124
- return await mapRef.current.getZoom();
125
- }
126
- return null;
127
- },
128
- getCoordinateFromView: async (point) => {
129
- if (mapRef.current) {
130
- return await mapRef.current.getCoordinateFromView(point);
131
- }
132
- return null;
133
- },
134
- getPointInView: async (coordinate) => {
135
- if (mapRef.current) {
136
- return await mapRef.current.getPointInView(coordinate);
137
- }
138
- return null;
139
- },
140
- queryRenderedFeaturesAtPoint: async (point, filter, layerIds) => {
141
- if (mapRef.current) {
142
- return await mapRef.current.queryRenderedFeaturesAtPoint(point, filter, layerIds);
143
- }
144
- return null;
145
- },
146
-
147
- // Direct access to refs (for advanced use cases)
148
- getMapRef: () => mapRef.current,
149
- getCameraRef: () => cameraRef.current,
150
- }), []);
151
-
152
- // Register map with the global registry when it's ready
153
- useEffect(() => {
154
- if (mapRef.current) {
155
- mapRegistry.setMap(mapRef.current);
156
- }
157
- }, []);
158
-
159
- const contextValue = useMemo(() => ({
160
- getMap: () => mapRef.current,
161
- getCenter: () => {
162
- return mapRef.current?._currentCenter || [-95.7129, 37.0902];
163
- },
164
- /** @type {string | null} Null with default Aguacero style — use `AML_-_terrain` for weather insert (see WeatherLayerManager). */
165
- weatherBeforeLayerId,
166
- resolvedStyleURL,
167
- }), [weatherBeforeLayerId, resolvedStyleURL]);
168
-
169
- useEffect(() => {
170
- let lightTheme = JSON.parse(JSON.stringify(THEME_CONFIGS.light));
171
- let darkTheme = JSON.parse(JSON.stringify(THEME_CONFIGS.dark));
172
-
173
- if (customStyles) {
174
- if (customStyles.light) {
175
- lightTheme = deepMerge(lightTheme, customStyles.light);
176
- }
177
- if (customStyles.dark) {
178
- darkTheme = deepMerge(darkTheme, customStyles.dark);
179
- }
180
- }
181
-
182
- setMapStyle(theme === 'dark' ? darkTheme : lightTheme);
183
- }, [customStyles, theme]);
184
-
185
- useEffect(() => {
186
- if (mapboxToken) {
187
- Mapbox.setAccessToken(mapboxToken);
188
- }
189
- }, [mapboxToken]);
190
-
191
- if (!mapboxToken) {
192
- return (
193
- <View style={[styles.container, styles.centerContent]}>
194
- <Text style={styles.errorText}>Mapbox Token Missing</Text>
195
- <Text style={styles.errorSubText}>Please provide the 'mapboxToken' prop.</Text>
196
- </View>
197
- );
198
- }
199
-
200
- const handleCameraChange = (event) => {
201
- if (event?.properties?.center) {
202
- const center = event.properties.center;
203
-
204
- // Store the current center in the ref for immediate access
205
- if (mapRef.current) {
206
- mapRef.current._currentCenter = center;
207
- }
208
-
209
- mapRegistry.notifyCameraChange(center);
210
- }
211
- };
212
-
213
- const handleMapPress = (payload) => {
214
- mapRegistry.notifyMapPress(payload);
215
- };
216
-
217
- return (
218
- <View style={styles.container}>
219
- <AguaceroContext.Provider value={contextValue}>
220
- <Mapbox.MapView
221
- ref={mapRef}
222
- style={styles.map}
223
- styleURL={resolvedStyleURL}
224
- scaleBarEnabled={false}
225
- onCameraChanged={handleCameraChange}
226
- onPress={handleMapPress}
227
- >
228
- <Mapbox.Camera
229
- ref={cameraRef}
230
- defaultSettings={{
231
- centerCoordinate: mapOptions.center || [-15.7129, 37.0902],
232
- zoomLevel: mapOptions.zoom || 0,
233
- pitch: mapOptions.pitch || 0,
234
- bearing: mapOptions.bearing || 0,
235
- minZoomLevel: mapOptions.minZoom || 2,
236
- maxZoomLevel: mapOptions.maxZoom || 12,
237
- }}
238
- />
239
-
240
- {mapStyle && <StyleApplicator styles={mapStyle} />}
241
-
242
- <Mapbox.VectorSource id="mapbox-dem" url="mapbox://mapbox.mapbox-terrain-dem-v1"/>
243
- {children}
244
- </Mapbox.MapView>
245
- </AguaceroContext.Provider>
246
- </View>
247
- );
248
- });
249
-
250
- const styles = StyleSheet.create({
251
- /**
252
- * Full-bleed positioning so RNMapbox/Mapbox gets non-zero bounds on the first layout pass.
253
- * A plain flex:1 sibling tree (e.g. map + absolute overlays under Expo Tabs) can still yield
254
- * a transient 0×0 MapView, which triggers maps-core "Invalid size … fall back to {64, 64}".
255
- */
256
- container: {
257
- ...StyleSheet.absoluteFillObject,
258
- backgroundColor: '#1a1a2e',
259
- },
260
- centerContent: {
261
- justifyContent: 'center',
262
- alignItems: 'center',
263
- },
264
- map: {
265
- ...StyleSheet.absoluteFillObject,
266
- },
267
- errorText: {
268
- color: '#FF6B6B',
269
- fontSize: 22,
270
- fontWeight: 'bold',
271
- },
272
- errorSubText: {
273
- color: 'white',
274
- fontSize: 16,
275
- marginTop: 8,
276
- }
277
- });
1
+ import l,{useMemo as E,useEffect as g,useState as V,useRef as R,forwardRef as z,useImperativeHandle as Z}from"react";import{View as U,StyleSheet as f,Text as M}from"react-native";import y from"@rnmapbox/maps";import{THEME_CONFIGS as k}from"@aguacerowx/javascript-sdk";import{StyleApplicator as q}from"./StyleApplicator";import{AguaceroContext as N}from"./AguaceroContext";import{mapRegistry as d}from"./MapRegistry";const O="mapbox://styles/aguacerowx/cmfvox8mq004u01qm5nlg7qkt";function b(o){return o&&typeof o=="object"&&!Array.isArray(o)}function C(o,a){const c={...o};return b(o)&&b(a)&&Object.keys(a).forEach(t=>{b(a[t])?t in o?c[t]=C(o[t],a[t]):Object.assign(c,{[t]:a[t]}):Object.assign(c,{[t]:a[t]})}),c}export const MapManager=z(({mapboxToken:o,customStyles:a,theme:c="light",mapOptions:t={},styleURL:S,styleUrl:v,belowID:h,weatherBeforeLayerId:w,children:F},I)=>{const r=R(null),s=R(null),[x,P]=V(null),{resolvedStyleURL:p,weatherBeforeLayerId:T}=E(()=>{const e=t||{};let n=O;e.style!==void 0?n=e.style:e.styleURL!==void 0?n=e.styleURL:e.styleUrl!==void 0&&(n=e.styleUrl);let u=null;const L=S||v,i=h||w;return L?i&&String(i).trim()?(n=L,u=String(i).trim()):e.style===void 0&&e.styleURL===void 0&&e.styleUrl===void 0&&(n=O):i&&String(i).trim()&&(u=String(i).trim()),{resolvedStyleURL:n,weatherBeforeLayerId:u}},[t,S,v,h,w]);Z(I,()=>({flyTo:e=>{s.current&&s.current.flyTo(e)},moveTo:e=>{s.current&&s.current.moveTo(e)},zoomTo:(e,n=2e3)=>{s.current&&s.current.zoomTo(e,n)},setCamera:e=>{s.current&&s.current.setCamera(e)},getCenter:async()=>r.current?await r.current.getCenter():null,getZoom:async()=>r.current?await r.current.getZoom():null,getCoordinateFromView:async e=>r.current?await r.current.getCoordinateFromView(e):null,getPointInView:async e=>r.current?await r.current.getPointInView(e):null,queryRenderedFeaturesAtPoint:async(e,n,u)=>r.current?await r.current.queryRenderedFeaturesAtPoint(e,n,u):null,getMapRef:()=>r.current,getCameraRef:()=>s.current}),[]),g(()=>{r.current&&d.setMap(r.current)},[]);const j=E(()=>({getMap:()=>r.current,getCenter:()=>r.current?._currentCenter||[-95.7129,37.0902],weatherBeforeLayerId:T,resolvedStyleURL:p}),[T,p]);if(g(()=>{let e=JSON.parse(JSON.stringify(k.light)),n=JSON.parse(JSON.stringify(k.dark));a&&(a.light&&(e=C(e,a.light)),a.dark&&(n=C(n,a.dark))),P(c==="dark"?n:e)},[a,c]),g(()=>{o&&y.setAccessToken(o)},[o]),!o)return l.createElement(U,{style:[m.container,m.centerContent]},l.createElement(M,{style:m.errorText},"Mapbox Token Missing"),l.createElement(M,{style:m.errorSubText},"Please provide the 'mapboxToken' prop."));const A=e=>{if(e?.properties?.center){const n=e.properties.center;r.current&&(r.current._currentCenter=n),d.notifyCameraChange(n)}},B=e=>{d.notifyMapPress(e)};return l.createElement(U,{style:m.container},l.createElement(N.Provider,{value:j},l.createElement(y.MapView,{ref:r,style:m.map,styleURL:p,scaleBarEnabled:!1,onCameraChanged:A,onPress:B},l.createElement(y.Camera,{ref:s,defaultSettings:{centerCoordinate:t.center||[-15.7129,37.0902],zoomLevel:t.zoom||0,pitch:t.pitch||0,bearing:t.bearing||0,minZoomLevel:t.minZoom||2,maxZoomLevel:t.maxZoom||12}}),x&&l.createElement(q,{styles:x}),l.createElement(y.VectorSource,{id:"mapbox-dem",url:"mapbox://mapbox.mapbox-terrain-dem-v1"}),F)))});const m=f.create({container:{...f.absoluteFillObject,backgroundColor:"#1a1a2e"},centerContent:{justifyContent:"center",alignItems:"center"},map:{...f.absoluteFillObject},errorText:{color:"#FF6B6B",fontSize:22,fontWeight:"bold"},errorSubText:{color:"white",fontSize:16,marginTop:8}});
@@ -1,56 +1 @@
1
- // Simple registry to share the map instance
2
- class MapRegistry {
3
- constructor() {
4
- this.mapRef = null;
5
- this.listeners = [];
6
- /** @type {((payload: unknown) => void)[]} */
7
- this.pressListeners = [];
8
- }
9
-
10
- setMap(mapRef) {
11
- this.mapRef = mapRef;
12
- }
13
-
14
- getMap() {
15
- return this.mapRef;
16
- }
17
-
18
- addCameraListener(listener) {
19
- this.listeners.push(listener);
20
- }
21
-
22
- removeCameraListener(listener) {
23
- const index = this.listeners.indexOf(listener);
24
- if (index > -1) {
25
- this.listeners.splice(index, 1);
26
- }
27
- }
28
-
29
- notifyCameraChange(center) {
30
- this.listeners.forEach(listener => listener(center));
31
- }
32
-
33
- addPressListener(listener) {
34
- this.pressListeners.push(listener);
35
- }
36
-
37
- removePressListener(listener) {
38
- const index = this.pressListeners.indexOf(listener);
39
- if (index > -1) {
40
- this.pressListeners.splice(index, 1);
41
- }
42
- }
43
-
44
- /** @param {unknown} payload - `@rnmapbox/maps` map press payload */
45
- notifyMapPress(payload) {
46
- this.pressListeners.forEach((listener) => {
47
- try {
48
- listener(payload);
49
- } catch {
50
- /* ignore */
51
- }
52
- });
53
- }
54
- }
55
-
56
- export const mapRegistry = new MapRegistry();
1
+ class t{constructor(){this.mapRef=null,this.listeners=[],this.pressListeners=[]}setMap(s){this.mapRef=s}getMap(){return this.mapRef}addCameraListener(s){this.listeners.push(s)}removeCameraListener(s){const e=this.listeners.indexOf(s);e>-1&&this.listeners.splice(e,1)}notifyCameraChange(s){this.listeners.forEach(e=>e(s))}addPressListener(s){this.pressListeners.push(s)}removePressListener(s){const e=this.pressListeners.indexOf(s);e>-1&&this.pressListeners.splice(e,1)}notifyMapPress(s){this.pressListeners.forEach(e=>{try{e(s)}catch{}})}}export const mapRegistry=new t;