@aguacerowx/mapsgl 0.0.45 → 0.0.47

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.
@@ -106,20 +106,17 @@ function hasTornadoObservedFromStructuredCap(properties) {
106
106
  function resolveNwsWarningCustomizationKey(baseCanonicalEvent, properties) {
107
107
  if (baseCanonicalEvent === BASE_TORNADO) {
108
108
  const blob = normalizeNwsWarningTagText(nwsAlertTagBlob(properties));
109
+ const torThreat = getNwsDamageThreatFromTags(BASE_TORNADO, properties, blob);
110
+ if (torThreat === "Catastrophic") return "Tornado Warning (Emergency)";
111
+ if (torThreat === "Considerable") return "Tornado Warning (PDS)";
109
112
  if (hasTornadoObservedTag(blob)) return "Tornado Warning (Observed)";
110
113
  const tornadoLine = getNwsTornadoThreatFromTags(properties, blob);
111
114
  if (tornadoLine === "Observed") return "Tornado Warning (Observed)";
112
115
  if (tornadoLine != null && tornadoLine.toLowerCase() !== "observed" && !tornadoLine.toLowerCase().includes("observed")) {
113
- const torThreat2 = getNwsDamageThreatFromTags(BASE_TORNADO, properties, blob);
114
- if (torThreat2 === "Catastrophic") return "Tornado Warning (Emergency)";
115
- if (torThreat2 === "Considerable") return "Tornado Warning (PDS)";
116
116
  return BASE_TORNADO;
117
117
  }
118
118
  if (hasTornadoObservedFromExplicitFeatureProperties(properties)) return "Tornado Warning (Observed)";
119
119
  if (hasTornadoObservedFromStructuredCap(properties)) return "Tornado Warning (Observed)";
120
- const torThreat = getNwsDamageThreatFromTags(BASE_TORNADO, properties, blob);
121
- if (torThreat === "Catastrophic") return "Tornado Warning (Emergency)";
122
- if (torThreat === "Considerable") return "Tornado Warning (PDS)";
123
120
  return BASE_TORNADO;
124
121
  }
125
122
  if (baseCanonicalEvent === BASE_SEVERE) {
@@ -87,6 +87,13 @@ const loadBasisModule = async (basisBaseUrl) => {
87
87
 
88
88
  if (typeof self.BASIS === 'undefined') {
89
89
  const scriptText = await (await fetch(jsUrl)).text();
90
+ const trimmed = scriptText.trimStart();
91
+ if (trimmed.startsWith('<')) {
92
+ throw new Error(
93
+ `Expected JavaScript at ${jsUrl} but got HTML (often a 404 or SPA index). ` +
94
+ 'Copy basis_transcoder.js and basis_transcoder.wasm to your static host, or set WeatherLayerManager basisBaseUrl.',
95
+ );
96
+ }
90
97
  self.eval(scriptText);
91
98
  if (self.Module) {
92
99
  self.Module = undefined;