@aguacerowx/mapsgl 0.0.49 → 0.0.51
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.
- package/package.json +2 -2
- package/src/NexradWeatherController.js +26 -7
- package/src/NwsWatchesWarningsOverlay.js +858 -789
- package/src/WeatherLayerManager.js +61 -298
- package/src/nwsAlertsSupport.js +160 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aguacerowx/mapsgl",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"esbuild": "^0.21.5"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@aguacerowx/javascript-sdk": "^0.0.
|
|
24
|
+
"@aguacerowx/javascript-sdk": "^0.0.22",
|
|
25
25
|
"buffer": "^6.0.3",
|
|
26
26
|
"fzstd": "^0.1.1",
|
|
27
27
|
"mapbox-gl": "^3.4.0",
|
|
@@ -153,7 +153,8 @@ export class NexradWeatherController {
|
|
|
153
153
|
this.core = core;
|
|
154
154
|
this.layerId = options.nexradLayerId || 'aguacero-nexrad-layer';
|
|
155
155
|
this.mapboxLayer = null;
|
|
156
|
-
|
|
156
|
+
/** Includes tilt/timestamp so elevation changes always re-upload (see {@link _syncIdentity}). */
|
|
157
|
+
this._lastSyncKey = null;
|
|
157
158
|
this._abort = null;
|
|
158
159
|
this._interpolateColormap = options.interpolateNexradColormap !== false;
|
|
159
160
|
this._gateSmoothing = options.nexradGateSmoothing === true;
|
|
@@ -176,7 +177,7 @@ export class NexradWeatherController {
|
|
|
176
177
|
this.map.removeLayer(this.mapboxLayer.id);
|
|
177
178
|
}
|
|
178
179
|
this.mapboxLayer = null;
|
|
179
|
-
this.
|
|
180
|
+
this._lastSyncKey = null;
|
|
180
181
|
}
|
|
181
182
|
|
|
182
183
|
_resolveListingContext(state) {
|
|
@@ -227,7 +228,25 @@ export class NexradWeatherController {
|
|
|
227
228
|
.filter((t) => Number.isFinite(t))
|
|
228
229
|
.sort((a, b) => a - b)
|
|
229
230
|
.join(',');
|
|
230
|
-
|
|
231
|
+
const tilt =
|
|
232
|
+
state.nexradTilt != null && Number.isFinite(Number(state.nexradTilt))
|
|
233
|
+
? Number(state.nexradTilt).toFixed(3)
|
|
234
|
+
: '';
|
|
235
|
+
return `${nk}|${ts}|sr:${state.nexradStormRelative ? 1 : 0}|tilt:${tilt}`;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Identity for whether the visible radar frame + upload options match (tilt affects L3 mesh keys and listing object paths).
|
|
240
|
+
* @param {object} state
|
|
241
|
+
* @param {{ fetchKey: string }} p
|
|
242
|
+
* @param {number} unix
|
|
243
|
+
*/
|
|
244
|
+
_syncIdentity(state, p, unix) {
|
|
245
|
+
const tilt =
|
|
246
|
+
state.nexradTilt != null && Number.isFinite(Number(state.nexradTilt))
|
|
247
|
+
? Number(state.nexradTilt).toFixed(3)
|
|
248
|
+
: '';
|
|
249
|
+
return `${p.fetchKey}|tilt:${tilt}|u:${unix}`;
|
|
231
250
|
}
|
|
232
251
|
|
|
233
252
|
/**
|
|
@@ -341,7 +360,8 @@ export class NexradWeatherController {
|
|
|
341
360
|
return;
|
|
342
361
|
}
|
|
343
362
|
|
|
344
|
-
|
|
363
|
+
const syncKey = this._syncIdentity(state, p, unix);
|
|
364
|
+
if (syncKey === this._lastSyncKey && this.mapboxLayer) {
|
|
345
365
|
this._applyStyle(state);
|
|
346
366
|
return;
|
|
347
367
|
}
|
|
@@ -350,12 +370,10 @@ export class NexradWeatherController {
|
|
|
350
370
|
if (cached) {
|
|
351
371
|
this._ensureLayer();
|
|
352
372
|
this._uploadFrame(state, cached);
|
|
353
|
-
this.
|
|
373
|
+
this._lastSyncKey = syncKey;
|
|
354
374
|
return;
|
|
355
375
|
}
|
|
356
376
|
|
|
357
|
-
this._lastFetchKey = p.fetchKey;
|
|
358
|
-
|
|
359
377
|
this._abort?.abort();
|
|
360
378
|
this._abort = new AbortController();
|
|
361
379
|
|
|
@@ -375,6 +393,7 @@ export class NexradWeatherController {
|
|
|
375
393
|
|
|
376
394
|
this._ensureLayer();
|
|
377
395
|
this._uploadFrame(state, frame);
|
|
396
|
+
this._lastSyncKey = syncKey;
|
|
378
397
|
}
|
|
379
398
|
|
|
380
399
|
_applyStyle(state) {
|