@nextgis/ngw-leaflet 4.0.1 → 4.0.2

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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 4.0.1; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 4.0.2; author: NextGIS */
2
2
  function getElement(el) {
3
3
  if (typeof el === "string") {
4
4
  let el_ = document.getElementById(el);
@@ -15652,8 +15652,14 @@ function fixUrlStr(url) {
15652
15652
  return url.replace(/([^:]\/)\/+/g, "$1");
15653
15653
  }
15654
15654
  function updateUrlParams(urlStr, params) {
15655
- const url = new URL(urlStr);
15656
- const searchParams = new URLSearchParams(url.search);
15655
+ const hashIndex = urlStr.indexOf("#");
15656
+ const hash = hashIndex === -1 ? "" : urlStr.slice(hashIndex);
15657
+ const url = hashIndex === -1 ? urlStr : urlStr.slice(0, hashIndex);
15658
+ const queryIndex = url.indexOf("?");
15659
+ const baseUrl = queryIndex === -1 ? url : url.slice(0, queryIndex);
15660
+ const searchParams = new URLSearchParams(
15661
+ queryIndex === -1 ? "" : url.slice(queryIndex + 1)
15662
+ );
15657
15663
  Object.entries(params).forEach(([key, value]) => {
15658
15664
  if (value === void 0) {
15659
15665
  searchParams.delete(key);
@@ -15663,7 +15669,7 @@ function updateUrlParams(urlStr, params) {
15663
15669
  });
15664
15670
  searchParams.set("timestamp", String((/* @__PURE__ */ new Date()).getTime()));
15665
15671
  const newSearch = [...searchParams.entries()].map(([key, value]) => `${key}=${value}`).join("&");
15666
- return `${url.origin}${url.pathname}?${newSearch}`;
15672
+ return `${baseUrl}?${newSearch}${hash}`;
15667
15673
  }
15668
15674
 
15669
15675
  function boundsToArray(bounds) {
@@ -21272,7 +21278,7 @@ __publicField$s(_Cache, "instance", {});
21272
21278
  let Cache = _Cache;
21273
21279
 
21274
21280
  var pkg = {
21275
- version: "4.0.1"};
21281
+ version: "4.0.2"};
21276
21282
 
21277
21283
  class AbortError extends Error {
21278
21284
  constructor(message = "AbortError") {