@nextgis/ngw-map 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-map; version: 3.0.0-alpha.13; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 3.0.0-alpha.14; author: NextGIS */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-map; version: 3.0.0-alpha.13; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 3.0.0-alpha.14; author: NextGIS */
2
2
  const svgPath = {
3
3
  brill: '<path d="m6 0-5 6 5 6 5-6z"/>',
4
4
  circle: '<circle cx="6" cy="6" r="6"/>',
@@ -1065,7 +1065,7 @@ function unwrapListeners(arr) {
1065
1065
 
1066
1066
  var pkg = {
1067
1067
  name: "@nextgis/ngw-connector",
1068
- version: "3.0.0-alpha.13",
1068
+ version: "3.0.0-alpha.14",
1069
1069
  _priority: 12,
1070
1070
  description: "A lightweight HTTP client optimized for use with NextGIS Web API",
1071
1071
  main: "index.js",
@@ -1461,7 +1461,7 @@ function generateUrl(path, query) {
1461
1461
  }
1462
1462
  function request(path, options, cacheEngine) {
1463
1463
  return __async$u(this, null, function* () {
1464
- var _b;
1464
+ var _b, _c;
1465
1465
  const defaults = {
1466
1466
  method: "GET",
1467
1467
  credentials: "same-origin",
@@ -1486,6 +1486,7 @@ function request(path, options, cacheEngine) {
1486
1486
  "query",
1487
1487
  "json"
1488
1488
  ]);
1489
+ opt.method = (_b = opt.method) == null ? void 0 : _b.toUpperCase();
1489
1490
  if (withCredentials) {
1490
1491
  opt.credentials = "include";
1491
1492
  }
@@ -1543,15 +1544,21 @@ function request(path, options, cacheEngine) {
1543
1544
  }
1544
1545
  return body;
1545
1546
  });
1546
- if (cacheEngine && cache !== false && ((_b = opt.method) == null ? void 0 : _b.toUpperCase()) === "GET") {
1547
- const props = cacheProps ? cacheProps : __spreadValues$w({}, objectRemoveEmpty({
1548
- withCredentials,
1549
- responseType
1550
- }));
1551
- return cacheEngine.add(cacheName || url, makeRequest, {
1552
- props,
1553
- expirationTime: cache ? void 0 : 500
1554
- });
1547
+ if (cacheEngine) {
1548
+ if (((_c = opt.method) == null ? void 0 : _c.toUpperCase()) === "GET") {
1549
+ if (cache !== false) {
1550
+ const props = cacheProps ? cacheProps : __spreadValues$w({}, objectRemoveEmpty({
1551
+ withCredentials,
1552
+ responseType
1553
+ }));
1554
+ return cacheEngine.add(cacheName || url, makeRequest, {
1555
+ props,
1556
+ expirationTime: cache ? void 0 : 500
1557
+ });
1558
+ }
1559
+ } else {
1560
+ cacheEngine.clean();
1561
+ }
1555
1562
  }
1556
1563
  return makeRequest();
1557
1564
  });
@@ -5866,15 +5873,19 @@ function createRasterAdapter(_0) {
5866
5873
  }
5867
5874
  showLayer() {
5868
5875
  this._layerVisibility = true;
5869
- if (this.layer) {
5870
- if (!this._blocked) {
5876
+ if (!this._blocked) {
5877
+ if (super.showLayer) {
5878
+ super.showLayer(this.layer);
5879
+ } else if (this.layer) {
5871
5880
  webMap.mapAdapter.showLayer(this.layer);
5872
5881
  }
5873
5882
  }
5874
5883
  }
5875
5884
  hideLayer() {
5876
5885
  this._layerVisibility = false;
5877
- if (this.layer) {
5886
+ if (super.hideLayer) {
5887
+ super.hideLayer(this.layer);
5888
+ } else if (this.layer) {
5878
5889
  webMap.mapAdapter.hideLayer(this.layer);
5879
5890
  }
5880
5891
  }
@@ -6421,24 +6432,26 @@ function getCompanyLogo(connector, options) {
6421
6432
  img.style.maxHeight = "100px";
6422
6433
  img.style.maxWidth = "100px";
6423
6434
  img.src = "";
6424
- try {
6425
- const resp = yield connector.route("pyramid.csettings").get();
6426
- const logo = (_b = resp.pyramid) == null ? void 0 : _b.header_logo;
6427
- if (logo) {
6428
- const [mimeType, base64Data] = logo;
6429
- const byteCharacters = atob(base64Data);
6430
- const byteNumbers = new Array(byteCharacters.length);
6431
- for (let i = 0; i < byteCharacters.length; i++) {
6432
- byteNumbers[i] = byteCharacters.charCodeAt(i);
6433
- }
6434
- const byteArray = new Uint8Array(byteNumbers);
6435
- const blob = new Blob([byteArray], { type: mimeType });
6436
- const urlCreator = window.URL || window.webkitURL;
6437
- const imageUrl = urlCreator.createObjectURL(blob);
6438
- img.src = imageUrl;
6435
+ const resp = yield connector.route("pyramid.csettings").get({
6436
+ query: {
6437
+ pyramid: ["header_logo"]
6439
6438
  }
6440
- } catch (er) {
6441
- console.warn(er);
6439
+ });
6440
+ const logo = (_b = resp.pyramid) == null ? void 0 : _b.header_logo;
6441
+ if (logo) {
6442
+ const [mimeType, base64Data] = logo;
6443
+ const byteCharacters = atob(base64Data);
6444
+ const byteNumbers = new Array(byteCharacters.length);
6445
+ for (let i = 0; i < byteCharacters.length; i++) {
6446
+ byteNumbers[i] = byteCharacters.charCodeAt(i);
6447
+ }
6448
+ const byteArray = new Uint8Array(byteNumbers);
6449
+ const blob = new Blob([byteArray], { type: mimeType });
6450
+ const urlCreator = window.URL || window.webkitURL;
6451
+ const imageUrl = urlCreator.createObjectURL(blob);
6452
+ img.src = imageUrl;
6453
+ } else {
6454
+ return;
6442
6455
  }
6443
6456
  if (settings.company_logo.link !== null && settings.company_logo.link.trim() !== "") {
6444
6457
  anchor.href = settings.company_logo.link;