@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
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = NwsAlertsOverlay;
6
+ exports.default = le;
7
7
  exports.resolveNwsAndroidLayerAnchors = resolveNwsAndroidLayerAnchors;
8
8
  require("./eventSourceRnPolyfill.js");
9
9
  var _react = _interopRequireWildcard(require("react"));
@@ -16,160 +16,92 @@ var _MapRegistry = require("../MapRegistry");
16
16
  var _nwsAndroidConstants = require("./nwsAndroidConstants.js");
17
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
- /**
20
- * NWS watches/warnings for React Native (iOS + Android) — parity with {@link NwsWatchesWarningsOverlay}
21
- * (archived / slider time via {@link NwsWatchesWarningsOverlay#syncWithMode}, same customization options).
22
- *
23
- * Uses the javascript-sdk NWS overlay engine with a stub Mapbox GL object; GeoJSON + layers render via @rnmapbox/maps.
24
- */
25
-
26
- /** Subpath imports avoid Metro/barrel init ordering where the package root can yield undefined named exports during RN startup. */
27
-
28
- const SOURCE_ID = 'aguacero-nws-alerts-source';
29
- const FILL_ID = 'aguacero-nws-alerts-fill';
30
- const LINE_CASING_ID = 'aguacero-nws-alerts-line-casing';
31
- const LINE_CORE_ID = 'aguacero-nws-alerts-line-core';
32
- class AndroidNwsOverlay extends _NwsWatchesWarningsOverlay.NwsWatchesWarningsOverlay {
33
- /**
34
- * @param {object} map
35
- * @param {object} options
36
- * @param {(paint: object) => void} onPaint
37
- */
38
- constructor(map, options, onPaint) {
39
- super(map, options);
40
- this._onPaint = onPaint;
19
+ const O = "aguacero-nws-alerts-source",
20
+ m = "aguacero-nws-alerts-fill",
21
+ h = "aguacero-nws-alerts-line-casing",
22
+ L = "aguacero-nws-alerts-line-core";
23
+ class ae extends _NwsWatchesWarningsOverlay.NwsWatchesWarningsOverlay {
24
+ constructor(t, a, n) {
25
+ super(t, a), this._onPaint = n;
41
26
  }
42
-
43
- /**
44
- * @rnmapbox/maps does not support data-driven `line-dasharray` (match on `event_name`).
45
- * Keep web parity for colors; dash style follows {@link NwsWatchesWarningsOverlay} default `lineDash` only on RN.
46
- */
47
27
  _buildPaint() {
48
- const p = super._buildPaint();
49
- const mode = this._nwsAlertSettings?.lineDash ?? 'solid';
28
+ const t = super._buildPaint(),
29
+ a = this._nwsAlertSettings?.lineDash ?? "solid";
50
30
  return {
51
- ...p,
52
- lineDashExpr: (0, _nwsSdkConstants.buildNwsLineDasharrayLiteralExpression)(mode),
53
- fillOpacityExpr: Array.isArray(p.fillOpacityExpr) && p.fillOpacityExpr.length > 2 ? p.fillOpacityExpr[2] : p.fillOpacityExpr,
54
- lineOpacityExpr: Array.isArray(p.lineOpacityExpr) && p.lineOpacityExpr.length > 2 ? p.lineOpacityExpr[2] : p.lineOpacityExpr
31
+ ...t,
32
+ lineDashExpr: (0, _nwsSdkConstants.buildNwsLineDasharrayLiteralExpression)(a),
33
+ fillOpacityExpr: Array.isArray(t.fillOpacityExpr) && t.fillOpacityExpr.length > 2 ? t.fillOpacityExpr[2] : t.fillOpacityExpr,
34
+ lineOpacityExpr: Array.isArray(t.lineOpacityExpr) && t.lineOpacityExpr.length > 2 ? t.lineOpacityExpr[2] : t.lineOpacityExpr
55
35
  };
56
36
  }
57
-
58
- /**
59
- * RN renders ShapeSource + layers declaratively (same ids). Only sync GeoJSON + paint; skip imperative addLayer.
60
- */
61
37
  _ensureLayers() {
62
- const m = this.map;
63
- if (!m?.addSource) return;
64
- const paint = this._buildPaint();
65
- if (this._onPaint) this._onPaint(paint);
66
- const sourceData = (0, _nwsAlertsSupport.normalizeFeatureCollectionForMapboxGl)(this._workingFc);
67
- if (!m.getSource(this._sourceId)) {
68
- m.addSource(this._sourceId, {
69
- type: 'geojson',
70
- data: sourceData
71
- });
72
- } else {
73
- m.getSource(this._sourceId).setData(sourceData);
74
- }
38
+ const t = this.map;
39
+ if (!t?.addSource) return;
40
+ const a = this._buildPaint();
41
+ this._onPaint && this._onPaint(a);
42
+ const n = (0, _nwsAlertsSupport.normalizeFeatureCollectionForMapboxGl)(this._workingFc);
43
+ t.getSource(this._sourceId) ? t.getSource(this._sourceId).setData(n) : t.addSource(this._sourceId, {
44
+ type: "geojson",
45
+ data: n
46
+ });
75
47
  }
76
48
  _refreshPaint() {
77
- if (this._onPaint) this._onPaint(this._buildPaint());
49
+ this._onPaint && this._onPaint(this._buildPaint());
78
50
  }
79
51
  _applyLayerOrder() {}
80
52
  _syncClickHandler() {}
81
53
  }
82
-
83
- /**
84
- * @param {object} handlers
85
- * @param {() => import('@rnmapbox/maps').default | null} handlers.getMapboxMapView
86
- * @param {(shape: object) => void} handlers.onShape
87
- * @param {() => void} [handlers.onLayersCleared]
88
- */
89
- function createFeatureStateBatcher(handlers) {
90
- /** @type {Map<string, object>} */
91
- const pendingStates = new Map();
92
- let rafId = null;
93
- function flush() {
94
- rafId = null;
95
- if (handlers.onFeatureStates) {
96
- const activeIds = [];
97
- for (const [fid, state] of pendingStates) {
98
- if (state && state.active !== false) {
99
- activeIds.push(fid);
100
- }
101
- }
102
- handlers.onFeatureStates(activeIds);
54
+ function ne(l) {
55
+ const t = new Map();
56
+ let a = null;
57
+ function n() {
58
+ if (a = null, l.onFeatureStates) {
59
+ const i = [];
60
+ for (const [s, p] of t) p && p.active !== !1 && i.push(s);
61
+ l.onFeatureStates(i);
103
62
  }
104
63
  }
105
64
  return {
106
- push(fid, state, sid) {
107
- pendingStates.set(fid, state);
108
- if (rafId == null) {
109
- rafId = requestAnimationFrame(flush);
110
- }
65
+ push(i, s, p) {
66
+ t.set(i, s), a == null && (a = requestAnimationFrame(n));
111
67
  },
112
68
  clear() {
113
- pendingStates.clear();
114
- if (rafId != null) {
115
- cancelAnimationFrame(rafId);
116
- rafId = null;
117
- }
118
- if (handlers.onFeatureStates) {
119
- handlers.onFeatureStates(null);
120
- }
69
+ t.clear(), a != null && (cancelAnimationFrame(a), a = null), l.onFeatureStates && l.onFeatureStates(null);
121
70
  }
122
71
  };
123
72
  }
124
- function createAndroidNwsStubMap(handlers) {
125
- let sourceAdded = false;
126
- /** Declarative RN layers use the same ids — treat as present after first {@link AndroidNwsOverlay#_ensureLayers}. */
127
- let declarativeLayersReady = false;
128
- const featureStateBatcher = createFeatureStateBatcher(handlers);
73
+ function ie(l) {
74
+ let t = !1,
75
+ a = !1;
76
+ const n = ne(l);
129
77
  return {
130
- isStyleLoaded: () => true,
131
- once(ev, fn) {
132
- if (ev === 'style.load') {
133
- queueMicrotask(() => fn({
134
- target: {}
135
- }));
136
- }
78
+ isStyleLoaded: () => !0,
79
+ once(i, s) {
80
+ i === "style.load" && queueMicrotask(() => s({
81
+ target: {}
82
+ }));
137
83
  },
138
84
  __markDeclarativeLayersReady() {
139
- declarativeLayersReady = true;
85
+ a = !0;
140
86
  },
141
- addSource(id, spec) {
142
- if (id === SOURCE_ID) {
143
- sourceAdded = true;
144
- if (spec?.data) handlers.onShape(spec.data);
145
- }
87
+ addSource(i, s) {
88
+ i === O && (t = !0, s?.data && l.onShape(s.data));
146
89
  },
147
- getSource(id) {
148
- if (!sourceAdded || id !== SOURCE_ID) return null;
149
- return {
150
- setData: geojson => handlers.onShape(geojson)
90
+ getSource(i) {
91
+ return !t || i !== O ? null : {
92
+ setData: s => l.onShape(s)
151
93
  };
152
94
  },
153
95
  addLayer() {},
154
- removeLayer(id) {
155
- if ([FILL_ID, LINE_CASING_ID, LINE_CORE_ID].includes(id)) {
156
- declarativeLayersReady = false;
157
- featureStateBatcher.clear();
158
- handlers.onLayersCleared?.();
159
- }
96
+ removeLayer(i) {
97
+ [m, h, L].includes(i) && (a = !1, n.clear(), l.onLayersCleared?.());
160
98
  },
161
- removeSource(id) {
162
- if (id === SOURCE_ID) {
163
- sourceAdded = false;
164
- declarativeLayersReady = false;
165
- featureStateBatcher.clear();
166
- handlers.onLayersCleared?.();
167
- }
99
+ removeSource(i) {
100
+ i === O && (t = !1, a = !1, n.clear(), l.onLayersCleared?.());
168
101
  },
169
- getLayer(id) {
170
- if (!declarativeLayersReady) return null;
171
- return [FILL_ID, LINE_CASING_ID, LINE_CORE_ID].includes(id) ? {
172
- id
102
+ getLayer(i) {
103
+ return a && [m, h, L].includes(i) ? {
104
+ id: i
173
105
  } : null;
174
106
  },
175
107
  getStyle() {
@@ -182,261 +114,203 @@ function createAndroidNwsStubMap(handlers) {
182
114
  on() {},
183
115
  off() {},
184
116
  fire() {},
185
- setFeatureState(target, state) {
186
- const sid = target?.source;
187
- const fid = target?.id;
188
- if (sid !== SOURCE_ID || fid == null) return;
189
- try {
190
- featureStateBatcher.push(fid, state, sid);
191
- } catch {
192
- /* ignore */
193
- }
117
+ setFeatureState(i, s) {
118
+ const p = i?.source,
119
+ f = i?.id;
120
+ if (!(p !== O || f == null)) try {
121
+ n.push(f, s, p);
122
+ } catch {}
194
123
  }
195
124
  };
196
125
  }
197
-
198
- /**
199
- * @param {object} state - {@link AguaceroCore} state
200
- * @param {object} wopt - watches/warnings options (same shape as mapsgl {@link WeatherLayerManager#configureWatchesWarnings})
201
- * @returns {{ weatherLayerId: string | null, fillBelowId: string | null, lineBelowId: string }}
202
- */
203
- function resolveNwsAndroidLayerAnchors(state, wopt) {
204
- const manualFill = Object.prototype.hasOwnProperty.call(wopt, 'fillBeforeLayerId') ? wopt.fillBeforeLayerId ?? null : null;
205
- let weatherLayerId = null;
206
- if (state?.isNexrad) {
207
- weatherLayerId = _nwsAndroidConstants.AGUACERO_NEXRAD_MAP_LAYER_ID;
208
- } else if (state?.isSatellite) {
209
- weatherLayerId = _nwsAndroidConstants.AGUACERO_SATELLITE_MAP_LAYER_ID;
210
- } else if (state?.isMRMS && state?.variable) {
211
- weatherLayerId = 'aguacero-weather-grid-custom';
212
- }
213
- const fillBelowId = manualFill != null && String(manualFill) !== '' ? String(manualFill) : weatherLayerId || _NwsWatchesWarningsOverlay.NWS_DEFAULT_LINE_BEFORE_LAYER_ID;
214
- const lineBelowId = wopt.lineBeforeLayerId || _NwsWatchesWarningsOverlay.NWS_DEFAULT_LINE_BEFORE_LAYER_ID;
126
+ function resolveNwsAndroidLayerAnchors(l, t) {
127
+ const a = Object.prototype.hasOwnProperty.call(t, "fillBeforeLayerId") ? t.fillBeforeLayerId ?? null : null;
128
+ let n = null;
129
+ l?.isNexrad ? n = _nwsAndroidConstants.AGUACERO_NEXRAD_MAP_LAYER_ID : l?.isSatellite ? n = _nwsAndroidConstants.AGUACERO_SATELLITE_MAP_LAYER_ID : l?.isMRMS && l?.variable && (n = "aguacero-weather-grid-custom");
130
+ const i = a != null && String(a) !== "" ? String(a) : n || _NwsWatchesWarningsOverlay.NWS_DEFAULT_LINE_BEFORE_LAYER_ID,
131
+ s = t.lineBeforeLayerId || _NwsWatchesWarningsOverlay.NWS_DEFAULT_LINE_BEFORE_LAYER_ID;
215
132
  return {
216
- weatherLayerId,
217
- fillBelowId,
218
- lineBelowId
133
+ weatherLayerId: n,
134
+ fillBelowId: i,
135
+ lineBelowId: s
219
136
  };
220
137
  }
221
-
222
- /**
223
- * @param {object} props
224
- * @param {import('@aguacerowx/javascript-sdk').AguaceroCore} props.core
225
- * @param {object} props.watchesWarnings - merged options ({ enabled, alertsBaseUrl, nwsAlertSettings, ... })
226
- * @param {(payload: object) => void} [props.onNwsAlertClick]
227
- */
228
- function NwsAlertsOverlay({
229
- core,
230
- watchesWarnings,
231
- onNwsAlertClick
138
+ function le({
139
+ core: l,
140
+ watchesWarnings: t,
141
+ onNwsAlertClick: a
232
142
  }) {
233
- const [aguaceroState, setAguaceroState] = (0, _react.useState)(() => core?.state);
143
+ const [n, i] = (0, _react.useState)(() => l?.state);
234
144
  (0, _react.useEffect)(() => {
235
- if (!core) return undefined;
236
- const h = s => setAguaceroState(s);
237
- core.on('state:change', h);
238
- return () => core.off('state:change', h);
239
- }, [core]);
240
- const [shape, setShape] = (0, _react.useState)({
241
- type: 'FeatureCollection',
242
- features: []
243
- });
244
- const [paint, setPaint] = (0, _react.useState)(null);
245
- const [activeIds, setActiveIds] = (0, _react.useState)(null);
246
- const overlayRef = (0, _react.useRef)(null);
247
- const stubRef = (0, _react.useRef)(null);
248
- const watchesRef = (0, _react.useRef)(watchesWarnings);
249
- const optsKeyRef = (0, _react.useRef)('');
250
- watchesRef.current = watchesWarnings;
251
- const getMapboxMapView = (0, _react.useCallback)(() => _MapRegistry.mapRegistry.getMap(), []);
252
- const anchors = (0, _react.useMemo)(() => resolveNwsAndroidLayerAnchors(aguaceroState, watchesWarnings || {}), [aguaceroState, watchesWarnings]);
253
- (0, _react.useEffect)(() => {
254
- const onPaint = p => setPaint(p);
255
- const stub = createAndroidNwsStubMap({
256
- getMapboxMapView,
257
- onShape: g => setShape(g),
258
- onFeatureStates: ids => setActiveIds(ids),
259
- onLayersCleared: () => {
260
- setPaint(null);
261
- setActiveIds(null);
262
- }
263
- });
264
- stubRef.current = stub;
265
- const w0 = watchesRef.current || {};
266
- const overlay = new AndroidNwsOverlay(stub, w0, onPaint);
267
- overlayRef.current = overlay;
268
- return () => {
269
- overlay.destroy();
270
- overlayRef.current = null;
271
- stubRef.current = null;
272
- };
273
- }, [getMapboxMapView]);
274
- (0, _react.useEffect)(() => {
275
- const ov = overlayRef.current;
276
- if (!ov) return;
277
- const wopt = watchesWarnings || {};
278
- const nwsAlertSettingsForOpts = {
279
- ...(wopt.nwsAlertSettings ?? {}),
280
- ...(wopt.activeOnlyRealtime !== undefined ? {
281
- activeOnlyRealtime: wopt.activeOnlyRealtime
282
- } : {})
145
+ if (!l) return;
146
+ const o = e => i(e);
147
+ return l.on("state:change", o), () => l.off("state:change", o);
148
+ }, [l]);
149
+ const [s, p] = (0, _react.useState)({
150
+ type: "FeatureCollection",
151
+ features: []
152
+ }),
153
+ [f, R] = (0, _react.useState)(null),
154
+ [D, C] = (0, _react.useState)(null),
155
+ _ = (0, _react.useRef)(null),
156
+ F = (0, _react.useRef)(null),
157
+ B = (0, _react.useRef)(t),
158
+ T = (0, _react.useRef)("");
159
+ B.current = t;
160
+ const N = (0, _react.useCallback)(() => _MapRegistry.mapRegistry.getMap(), []),
161
+ w = (0, _react.useMemo)(() => resolveNwsAndroidLayerAnchors(n, t || {}), [n, t]);
162
+ if ((0, _react.useEffect)(() => {
163
+ const o = r => R(r),
164
+ e = ie({
165
+ getMapboxMapView: N,
166
+ onShape: r => p(r),
167
+ onFeatureStates: r => C(r),
168
+ onLayersCleared: () => {
169
+ R(null), C(null);
170
+ }
171
+ });
172
+ F.current = e;
173
+ const u = B.current || {},
174
+ c = new ae(e, u, o);
175
+ return _.current = c, () => {
176
+ c.destroy(), _.current = null, F.current = null;
283
177
  };
284
- const weatherLayerId = anchors.weatherLayerId;
285
- const fillBeforeLayerId = Object.prototype.hasOwnProperty.call(wopt, 'fillBeforeLayerId') ? wopt.fillBeforeLayerId ?? null : null;
286
- const nwsOptsKey = JSON.stringify({
287
- weatherLayerId,
288
- fillBeforeLayerId,
289
- lineBeforeLayerId: wopt.lineBeforeLayerId,
290
- alertsBaseUrl: wopt.alertsBaseUrl,
291
- alertInteractionEnabled: wopt.alertInteractionEnabled,
292
- deltaDebounceMs: wopt.deltaDebounceMs,
293
- fillOpacity: wopt.fillOpacity,
294
- lineOpacity: wopt.lineOpacity,
295
- lineWidth: wopt.lineWidth,
296
- nwsAlertSettings: nwsAlertSettingsForOpts
297
- });
298
- if (optsKeyRef.current !== nwsOptsKey) {
299
- optsKeyRef.current = nwsOptsKey;
300
- ov.updateOptions({
301
- alertsBaseUrl: wopt.alertsBaseUrl,
302
- alertInteractionEnabled: wopt.alertInteractionEnabled,
303
- deltaDebounceMs: wopt.deltaDebounceMs,
304
- fillOpacity: wopt.fillOpacity,
305
- lineOpacity: wopt.lineOpacity,
306
- lineWidth: wopt.lineWidth,
307
- weatherLayerId,
308
- fillBeforeLayerId,
309
- lineBeforeLayerId: wopt.lineBeforeLayerId,
310
- nwsAlertSettings: nwsAlertSettingsForOpts
178
+ }, [N]), (0, _react.useEffect)(() => {
179
+ const o = _.current;
180
+ if (!o) return;
181
+ const e = t || {},
182
+ u = {
183
+ ...(e.nwsAlertSettings ?? {}),
184
+ ...(e.activeOnlyRealtime !== void 0 ? {
185
+ activeOnlyRealtime: e.activeOnlyRealtime
186
+ } : {})
187
+ },
188
+ c = w.weatherLayerId,
189
+ r = Object.prototype.hasOwnProperty.call(e, "fillBeforeLayerId") ? e.fillBeforeLayerId ?? null : null,
190
+ y = JSON.stringify({
191
+ weatherLayerId: c,
192
+ fillBeforeLayerId: r,
193
+ lineBeforeLayerId: e.lineBeforeLayerId,
194
+ alertsBaseUrl: e.alertsBaseUrl,
195
+ alertInteractionEnabled: e.alertInteractionEnabled,
196
+ deltaDebounceMs: e.deltaDebounceMs,
197
+ fillOpacity: e.fillOpacity,
198
+ lineOpacity: e.lineOpacity,
199
+ lineWidth: e.lineWidth,
200
+ nwsAlertSettings: u
311
201
  });
312
- }
313
- }, [watchesWarnings, anchors.weatherLayerId]);
314
- (0, _react.useEffect)(() => {
315
- const ov = overlayRef.current;
316
- if (!ov || !aguaceroState) return;
317
- const wopt = watchesWarnings || {};
318
- const masterEnabled = wopt.enabled === true;
319
- const enabled = masterEnabled;
320
- let timelineUnix = null;
321
- let timelineTimes = null;
322
- const st = aguaceroState;
323
- if (st.isSatellite) {
324
- timelineUnix = st.satelliteTimestamp == null ? null : Number(st.satelliteTimestamp);
325
- timelineTimes = st.availableSatelliteTimestamps;
326
- } else if (st.isNexrad) {
327
- timelineUnix = st.nexradTimestamp == null ? null : Number(st.nexradTimestamp);
328
- timelineTimes = st.availableNexradTimestamps;
329
- } else if (st.isMRMS) {
330
- timelineUnix = st.mrmsTimestamp == null ? null : Number(st.mrmsTimestamp);
331
- timelineTimes = st.availableTimestamps;
332
- }
333
- const hasObservationTimeline = !!(st.isSatellite || st.isNexrad || st.isMRMS);
334
- const alertsFetchHours = (0, _nwsAlertsFetchSpec.computeNwsAlertsFetchHoursFromAguaceroState)(st);
335
- ov.syncWithMode({
336
- enabled,
337
- timelineUnix,
338
- timelineTimes,
339
- hasObservationTimeline,
340
- alertsFetchHours
202
+ T.current !== y && (T.current = y, o.updateOptions({
203
+ alertsBaseUrl: e.alertsBaseUrl,
204
+ alertInteractionEnabled: e.alertInteractionEnabled,
205
+ deltaDebounceMs: e.deltaDebounceMs,
206
+ fillOpacity: e.fillOpacity,
207
+ lineOpacity: e.lineOpacity,
208
+ lineWidth: e.lineWidth,
209
+ weatherLayerId: c,
210
+ fillBeforeLayerId: r,
211
+ lineBeforeLayerId: e.lineBeforeLayerId,
212
+ nwsAlertSettings: u
213
+ }));
214
+ }, [t, w.weatherLayerId]), (0, _react.useEffect)(() => {
215
+ const o = _.current;
216
+ if (!o || !n) return;
217
+ const e = (t || {}).enabled === !0;
218
+ let u = null,
219
+ c = null;
220
+ const r = n;
221
+ r.isSatellite ? (u = r.satelliteTimestamp == null ? null : Number(r.satelliteTimestamp), c = r.availableSatelliteTimestamps) : r.isNexrad ? (u = r.nexradTimestamp == null ? null : Number(r.nexradTimestamp), c = r.availableNexradTimestamps) : r.isMRMS && (u = r.mrmsTimestamp == null ? null : Number(r.mrmsTimestamp), c = r.availableTimestamps);
222
+ const y = !!(r.isSatellite || r.isNexrad || r.isMRMS),
223
+ E = (0, _nwsAlertsFetchSpec.computeNwsAlertsFetchHoursFromAguaceroState)(r);
224
+ o.syncWithMode({
225
+ enabled: e,
226
+ timelineUnix: u,
227
+ timelineTimes: c,
228
+ hasObservationTimeline: y,
229
+ alertsFetchHours: E
341
230
  });
342
- }, [aguaceroState, watchesWarnings]);
343
- (0, _react.useLayoutEffect)(() => {
344
- const stub = stubRef.current;
345
- const ov = overlayRef.current;
346
- if (!stub || !ov || !paint) return;
347
- stub.__markDeclarativeLayersReady();
348
- try {
349
- ov._applyTimeFilters();
350
- } catch {
351
- /* ignore */
231
+ }, [n, t]), (0, _react.useLayoutEffect)(() => {
232
+ const o = F.current,
233
+ e = _.current;
234
+ if (!(!o || !e || !f)) {
235
+ o.__markDeclarativeLayersReady();
236
+ try {
237
+ e._applyTimeFilters();
238
+ } catch {}
352
239
  }
353
- }, [paint, shape, aguaceroState?.nexradTimestamp, aguaceroState?.mrmsTimestamp, aguaceroState?.satelliteTimestamp]);
354
- (0, _react.useEffect)(() => {
355
- if (!onNwsAlertClick) return undefined;
356
- const handler = async payload => {
357
- const wopt = watchesRef.current || {};
358
- if (!wopt.enabled || wopt.alertInteractionEnabled === false) return;
359
- const mapView = _MapRegistry.mapRegistry.getMap();
360
- if (!mapView?.queryRenderedFeaturesAtPoint) return;
361
- let screenPoint = null;
362
- if (payload?.properties?.screenPointX != null && payload?.properties?.screenPointY != null) {
363
- screenPoint = [payload.properties.screenPointX, payload.properties.screenPointY];
364
- } else if (payload?.point != null && Array.isArray(payload.point)) {
365
- screenPoint = payload.point;
366
- }
367
- if (!screenPoint) return;
368
- let feats = await mapView.queryRenderedFeaturesAtPoint(screenPoint, undefined, [FILL_ID, LINE_CASING_ID, LINE_CORE_ID]);
369
- if (!feats?.length && payload?.coordinates) {
370
- const coord = payload.coordinates;
371
- const pt = await mapView.getPointInView(coord);
372
- if (pt) feats = await mapView.queryRenderedFeaturesAtPoint(pt, undefined, [FILL_ID, LINE_CASING_ID, LINE_CORE_ID]);
240
+ }, [f, s, n?.nexradTimestamp, n?.mrmsTimestamp, n?.satelliteTimestamp]), (0, _react.useEffect)(() => {
241
+ if (!a) return;
242
+ const o = async e => {
243
+ const u = B.current || {};
244
+ if (!u.enabled || u.alertInteractionEnabled === !1) return;
245
+ const c = _MapRegistry.mapRegistry.getMap();
246
+ if (!c?.queryRenderedFeaturesAtPoint) return;
247
+ let r = null;
248
+ if (e?.properties?.screenPointX != null && e?.properties?.screenPointY != null ? r = [e.properties.screenPointX, e.properties.screenPointY] : e?.point != null && Array.isArray(e.point) && (r = e.point), !r) return;
249
+ let y = await c.queryRenderedFeaturesAtPoint(r, void 0, [m, h, L]);
250
+ if (!y?.length && e?.coordinates) {
251
+ const S = e.coordinates,
252
+ q = await c.getPointInView(S);
253
+ q && (y = await c.queryRenderedFeaturesAtPoint(q, void 0, [m, h, L]));
373
254
  }
374
- const hit = feats?.find(f => [FILL_ID, LINE_CASING_ID, LINE_CORE_ID].includes(f?.layer?.id));
375
- if (!hit?.properties) return;
376
- try {
377
- const built = (0, _nwsAlertsSupport.buildAlertClickPayload)(hit);
378
- onNwsAlertClick({
379
- ...built,
380
- feature: hit
255
+ const E = y?.find(S => [m, h, L].includes(S?.layer?.id));
256
+ if (E?.properties) try {
257
+ const S = (0, _nwsAlertsSupport.buildAlertClickPayload)(E);
258
+ a({
259
+ ...S,
260
+ feature: E
381
261
  });
382
- } catch {
383
- /* ignore */
384
- }
262
+ } catch {}
385
263
  };
386
- _MapRegistry.mapRegistry.addPressListener(handler);
387
- return () => _MapRegistry.mapRegistry.removePressListener(handler);
388
- }, [onNwsAlertClick]);
389
- if (!paint) {
390
- return null;
391
- }
392
- const p = paint;
393
- const lineLayout = p.lineLayout ?? {};
394
- const lineCap = lineLayout['line-cap'] ?? 'round';
395
- const lineJoin = lineLayout['line-join'] ?? 'round';
396
- const lineSortKey = lineLayout['line-sort-key'] ?? ['coalesce', ['get', '_nws_render_priority'], 0];
397
- const fillSortKey = ['coalesce', ['get', '_nws_render_priority'], 0];
398
- const fillStyle = {
399
- fillColor: p.fillColorExpr,
400
- fillOpacity: p.fillOpacityExpr,
401
- fillSortKey
402
- };
403
- const casingStyle = {
404
- lineColor: p.dualLine.casingColor,
405
- lineWidth: p.dualLine.casingWidth,
406
- lineOpacity: p.lineOpacityExpr,
407
- lineDasharray: p.lineDashExpr,
408
- lineCap,
409
- lineJoin,
410
- lineSortKey
411
- };
412
- const coreStyle = {
413
- lineColor: p.dualLine.coreColor,
414
- lineWidth: p.dualLine.coreWidth,
415
- lineOpacity: p.lineOpacityExpr,
416
- lineDasharray: p.lineDashExpr,
417
- lineCap,
418
- lineJoin,
419
- lineSortKey
420
- };
421
- const activeFilter = activeIds ? activeIds.length > 0 ? ['in', ['id'], ['literal', activeIds]] : ['==', ['id'], -1] : ['==', ['id'], -1];
264
+ return _MapRegistry.mapRegistry.addPressListener(o), () => _MapRegistry.mapRegistry.removePressListener(o);
265
+ }, [a]), !f) return null;
266
+ const d = f,
267
+ M = d.lineLayout ?? {},
268
+ W = M["line-cap"] ?? "round",
269
+ k = M["line-join"] ?? "round",
270
+ U = M["line-sort-key"] ?? ["coalesce", ["get", "_nws_render_priority"], 0],
271
+ j = ["coalesce", ["get", "_nws_render_priority"], 0],
272
+ G = {
273
+ fillColor: d.fillColorExpr,
274
+ fillOpacity: d.fillOpacityExpr,
275
+ fillSortKey: j
276
+ },
277
+ H = {
278
+ lineColor: d.dualLine.casingColor,
279
+ lineWidth: d.dualLine.casingWidth,
280
+ lineOpacity: d.lineOpacityExpr,
281
+ lineDasharray: d.lineDashExpr,
282
+ lineCap: W,
283
+ lineJoin: k,
284
+ lineSortKey: U
285
+ },
286
+ J = {
287
+ lineColor: d.dualLine.coreColor,
288
+ lineWidth: d.dualLine.coreWidth,
289
+ lineOpacity: d.lineOpacityExpr,
290
+ lineDasharray: d.lineDashExpr,
291
+ lineCap: W,
292
+ lineJoin: k,
293
+ lineSortKey: U
294
+ },
295
+ v = D ? D.length > 0 ? ["in", ["id"], ["literal", D]] : ["==", ["id"], -1] : ["==", ["id"], -1];
422
296
  return /*#__PURE__*/_react.default.createElement(_maps.default.ShapeSource, {
423
- id: SOURCE_ID,
424
- shape: shape
297
+ id: O,
298
+ shape: s
425
299
  }, /*#__PURE__*/_react.default.createElement(_maps.default.FillLayer, {
426
- id: FILL_ID,
427
- belowLayerID: anchors.fillBelowId,
428
- style: fillStyle,
429
- filter: activeFilter
300
+ id: m,
301
+ belowLayerID: w.fillBelowId,
302
+ style: G,
303
+ filter: v
430
304
  }), /*#__PURE__*/_react.default.createElement(_maps.default.LineLayer, {
431
- id: LINE_CASING_ID,
432
- belowLayerID: anchors.lineBelowId,
433
- style: casingStyle,
434
- filter: activeFilter
305
+ id: h,
306
+ belowLayerID: w.lineBelowId,
307
+ style: H,
308
+ filter: v
435
309
  }), /*#__PURE__*/_react.default.createElement(_maps.default.LineLayer, {
436
- id: LINE_CORE_ID,
437
- belowLayerID: anchors.lineBelowId,
438
- style: coreStyle,
439
- filter: activeFilter
310
+ id: L,
311
+ belowLayerID: w.lineBelowId,
312
+ style: J,
313
+ filter: v
440
314
  }));
441
315
  }
442
316
  //# sourceMappingURL=NwsAlertsOverlay.native.js.map