@nextgis/ngw-map 3.0.0-alpha.13 → 3.0.0-alpha.14

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
  import { getIcon } from '@nextgis/icons';
3
3
  import NgwConnector from '@nextgis/ngw-connector';
4
4
  import { NgwKit, fetchNgwLayerItem, fetchNgwLayerItems, fetchNgwLayerFeature, fetchNgwLayerFeatureCollection, fetchIdentifyItem, fetchIdentifyGeoJson, createNgwLayerAdapter, fetchNgwExtent, sendIdentifyRequest, getCompanyLogo, getIdentifyItems, createIdentifyItem } from '@nextgis/ngw-kit';
@@ -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
  var NgwMap = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -1068,7 +1068,7 @@ var NgwMap = (function (exports) {
1068
1068
 
1069
1069
  var pkg = {
1070
1070
  name: "@nextgis/ngw-connector",
1071
- version: "3.0.0-alpha.13",
1071
+ version: "3.0.0-alpha.14",
1072
1072
  _priority: 12,
1073
1073
  description: "A lightweight HTTP client optimized for use with NextGIS Web API",
1074
1074
  main: "index.js",
@@ -1464,7 +1464,7 @@ var NgwMap = (function (exports) {
1464
1464
  }
1465
1465
  function request(path, options, cacheEngine) {
1466
1466
  return __async$u(this, null, function* () {
1467
- var _b;
1467
+ var _b, _c;
1468
1468
  const defaults = {
1469
1469
  method: "GET",
1470
1470
  credentials: "same-origin",
@@ -1489,6 +1489,7 @@ var NgwMap = (function (exports) {
1489
1489
  "query",
1490
1490
  "json"
1491
1491
  ]);
1492
+ opt.method = (_b = opt.method) == null ? void 0 : _b.toUpperCase();
1492
1493
  if (withCredentials) {
1493
1494
  opt.credentials = "include";
1494
1495
  }
@@ -1546,15 +1547,21 @@ var NgwMap = (function (exports) {
1546
1547
  }
1547
1548
  return body;
1548
1549
  });
1549
- if (cacheEngine && cache !== false && ((_b = opt.method) == null ? void 0 : _b.toUpperCase()) === "GET") {
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
- });
1550
+ if (cacheEngine) {
1551
+ if (((_c = opt.method) == null ? void 0 : _c.toUpperCase()) === "GET") {
1552
+ if (cache !== false) {
1553
+ const props = cacheProps ? cacheProps : __spreadValues$w({}, objectRemoveEmpty({
1554
+ withCredentials,
1555
+ responseType
1556
+ }));
1557
+ return cacheEngine.add(cacheName || url, makeRequest, {
1558
+ props,
1559
+ expirationTime: cache ? void 0 : 500
1560
+ });
1561
+ }
1562
+ } else {
1563
+ cacheEngine.clean();
1564
+ }
1558
1565
  }
1559
1566
  return makeRequest();
1560
1567
  });