@aguacerowx/mapsgl 0.0.58 → 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.
@@ -5624,8 +5624,9 @@ function setNexradArchiveSiteOrigin(origin) {
5624
5624
  }
5625
5625
  function cloudFrontUrlWithApiKeyQuery(baseUrl) {
5626
5626
  if (!NEXRAD_ARCHIVE_API_KEY) return baseUrl;
5627
+ if (/[?&]apiKey=/i.test(baseUrl)) return baseUrl;
5627
5628
  const sep = baseUrl.includes("?") ? "&" : "?";
5628
- return `${baseUrl}${sep}apiKey=${NEXRAD_ARCHIVE_API_KEY}`;
5629
+ return `${baseUrl}${sep}apiKey=${encodeURIComponent(NEXRAD_ARCHIVE_API_KEY)}`;
5629
5630
  }
5630
5631
  function level2CloudFrontFetchHeaders(range) {
5631
5632
  const headers = {
@@ -5747,7 +5748,8 @@ function getDecodeWorkerForPriority(priority) {
5747
5748
  function objectKeyToUrl(objectKey, radarSource = "level2") {
5748
5749
  if (objectKey.startsWith("http")) return objectKey;
5749
5750
  const baseUrl = radarSource === "level3" ? LEVEL3_BASE_URL : LEVEL2_BASE_URL;
5750
- return `${baseUrl.replace(/\/$/, "")}/${objectKey}`;
5751
+ const url = `${baseUrl.replace(/\/$/, "")}/${objectKey}`;
5752
+ return radarSource === "level2" ? cloudFrontUrlWithApiKeyQuery(url) : url;
5751
5753
  }
5752
5754
  var Level3Raf = class {
5753
5755
  offset = 0;