@aguacerowx/mapsgl 0.0.57 → 0.0.59
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 +31 -31
- package/src/NexradWeatherController.js +523 -520
- package/src/nexrad/radarArchiveCore.bundled.js +14 -2
- package/src/nexrad/radarArchiveCore.ts +1987 -1974
|
@@ -5611,16 +5611,22 @@ function isAbortError(err2) {
|
|
|
5611
5611
|
}
|
|
5612
5612
|
var NEXRAD_ARCHIVE_API_KEY = "";
|
|
5613
5613
|
var NEXRAD_ARCHIVE_BUNDLE_ID = "";
|
|
5614
|
+
var NEXRAD_ARCHIVE_SITE_ORIGIN = "";
|
|
5614
5615
|
function setNexradArchiveApiKey(k) {
|
|
5615
5616
|
NEXRAD_ARCHIVE_API_KEY = k || "";
|
|
5616
5617
|
}
|
|
5617
5618
|
function setNexradArchiveBundleId(bundleId) {
|
|
5618
5619
|
NEXRAD_ARCHIVE_BUNDLE_ID = bundleId || "";
|
|
5619
5620
|
}
|
|
5621
|
+
function setNexradArchiveSiteOrigin(origin) {
|
|
5622
|
+
const raw = typeof origin === "string" ? origin.trim() : "";
|
|
5623
|
+
NEXRAD_ARCHIVE_SITE_ORIGIN = raw ? raw.replace(/\/+$/, "") : "";
|
|
5624
|
+
}
|
|
5620
5625
|
function cloudFrontUrlWithApiKeyQuery(baseUrl) {
|
|
5621
5626
|
if (!NEXRAD_ARCHIVE_API_KEY) return baseUrl;
|
|
5627
|
+
if (/[?&]apiKey=/i.test(baseUrl)) return baseUrl;
|
|
5622
5628
|
const sep = baseUrl.includes("?") ? "&" : "?";
|
|
5623
|
-
return `${baseUrl}${sep}apiKey=${NEXRAD_ARCHIVE_API_KEY}`;
|
|
5629
|
+
return `${baseUrl}${sep}apiKey=${encodeURIComponent(NEXRAD_ARCHIVE_API_KEY)}`;
|
|
5624
5630
|
}
|
|
5625
5631
|
function level2CloudFrontFetchHeaders(range) {
|
|
5626
5632
|
const headers = {
|
|
@@ -5633,6 +5639,10 @@ function level2CloudFrontFetchHeaders(range) {
|
|
|
5633
5639
|
if (g.navigator?.product === "ReactNative" && NEXRAD_ARCHIVE_BUNDLE_ID) {
|
|
5634
5640
|
headers["x-app-identifier"] = NEXRAD_ARCHIVE_BUNDLE_ID;
|
|
5635
5641
|
}
|
|
5642
|
+
if (NEXRAD_ARCHIVE_SITE_ORIGIN) {
|
|
5643
|
+
headers["Origin"] = NEXRAD_ARCHIVE_SITE_ORIGIN;
|
|
5644
|
+
headers["Referer"] = `${NEXRAD_ARCHIVE_SITE_ORIGIN}/`;
|
|
5645
|
+
}
|
|
5636
5646
|
return headers;
|
|
5637
5647
|
}
|
|
5638
5648
|
function shouldDecodeRadarOnMainThread() {
|
|
@@ -5738,7 +5748,8 @@ function getDecodeWorkerForPriority(priority) {
|
|
|
5738
5748
|
function objectKeyToUrl(objectKey, radarSource = "level2") {
|
|
5739
5749
|
if (objectKey.startsWith("http")) return objectKey;
|
|
5740
5750
|
const baseUrl = radarSource === "level3" ? LEVEL3_BASE_URL : LEVEL2_BASE_URL;
|
|
5741
|
-
|
|
5751
|
+
const url = `${baseUrl.replace(/\/$/, "")}/${objectKey}`;
|
|
5752
|
+
return radarSource === "level2" ? cloudFrontUrlWithApiKeyQuery(url) : url;
|
|
5742
5753
|
}
|
|
5743
5754
|
var Level3Raf = class {
|
|
5744
5755
|
offset = 0;
|
|
@@ -7054,6 +7065,7 @@ export {
|
|
|
7054
7065
|
objectKeyToUrl,
|
|
7055
7066
|
setNexradArchiveApiKey,
|
|
7056
7067
|
setNexradArchiveBundleId,
|
|
7068
|
+
setNexradArchiveSiteOrigin,
|
|
7057
7069
|
setNexradSitesFetchAuth,
|
|
7058
7070
|
setNexradSitesJsonUrl
|
|
7059
7071
|
};
|