@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
@@ -1,121 +1 @@
1
- import React, { forwardRef, useImperativeHandle, useRef } from 'react';
2
- import { StyleSheet, UIManager, findNodeHandle } from 'react-native';
3
- import NexradRadarLayerNative from './NexradRadarLayerNativeComponent';
4
- import { nexradDiag, nexradPerfSpan } from './nexrad/nexradDiag';
5
- import { resolveNexradCommandId } from './nexrad/nexradNativeCommandIds';
6
-
7
- const NATIVE_COMPONENT_NAME = 'NexradRadarLayer';
8
-
9
- function getCommandId(commandName) {
10
- return resolveNexradCommandId(commandName);
11
- }
12
-
13
- export const NexradRadarLayer = forwardRef((props, ref) => {
14
- const nativeRef = useRef(null);
15
-
16
- useImperativeHandle(ref, () => ({
17
- uploadNexradFrame(json) {
18
- const bridge = nexradPerfSpan('bridge.dispatchViewManagerCommand.uploadNexradFrame');
19
- const id = getCommandId('uploadNexradFrame');
20
- const handle = findNodeHandle(nativeRef.current);
21
- if (id != null && handle != null) {
22
- UIManager.dispatchViewManagerCommand(handle, id, [json]);
23
- bridge.end({
24
- jsonChars: typeof json === 'string' ? json.length : 0,
25
- ok: true,
26
- });
27
- } else {
28
- bridge.end({
29
- jsonChars: typeof json === 'string' ? json.length : 0,
30
- ok: false,
31
- commandId: id,
32
- hasHandle: handle != null,
33
- hasRef: nativeRef.current != null,
34
- });
35
- nexradDiag('bridge.uploadNexradFrameBlocked', {
36
- commandId: id,
37
- hasHandle: handle != null,
38
- hasRef: nativeRef.current != null,
39
- });
40
- }
41
- },
42
- uploadNexradStyleOnly(json) {
43
- const bridge = nexradPerfSpan('bridge.dispatchViewManagerCommand.uploadNexradStyleOnly');
44
- const id = getCommandId('uploadNexradStyleOnly');
45
- const handle = findNodeHandle(nativeRef.current);
46
- if (id != null && handle != null) {
47
- UIManager.dispatchViewManagerCommand(handle, id, [json]);
48
- bridge.end({
49
- jsonChars: typeof json === 'string' ? json.length : 0,
50
- ok: true,
51
- });
52
- } else {
53
- bridge.end({
54
- jsonChars: typeof json === 'string' ? json.length : 0,
55
- ok: false,
56
- commandId: id,
57
- hasHandle: handle != null,
58
- });
59
- nexradDiag('bridge.uploadNexradStyleOnlyBlocked', {
60
- commandId: id,
61
- hasHandle: handle != null,
62
- });
63
- }
64
- },
65
- clearNexrad() {
66
- const bridge = nexradPerfSpan('bridge.dispatchViewManagerCommand.clearNexrad');
67
- const id = getCommandId('clearNexrad');
68
- const handle = findNodeHandle(nativeRef.current);
69
- if (id != null && handle != null) {
70
- UIManager.dispatchViewManagerCommand(handle, id, []);
71
- bridge.end({ ok: true });
72
- } else {
73
- bridge.end({ ok: false, commandId: id, hasHandle: handle != null });
74
- }
75
- },
76
- activateNexradCachedFrame(nativeGpuCacheKey) {
77
- const bridge = nexradPerfSpan('bridge.dispatchViewManagerCommand.activateNexradCachedFrame');
78
- const id = getCommandId('activateNexradCachedFrame');
79
- const handle = findNodeHandle(nativeRef.current);
80
- if (id != null && handle != null && typeof nativeGpuCacheKey === 'string') {
81
- UIManager.dispatchViewManagerCommand(handle, id, [nativeGpuCacheKey]);
82
- bridge.end({
83
- keyLen: nativeGpuCacheKey.length,
84
- ok: true,
85
- });
86
- } else {
87
- bridge.end({
88
- keyLen: typeof nativeGpuCacheKey === 'string' ? nativeGpuCacheKey.length : 0,
89
- ok: false,
90
- commandId: id,
91
- hasHandle: handle != null,
92
- });
93
- nexradDiag('bridge.activateNexradCachedFrameBlocked', {
94
- commandId: id,
95
- hasHandle: handle != null,
96
- keyType: typeof nativeGpuCacheKey,
97
- });
98
- }
99
- },
100
- }));
101
-
102
- return (
103
- <NexradRadarLayerNative
104
- ref={nativeRef}
105
- belowID={props.belowID}
106
- style={styles.overlay}
107
- pointerEvents="none"
108
- collapsable={false}
109
- />
110
- );
111
- });
112
-
113
- const styles = StyleSheet.create({
114
- overlay: {
115
- ...StyleSheet.absoluteFillObject,
116
- },
117
- });
118
-
119
- NexradRadarLayer.displayName = 'NexradRadarLayer';
120
-
121
- export default NexradRadarLayer;
1
+ import n,{forwardRef as s,useImperativeHandle as c,useRef as m}from"react";import{StyleSheet as t,UIManager as u,findNodeHandle as p}from"react-native";import i from"./NexradRadarLayerNativeComponent";import{resolveNexradCommandId as x}from"./nexradNativeCommandIds";const N="NexradRadarLayer";function l(r,o,a=[]){const e=x(o),d=p(r.current);return e!=null&&d!=null?(u.dispatchViewManagerCommand(d,e,a),!0):(__DEV__&&console.warn(`[Aguacero][NexradRadarLayer] ${o} blocked`,{commandId:e,hasHandle:d!=null,hasRef:r.current!=null,component:N}),!1)}export const NexradRadarLayer=s((r,o)=>{const a=m(null);return c(o,()=>({uploadNexradFrame(e){l(a,"uploadNexradFrame",[e])},uploadNexradStyleOnly(e){l(a,"uploadNexradStyleOnly",[e])},clearNexrad(){l(a,"clearNexrad",[])},activateNexradCachedFrame(e){typeof e=="string"&&l(a,"activateNexradCachedFrame",[e])}})),n.createElement(i,{ref:a,belowID:r.belowID,style:f.overlay,pointerEvents:"none",collapsable:!1})});const f=t.create({overlay:{...t.absoluteFillObject}});NexradRadarLayer.displayName="NexradRadarLayer";export default NexradRadarLayer;
@@ -1,115 +1 @@
1
- import React, { forwardRef, useImperativeHandle, useRef } from 'react';
2
- import { StyleSheet, UIManager, findNodeHandle } from 'react-native';
3
- import NexradRadarLayerNative from './NexradRadarLayerNativeComponent';
4
- import { nexradDiag, nexradPerfSpan } from './nexrad/nexradDiag';
5
- import { resolveNexradCommandId } from './nexrad/nexradNativeCommandIds';
6
-
7
- export const NexradRadarLayer = forwardRef((props, ref) => {
8
- const nativeRef = useRef(null);
9
-
10
- useImperativeHandle(ref, () => ({
11
- uploadNexradFrame(json) {
12
- const bridge = nexradPerfSpan('bridge.dispatchViewManagerCommand.uploadNexradFrame');
13
- const id = resolveNexradCommandId('uploadNexradFrame');
14
- const handle = findNodeHandle(nativeRef.current);
15
- if (id != null && handle != null) {
16
- UIManager.dispatchViewManagerCommand(handle, id, [json]);
17
- bridge.end({
18
- jsonChars: typeof json === 'string' ? json.length : 0,
19
- ok: true,
20
- });
21
- } else {
22
- bridge.end({
23
- jsonChars: typeof json === 'string' ? json.length : 0,
24
- ok: false,
25
- commandId: id,
26
- hasHandle: handle != null,
27
- hasRef: nativeRef.current != null,
28
- });
29
- nexradDiag('bridge.uploadNexradFrameBlocked', {
30
- commandId: id,
31
- hasHandle: handle != null,
32
- hasRef: nativeRef.current != null,
33
- });
34
- }
35
- },
36
- uploadNexradStyleOnly(json) {
37
- const bridge = nexradPerfSpan('bridge.dispatchViewManagerCommand.uploadNexradStyleOnly');
38
- const id = resolveNexradCommandId('uploadNexradStyleOnly');
39
- const handle = findNodeHandle(nativeRef.current);
40
- if (id != null && handle != null) {
41
- UIManager.dispatchViewManagerCommand(handle, id, [json]);
42
- bridge.end({
43
- jsonChars: typeof json === 'string' ? json.length : 0,
44
- ok: true,
45
- });
46
- } else {
47
- bridge.end({
48
- jsonChars: typeof json === 'string' ? json.length : 0,
49
- ok: false,
50
- commandId: id,
51
- hasHandle: handle != null,
52
- });
53
- nexradDiag('bridge.uploadNexradStyleOnlyBlocked', {
54
- commandId: id,
55
- hasHandle: handle != null,
56
- });
57
- }
58
- },
59
- clearNexrad() {
60
- const bridge = nexradPerfSpan('bridge.dispatchViewManagerCommand.clearNexrad');
61
- const id = resolveNexradCommandId('clearNexrad');
62
- const handle = findNodeHandle(nativeRef.current);
63
- if (id != null && handle != null) {
64
- UIManager.dispatchViewManagerCommand(handle, id, []);
65
- bridge.end({ ok: true });
66
- } else {
67
- bridge.end({ ok: false, commandId: id, hasHandle: handle != null });
68
- }
69
- },
70
- activateNexradCachedFrame(nativeGpuCacheKey) {
71
- const bridge = nexradPerfSpan('bridge.dispatchViewManagerCommand.activateNexradCachedFrame');
72
- const id = resolveNexradCommandId('activateNexradCachedFrame');
73
- const handle = findNodeHandle(nativeRef.current);
74
- if (id != null && handle != null && typeof nativeGpuCacheKey === 'string') {
75
- UIManager.dispatchViewManagerCommand(handle, id, [nativeGpuCacheKey]);
76
- bridge.end({
77
- keyLen: nativeGpuCacheKey.length,
78
- ok: true,
79
- });
80
- } else {
81
- bridge.end({
82
- keyLen: typeof nativeGpuCacheKey === 'string' ? nativeGpuCacheKey.length : 0,
83
- ok: false,
84
- commandId: id,
85
- hasHandle: handle != null,
86
- });
87
- nexradDiag('bridge.activateNexradCachedFrameBlocked', {
88
- commandId: id,
89
- hasHandle: handle != null,
90
- keyType: typeof nativeGpuCacheKey,
91
- });
92
- }
93
- },
94
- }));
95
-
96
- return (
97
- <NexradRadarLayerNative
98
- ref={nativeRef}
99
- belowID={props.belowID}
100
- style={styles.overlay}
101
- pointerEvents="none"
102
- collapsable={false}
103
- />
104
- );
105
- });
106
-
107
- const styles = StyleSheet.create({
108
- overlay: {
109
- ...StyleSheet.absoluteFillObject,
110
- },
111
- });
112
-
113
- NexradRadarLayer.displayName = 'NexradRadarLayer';
114
-
115
- export default NexradRadarLayer;
1
+ import n,{forwardRef as s,useImperativeHandle as c,useRef as m}from"react";import{StyleSheet as t,UIManager as u,findNodeHandle as p}from"react-native";import i from"./NexradRadarLayerNativeComponent";import{resolveNexradCommandId as x}from"./nexradNativeCommandIds";function l(o,r,a=[]){const e=x(r),d=p(o.current);return e!=null&&d!=null?(u.dispatchViewManagerCommand(d,e,a),!0):(__DEV__&&console.warn(`[Aguacero][NexradRadarLayer] ${r} blocked`,{commandId:e,hasHandle:d!=null}),!1)}export const NexradRadarLayer=s((o,r)=>{const a=m(null);return c(r,()=>({uploadNexradFrame(e){l(a,"uploadNexradFrame",[e])},uploadNexradStyleOnly(e){l(a,"uploadNexradStyleOnly",[e])},clearNexrad(){l(a,"clearNexrad",[])},activateNexradCachedFrame(e){typeof e=="string"&&l(a,"activateNexradCachedFrame",[e])}})),n.createElement(i,{ref:a,belowID:o.belowID,style:N.overlay,pointerEvents:"none",collapsable:!1})});const N=t.create({overlay:{...t.absoluteFillObject}});NexradRadarLayer.displayName="NexradRadarLayer";export default NexradRadarLayer;
@@ -1,75 +1 @@
1
- /**
2
- * Mapbox GL circle markers for NEXRAD site picking on React Native (parity with mapsgl {@link NexradSitesOverlay}).
3
- * Must render as a descendant of {@link Mapbox.MapView}.
4
- */
5
- import React from 'react';
6
- import Mapbox from '@rnmapbox/maps';
7
- import nexradSitesPayload from './nexrad/nexradSitesUs.json';
8
-
9
- const SOURCE_ID = 'aguacero-nexrad-sites-src';
10
- const CIRCLE_LAYER_ID = 'aguacero-nexrad-sites-circles';
11
-
12
- function buildNexradSitesFeatureCollection() {
13
- const raw = nexradSitesPayload?.sites;
14
- if (!Array.isArray(raw)) {
15
- return { type: 'FeatureCollection', features: [] };
16
- }
17
- const features = [];
18
- for (const item of raw) {
19
- if (!item) continue;
20
- const lon = Number(item.lon ?? item.lng ?? item.longitude);
21
- const lat = Number(item.lat ?? item.latitude);
22
- const id = String(item.id ?? item.station ?? '').toUpperCase();
23
- if (!id || !Number.isFinite(lat) || !Number.isFinite(lon)) continue;
24
- features.push({
25
- type: 'Feature',
26
- geometry: { type: 'Point', coordinates: [lon, lat] },
27
- properties: { id, name: id },
28
- });
29
- }
30
- return { type: 'FeatureCollection', features };
31
- }
32
-
33
- const NEXRAD_SITES_FEATURE_COLLECTION = buildNexradSitesFeatureCollection();
34
-
35
- /**
36
- * @param {object} props
37
- * @param {boolean} props.visible
38
- * @param {(siteId: string) => void} [props.onSelectSite]
39
- * @param {string} [props.belowLayerID] - Optional style layer id to insert under (e.g. weather anchor).
40
- */
41
- export function NexradSitesMapLayer({ visible, onSelectSite, belowLayerID }) {
42
- const handlePress = (e) => {
43
- const list = e?.features;
44
- const f = Array.isArray(list) && list.length > 0 ? list[0] : null;
45
- const id = f?.properties?.id ?? f?.properties?.name;
46
- if (id && typeof onSelectSite === 'function') {
47
- onSelectSite(String(id));
48
- }
49
- };
50
-
51
- if (!visible || !NEXRAD_SITES_FEATURE_COLLECTION.features.length) {
52
- return null;
53
- }
54
-
55
- return (
56
- <Mapbox.ShapeSource
57
- id={SOURCE_ID}
58
- shape={NEXRAD_SITES_FEATURE_COLLECTION}
59
- onPress={handlePress}
60
- hitbox={{ width: 44, height: 44 }}
61
- >
62
- <Mapbox.CircleLayer
63
- id={CIRCLE_LAYER_ID}
64
- belowLayerID={belowLayerID}
65
- style={{
66
- circleRadius: 5,
67
- circleColor: '#3b82f6',
68
- circleStrokeWidth: 1,
69
- circleStrokeColor: '#ffffff',
70
- circleOpacity: 0.95,
71
- }}
72
- />
73
- </Mapbox.ShapeSource>
74
- );
75
- }
1
+ import c from"react";import l from"@rnmapbox/maps";import f from"./nexradSitesUs.json";const p="aguacero-nexrad-sites-src",y="aguacero-nexrad-sites-circles";function d(){const i=f?.sites;if(!Array.isArray(i))return{type:"FeatureCollection",features:[]};const r=[];for(const e of i){if(!e)continue;const o=Number(e.lon??e.lng??e.longitude),n=Number(e.lat??e.latitude),t=String(e.id??e.station??"").toUpperCase();!t||!Number.isFinite(n)||!Number.isFinite(o)||r.push({type:"Feature",geometry:{type:"Point",coordinates:[o,n]},properties:{id:t,name:t}})}return{type:"FeatureCollection",features:r}}const u=d();export function NexradSitesMapLayer({visible:i,onSelectSite:r,belowLayerID:e}){const o=n=>{const t=n?.features,s=Array.isArray(t)&&t.length>0?t[0]:null,a=s?.properties?.id??s?.properties?.name;a&&typeof r=="function"&&r(String(a))};return!i||!u.features.length?null:c.createElement(l.ShapeSource,{id:p,shape:u,onPress:o,hitbox:{width:44,height:44}},c.createElement(l.CircleLayer,{id:y,belowLayerID:e,style:{circleRadius:5,circleColor:"#3b82f6",circleStrokeWidth:1,circleStrokeColor:"#ffffff",circleOpacity:.95}}))}
@@ -1,63 +1 @@
1
- import React, { forwardRef, useImperativeHandle, useRef } from 'react';
2
- import { StyleSheet } from 'react-native';
3
- import SatelliteLayerNative from './SatelliteLayerNativeComponent';
4
- import { dispatchViewManagerCommandCompat } from './dispatchViewManagerCommandCompat';
5
- import { satBridgeWarn } from './satelliteBridgeDiag';
6
-
7
- const NATIVE_COMPONENT_NAME = 'SatelliteLayer';
8
-
9
- function warnFailed(commandName) {
10
- satBridgeWarn(`SatelliteLayer:${commandName}:dispatch-failed`, {});
11
- }
12
-
13
- export const SatelliteLayer = forwardRef((props, ref) => {
14
- const nativeRef = useRef(null);
15
-
16
- useImperativeHandle(ref, () => ({
17
- syncSatellite(json) {
18
- if (typeof json !== 'string') return;
19
- satBridgeWarn('SatelliteLayer.syncSatellite called', { jsonChars: json.length });
20
- const ok = dispatchViewManagerCommandCompat(nativeRef, NATIVE_COMPONENT_NAME, 'syncSatellite', [json]);
21
- if (!ok) warnFailed('syncSatellite');
22
- },
23
- clearSatellite() {
24
- satBridgeWarn('SatelliteLayer.clearSatellite called', {});
25
- const ok = dispatchViewManagerCommandCompat(nativeRef, NATIVE_COMPONENT_NAME, 'clearSatellite', []);
26
- if (!ok) warnFailed('clearSatellite');
27
- },
28
- activateSatelliteCachedUnix(unix) {
29
- if (typeof unix !== 'number') return;
30
- satBridgeWarn('SatelliteLayer.activateSatelliteCachedUnix called', { unix });
31
- const ok = dispatchViewManagerCommandCompat(nativeRef, NATIVE_COMPONENT_NAME, 'activateSatelliteCachedUnix', [
32
- unix,
33
- ]);
34
- if (!ok) warnFailed('activateSatelliteCachedUnix');
35
- },
36
- updateSatelliteStyle(json) {
37
- if (typeof json !== 'string') return;
38
- satBridgeWarn('SatelliteLayer.updateSatelliteStyle called', { jsonChars: json.length });
39
- const ok = dispatchViewManagerCommandCompat(nativeRef, NATIVE_COMPONENT_NAME, 'updateSatelliteStyle', [json]);
40
- if (!ok) warnFailed('updateSatelliteStyle');
41
- },
42
- }));
43
-
44
- return (
45
- <SatelliteLayerNative
46
- ref={nativeRef}
47
- belowID={props.belowID}
48
- style={styles.overlay}
49
- pointerEvents="none"
50
- collapsable={false}
51
- />
52
- );
53
- });
54
-
55
- SatelliteLayer.displayName = 'SatelliteLayer';
56
-
57
- const styles = StyleSheet.create({
58
- overlay: {
59
- ...StyleSheet.absoluteFillObject,
60
- },
61
- });
62
-
63
- export default SatelliteLayer;
1
+ import s,{forwardRef as S,useImperativeHandle as y,useRef as d}from"react";import{StyleSheet as o}from"react-native";import p from"./SatelliteLayerNativeComponent";import{dispatchViewManagerCommandCompat as l}from"./dispatchViewManagerCommandCompat";import{satBridgeWarn as a}from"./satelliteBridgeDiag";const i="SatelliteLayer";function r(n){a(`SatelliteLayer:${n}:dispatch-failed`,{})}export const SatelliteLayer=S((n,c)=>{const t=d(null);return y(c,()=>({syncSatellite(e){typeof e=="string"&&(a("SatelliteLayer.syncSatellite called",{jsonChars:e.length}),l(t,i,"syncSatellite",[e])||r("syncSatellite"))},clearSatellite(){a("SatelliteLayer.clearSatellite called",{}),l(t,i,"clearSatellite",[])||r("clearSatellite")},activateSatelliteCachedUnix(e){typeof e=="number"&&(a("SatelliteLayer.activateSatelliteCachedUnix called",{unix:e}),l(t,i,"activateSatelliteCachedUnix",[e])||r("activateSatelliteCachedUnix"))},updateSatelliteStyle(e){typeof e=="string"&&(a("SatelliteLayer.updateSatelliteStyle called",{jsonChars:e.length}),l(t,i,"updateSatelliteStyle",[e])||r("updateSatelliteStyle"))}})),s.createElement(p,{ref:t,belowID:n.belowID,style:f.overlay,pointerEvents:"none",collapsable:!1})});SatelliteLayer.displayName="SatelliteLayer";const f=o.create({overlay:{...o.absoluteFillObject}});export default SatelliteLayer;
@@ -1,70 +1 @@
1
- import React, { forwardRef, useImperativeHandle, useRef } from 'react';
2
- import { StyleSheet } from 'react-native';
3
- import SatelliteLayerNative from './SatelliteLayerNativeComponent';
4
- import { dispatchViewManagerCommandCompat } from './dispatchViewManagerCommandCompat';
5
- import { satBridgeWarn } from './satelliteBridgeDiag';
6
-
7
- const NATIVE_COMPONENT_NAME = 'SatelliteLayer';
8
-
9
- function warnFailed(commandName) {
10
- satBridgeWarn(`SatelliteLayer:${commandName}:dispatch-failed`, {
11
- hint: 'compat helper returned false — see prior sat-bridge dispatch:* logs',
12
- });
13
- }
14
-
15
- export const SatelliteLayer = forwardRef((props, ref) => {
16
- const nativeRef = useRef(null);
17
-
18
- useImperativeHandle(ref, () => ({
19
- syncSatellite(json) {
20
- if (typeof json !== 'string') return;
21
- satBridgeWarn('SatelliteLayer.syncSatellite called', {
22
- jsonChars: json.length,
23
- nativeRefAttached: Boolean(nativeRef.current),
24
- });
25
- const ok = dispatchViewManagerCommandCompat(nativeRef, NATIVE_COMPONENT_NAME, 'syncSatellite', [json]);
26
- if (!ok) warnFailed('syncSatellite');
27
- },
28
- clearSatellite() {
29
- satBridgeWarn('SatelliteLayer.clearSatellite called', {
30
- nativeRefAttached: Boolean(nativeRef.current),
31
- });
32
- const ok = dispatchViewManagerCommandCompat(nativeRef, NATIVE_COMPONENT_NAME, 'clearSatellite', []);
33
- if (!ok) warnFailed('clearSatellite');
34
- },
35
- activateSatelliteCachedUnix(unix) {
36
- if (typeof unix !== 'number') return;
37
- satBridgeWarn('SatelliteLayer.activateSatelliteCachedUnix called', { unix });
38
- const ok = dispatchViewManagerCommandCompat(nativeRef, NATIVE_COMPONENT_NAME, 'activateSatelliteCachedUnix', [
39
- unix,
40
- ]);
41
- if (!ok) warnFailed('activateSatelliteCachedUnix');
42
- },
43
- updateSatelliteStyle(json) {
44
- if (typeof json !== 'string') return;
45
- satBridgeWarn('SatelliteLayer.updateSatelliteStyle called', { jsonChars: json.length });
46
- const ok = dispatchViewManagerCommandCompat(nativeRef, NATIVE_COMPONENT_NAME, 'updateSatelliteStyle', [json]);
47
- if (!ok) warnFailed('updateSatelliteStyle');
48
- },
49
- }));
50
-
51
- return (
52
- <SatelliteLayerNative
53
- ref={nativeRef}
54
- belowID={props.belowID}
55
- style={styles.overlay}
56
- pointerEvents="none"
57
- collapsable={false}
58
- />
59
- );
60
- });
61
-
62
- SatelliteLayer.displayName = 'SatelliteLayer';
63
-
64
- const styles = StyleSheet.create({
65
- overlay: {
66
- ...StyleSheet.absoluteFillObject,
67
- },
68
- });
69
-
70
- export default SatelliteLayer;
1
+ import s,{forwardRef as S,useImperativeHandle as d,useRef as p}from"react";import{StyleSheet as c}from"react-native";import y from"./SatelliteLayerNativeComponent";import{dispatchViewManagerCommandCompat as l}from"./dispatchViewManagerCommandCompat";import{satBridgeWarn as a}from"./satelliteBridgeDiag";const i="SatelliteLayer";function r(n){a(`SatelliteLayer:${n}:dispatch-failed`,{hint:"compat helper returned false \u2014 see prior sat-bridge dispatch:* logs"})}export const SatelliteLayer=S((n,o)=>{const t=p(null);return d(o,()=>({syncSatellite(e){typeof e=="string"&&(a("SatelliteLayer.syncSatellite called",{jsonChars:e.length,nativeRefAttached:!!t.current}),l(t,i,"syncSatellite",[e])||r("syncSatellite"))},clearSatellite(){a("SatelliteLayer.clearSatellite called",{nativeRefAttached:!!t.current}),l(t,i,"clearSatellite",[])||r("clearSatellite")},activateSatelliteCachedUnix(e){typeof e=="number"&&(a("SatelliteLayer.activateSatelliteCachedUnix called",{unix:e}),l(t,i,"activateSatelliteCachedUnix",[e])||r("activateSatelliteCachedUnix"))},updateSatelliteStyle(e){typeof e=="string"&&(a("SatelliteLayer.updateSatelliteStyle called",{jsonChars:e.length}),l(t,i,"updateSatelliteStyle",[e])||r("updateSatelliteStyle"))}})),s.createElement(y,{ref:t,belowID:n.belowID,style:f.overlay,pointerEvents:"none",collapsable:!1})});SatelliteLayer.displayName="SatelliteLayer";const f=c.create({overlay:{...c.absoluteFillObject}});export default SatelliteLayer;