@nextgis/ngw-leaflet 3.0.0-alpha.13 → 3.0.0-alpha.15

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: 3.0.0-alpha.13; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 3.0.0-alpha.14; author: NextGIS */
2
2
  var domain;
3
3
 
4
4
  // This constructor is used to store event handlers. Instantiating this is
@@ -18190,7 +18190,7 @@ let Cache = _Cache;
18190
18190
 
18191
18191
  var pkg = {
18192
18192
  name: "@nextgis/ngw-connector",
18193
- version: "3.0.0-alpha.13",
18193
+ version: "3.0.0-alpha.14",
18194
18194
  _priority: 12,
18195
18195
  description: "A lightweight HTTP client optimized for use with NextGIS Web API",
18196
18196
  main: "index.js",
@@ -18586,7 +18586,7 @@ function generateUrl(path, query) {
18586
18586
  }
18587
18587
  function request(path, options, cacheEngine) {
18588
18588
  return __async$t(this, null, function* () {
18589
- var _b;
18589
+ var _b, _c;
18590
18590
  const defaults = {
18591
18591
  method: "GET",
18592
18592
  credentials: "same-origin",
@@ -18611,6 +18611,7 @@ function request(path, options, cacheEngine) {
18611
18611
  "query",
18612
18612
  "json"
18613
18613
  ]);
18614
+ opt.method = (_b = opt.method) == null ? void 0 : _b.toUpperCase();
18614
18615
  if (withCredentials) {
18615
18616
  opt.credentials = "include";
18616
18617
  }
@@ -18668,15 +18669,21 @@ function request(path, options, cacheEngine) {
18668
18669
  }
18669
18670
  return body;
18670
18671
  });
18671
- if (cacheEngine && cache !== false && ((_b = opt.method) == null ? void 0 : _b.toUpperCase()) === "GET") {
18672
- const props = cacheProps ? cacheProps : __spreadValues$t({}, objectRemoveEmpty({
18673
- withCredentials,
18674
- responseType
18675
- }));
18676
- return cacheEngine.add(cacheName || url, makeRequest, {
18677
- props,
18678
- expirationTime: cache ? void 0 : 500
18679
- });
18672
+ if (cacheEngine) {
18673
+ if (((_c = opt.method) == null ? void 0 : _c.toUpperCase()) === "GET") {
18674
+ if (cache !== false) {
18675
+ const props = cacheProps ? cacheProps : __spreadValues$t({}, objectRemoveEmpty({
18676
+ withCredentials,
18677
+ responseType
18678
+ }));
18679
+ return cacheEngine.add(cacheName || url, makeRequest, {
18680
+ props,
18681
+ expirationTime: cache ? void 0 : 500
18682
+ });
18683
+ }
18684
+ } else {
18685
+ cacheEngine.clean();
18686
+ }
18680
18687
  }
18681
18688
  return makeRequest();
18682
18689
  });
@@ -22897,15 +22904,19 @@ function createRasterAdapter(_0) {
22897
22904
  }
22898
22905
  showLayer() {
22899
22906
  this._layerVisibility = true;
22900
- if (this.layer) {
22901
- if (!this._blocked) {
22907
+ if (!this._blocked) {
22908
+ if (super.showLayer) {
22909
+ super.showLayer(this.layer);
22910
+ } else if (this.layer) {
22902
22911
  webMap.mapAdapter.showLayer(this.layer);
22903
22912
  }
22904
22913
  }
22905
22914
  }
22906
22915
  hideLayer() {
22907
22916
  this._layerVisibility = false;
22908
- if (this.layer) {
22917
+ if (super.hideLayer) {
22918
+ super.hideLayer(this.layer);
22919
+ } else if (this.layer) {
22909
22920
  webMap.mapAdapter.hideLayer(this.layer);
22910
22921
  }
22911
22922
  }
@@ -23452,24 +23463,26 @@ function getCompanyLogo(connector, options) {
23452
23463
  img.style.maxHeight = "100px";
23453
23464
  img.style.maxWidth = "100px";
23454
23465
  img.src = "";
23455
- try {
23456
- const resp = yield connector.route("pyramid.csettings").get();
23457
- const logo = (_b = resp.pyramid) == null ? void 0 : _b.header_logo;
23458
- if (logo) {
23459
- const [mimeType, base64Data] = logo;
23460
- const byteCharacters = atob(base64Data);
23461
- const byteNumbers = new Array(byteCharacters.length);
23462
- for (let i = 0; i < byteCharacters.length; i++) {
23463
- byteNumbers[i] = byteCharacters.charCodeAt(i);
23464
- }
23465
- const byteArray = new Uint8Array(byteNumbers);
23466
- const blob = new Blob([byteArray], { type: mimeType });
23467
- const urlCreator = window.URL || window.webkitURL;
23468
- const imageUrl = urlCreator.createObjectURL(blob);
23469
- img.src = imageUrl;
23466
+ const resp = yield connector.route("pyramid.csettings").get({
23467
+ query: {
23468
+ pyramid: ["header_logo"]
23470
23469
  }
23471
- } catch (er) {
23472
- console.warn(er);
23470
+ });
23471
+ const logo = (_b = resp.pyramid) == null ? void 0 : _b.header_logo;
23472
+ if (logo) {
23473
+ const [mimeType, base64Data] = logo;
23474
+ const byteCharacters = atob(base64Data);
23475
+ const byteNumbers = new Array(byteCharacters.length);
23476
+ for (let i = 0; i < byteCharacters.length; i++) {
23477
+ byteNumbers[i] = byteCharacters.charCodeAt(i);
23478
+ }
23479
+ const byteArray = new Uint8Array(byteNumbers);
23480
+ const blob = new Blob([byteArray], { type: mimeType });
23481
+ const urlCreator = window.URL || window.webkitURL;
23482
+ const imageUrl = urlCreator.createObjectURL(blob);
23483
+ img.src = imageUrl;
23484
+ } else {
23485
+ return;
23473
23486
  }
23474
23487
  if (settings.company_logo.link !== null && settings.company_logo.link.trim() !== "") {
23475
23488
  anchor.href = settings.company_logo.link;