@nextgis/ngw-map 2.2.3 → 2.4.0

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: 2.2.3; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 2.4.0; author: NextGIS */
2
2
  var NgwMap = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -476,10 +476,7 @@ var NgwMap = (function (exports) {
476
476
 
477
477
  var __defProp$N = Object.defineProperty;
478
478
  var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
479
- var __publicField$z = (obj, key, value) => {
480
- __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
481
- return value;
482
- };
479
+ var __publicField$z = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
483
480
  class CancelError extends Error {
484
481
  constructor() {
485
482
  super();
@@ -490,10 +487,7 @@ var NgwMap = (function (exports) {
490
487
 
491
488
  var __defProp$M = Object.defineProperty;
492
489
  var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
493
- var __publicField$y = (obj, key, value) => {
494
- __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
495
- return value;
496
- };
490
+ var __publicField$y = (obj, key, value) => __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
497
491
  class PromiseControl {
498
492
  constructor(options = {}) {
499
493
  this.options = options;
@@ -575,10 +569,7 @@ var NgwMap = (function (exports) {
575
569
 
576
570
  var __defProp$L = Object.defineProperty;
577
571
  var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
578
- var __publicField$x = (obj, key, value) => {
579
- __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
580
- return value;
581
- };
572
+ var __publicField$x = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
582
573
  class TimeoutError extends Error {
583
574
  constructor() {
584
575
  super();
@@ -589,10 +580,7 @@ var NgwMap = (function (exports) {
589
580
 
590
581
  var __defProp$K = Object.defineProperty;
591
582
  var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
592
- var __publicField$w = (obj, key, value) => {
593
- __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
594
- return value;
595
- };
583
+ var __publicField$w = (obj, key, value) => __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
596
584
  var _a;
597
585
  const handleCallback = (resolve, reject, callback, r) => {
598
586
  try {
@@ -602,6 +590,7 @@ var NgwMap = (function (exports) {
602
590
  }
603
591
  };
604
592
  let ID$3 = 0;
593
+ _a = Symbol.toStringTag;
605
594
  const _CancelablePromise = class _CancelablePromise {
606
595
  constructor(executor, timeout) {
607
596
  // @ts-ignore
@@ -781,7 +770,6 @@ var NgwMap = (function (exports) {
781
770
  this._promise = void 0;
782
771
  }
783
772
  };
784
- _a = Symbol.toStringTag;
785
773
  __publicField$w(_CancelablePromise, "CancelError", CancelError);
786
774
  __publicField$w(_CancelablePromise, "TimeoutError", TimeoutError);
787
775
  __publicField$w(_CancelablePromise, "PromiseControl", PromiseControl);
@@ -1081,19 +1069,15 @@ var NgwMap = (function (exports) {
1081
1069
 
1082
1070
  function isEqual(a, b, o, p) {
1083
1071
  if (a instanceof Array) {
1084
- if (!(b instanceof Array))
1085
- return false;
1072
+ if (!(b instanceof Array)) return false;
1086
1073
  return b.sort().join("") === a.sort().join("");
1087
1074
  } else if (a instanceof Date) {
1088
- if (!(b instanceof Date))
1089
- return false;
1075
+ if (!(b instanceof Date)) return false;
1090
1076
  return "" + a === "" + b;
1091
1077
  } else if (a instanceof Function) {
1092
- if (!(b instanceof Function))
1093
- return false;
1078
+ if (!(b instanceof Function)) return false;
1094
1079
  } else if (a instanceof Object) {
1095
- if (!(b instanceof Object))
1096
- return false;
1080
+ if (!(b instanceof Object)) return false;
1097
1081
  if (a === o) {
1098
1082
  return b === p;
1099
1083
  } else {
@@ -1105,10 +1089,8 @@ var NgwMap = (function (exports) {
1105
1089
  function objectDeepEqual(o, p) {
1106
1090
  const keysO = Object.keys(o).sort();
1107
1091
  const keysP = Object.keys(p).sort();
1108
- if (keysO.length !== keysP.length)
1109
- return false;
1110
- if (keysO.join("") !== keysP.join(""))
1111
- return false;
1092
+ if (keysO.length !== keysP.length) return false;
1093
+ if (keysO.join("") !== keysP.join("")) return false;
1112
1094
  for (let i = 0; i < keysO.length; i++) {
1113
1095
  const oVal = o[keysO[i]];
1114
1096
  const pVal = p[keysP[i]];
@@ -1149,10 +1131,7 @@ var NgwMap = (function (exports) {
1149
1131
 
1150
1132
  var __defProp$J = Object.defineProperty;
1151
1133
  var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1152
- var __publicField$v = (obj, key, value) => {
1153
- __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
1154
- return value;
1155
- };
1134
+ var __publicField$v = (obj, key, value) => __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
1156
1135
  const _Cache = class _Cache {
1157
1136
  constructor(options = {}) {
1158
1137
  __publicField$v(this, "cache", []);
@@ -1279,10 +1258,7 @@ var NgwMap = (function (exports) {
1279
1258
 
1280
1259
  var __defProp$I = Object.defineProperty;
1281
1260
  var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1282
- var __publicField$u = (obj, key, value) => {
1283
- __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
1284
- return value;
1285
- };
1261
+ var __publicField$u = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
1286
1262
  class NgwError extends Error {
1287
1263
  constructor(er) {
1288
1264
  super();
@@ -1301,10 +1277,7 @@ var NgwMap = (function (exports) {
1301
1277
 
1302
1278
  var __defProp$H = Object.defineProperty;
1303
1279
  var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1304
- var __publicField$t = (obj, key, value) => {
1305
- __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
1306
- return value;
1307
- };
1280
+ var __publicField$t = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
1308
1281
  class ResourceNotFoundError extends NgwError {
1309
1282
  constructor(obj) {
1310
1283
  super(obj);
@@ -1362,10 +1335,7 @@ var NgwMap = (function (exports) {
1362
1335
  return a;
1363
1336
  };
1364
1337
  var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
1365
- var __publicField$s = (obj, key, value) => {
1366
- __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
1367
- return value;
1368
- };
1338
+ var __publicField$s = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
1369
1339
  var __async$l = (__this, __arguments, generator) => {
1370
1340
  return new Promise((resolve, reject) => {
1371
1341
  var fulfilled = (value) => {
@@ -1387,9 +1357,14 @@ var NgwMap = (function (exports) {
1387
1357
  });
1388
1358
  };
1389
1359
  class ResourcesControl {
1390
- constructor(connector) {
1360
+ constructor({
1361
+ connector,
1362
+ cacheId
1363
+ }) {
1364
+ __publicField$s(this, "cache");
1365
+ __publicField$s(this, "connector");
1391
1366
  this.connector = connector;
1392
- __publicField$s(this, "cache", new Cache());
1367
+ this.cache = new Cache({ namespace: cacheId });
1393
1368
  }
1394
1369
  // -------------------------------------------------------------------------
1395
1370
  // Resource Methods
@@ -1402,7 +1377,7 @@ var NgwMap = (function (exports) {
1402
1377
  * Fetching resource would be cached to speed up next call
1403
1378
  */
1404
1379
  getOne(resource, requestOptions) {
1405
- const cache = new Cache();
1380
+ const cache = this.cache;
1406
1381
  const forCache = {};
1407
1382
  const opt = __spreadProps$d(__spreadValues$t({}, requestOptions), { cache: false });
1408
1383
  if (typeof resource === "string") {
@@ -1431,7 +1406,10 @@ var NgwMap = (function (exports) {
1431
1406
  }
1432
1407
  return CancelablePromise.resolve(void 0);
1433
1408
  };
1434
- return cache.addFull("resource", makeRequest, forCache);
1409
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1410
+ return cache.addFull("resource", makeRequest, forCache);
1411
+ }
1412
+ return makeRequest();
1435
1413
  }
1436
1414
  getOneOrFail(resource, requestOptions) {
1437
1415
  return this.getOne(resource, requestOptions).then((res) => {
@@ -1592,14 +1570,17 @@ var NgwMap = (function (exports) {
1592
1570
  }
1593
1571
  _fetchResourceById(id, requestOptions) {
1594
1572
  const promise = () => this.connector.get("resource.item", requestOptions, { id });
1595
- return this.cache.add("resource.item", promise, {
1596
- id
1597
- }).catch((er) => {
1598
- if (!(er instanceof ResourceNotFoundError)) {
1599
- throw er;
1600
- }
1601
- return void 0;
1602
- });
1573
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
1574
+ return this.cache.add("resource.item", promise, {
1575
+ id
1576
+ }).catch((er) => {
1577
+ if (!(er instanceof ResourceNotFoundError)) {
1578
+ throw er;
1579
+ }
1580
+ return void 0;
1581
+ });
1582
+ }
1583
+ return promise();
1603
1584
  }
1604
1585
  _fetchResourceBy(resource, requestOptions) {
1605
1586
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -1653,10 +1634,7 @@ var NgwMap = (function (exports) {
1653
1634
 
1654
1635
  var __defProp$F = Object.defineProperty;
1655
1636
  var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1656
- var __publicField$r = (obj, key, value) => {
1657
- __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
1658
- return value;
1659
- };
1637
+ var __publicField$r = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
1660
1638
  class InsufficientPermissionsError extends NgwError {
1661
1639
  constructor(obj) {
1662
1640
  super(obj);
@@ -1682,7 +1660,7 @@ var NgwMap = (function (exports) {
1682
1660
  function apiRequest(opt) {
1683
1661
  const params = opt.params;
1684
1662
  return new CancelablePromise((resolve, reject) => {
1685
- opt.connector.connect().then((apiItems) => {
1663
+ return opt.connector.connect().then((apiItems) => {
1686
1664
  let apiItem = apiItems && apiItems[opt.name];
1687
1665
  if (apiItem) {
1688
1666
  apiItem = [...apiItem];
@@ -1736,10 +1714,7 @@ var NgwMap = (function (exports) {
1736
1714
 
1737
1715
  var __defProp$E = Object.defineProperty;
1738
1716
  var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1739
- var __publicField$q = (obj, key, value) => {
1740
- __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
1741
- return value;
1742
- };
1717
+ var __publicField$q = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
1743
1718
  class NetworkError extends Error {
1744
1719
  constructor(url) {
1745
1720
  super();
@@ -1848,10 +1823,7 @@ var NgwMap = (function (exports) {
1848
1823
  }
1849
1824
  return a;
1850
1825
  };
1851
- var __publicField$p = (obj, key, value) => {
1852
- __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
1853
- return value;
1854
- };
1826
+ var __publicField$p = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
1855
1827
  let ID$2 = 0;
1856
1828
  class NgwConnector {
1857
1829
  constructor(options) {
@@ -1860,10 +1832,12 @@ var NgwMap = (function (exports) {
1860
1832
  __publicField$p(this, "emitter", new EventEmitter());
1861
1833
  __publicField$p(this, "user");
1862
1834
  __publicField$p(this, "resources");
1835
+ __publicField$p(this, "cache");
1863
1836
  __publicField$p(this, "routeStr", "/api/component/pyramid/route");
1864
1837
  __publicField$p(this, "activeRequests", []);
1865
1838
  __publicField$p(this, "requestTransform");
1866
1839
  const exist = findConnector(options);
1840
+ this.cache = new Cache({ namespace: options.cacheId });
1867
1841
  if (exist) {
1868
1842
  return exist;
1869
1843
  } else {
@@ -1873,13 +1847,23 @@ var NgwMap = (function (exports) {
1873
1847
  if (this.options.requestTransform) {
1874
1848
  this.requestTransform = this.options.requestTransform;
1875
1849
  }
1876
- this.resources = new ResourcesControl(this);
1850
+ this.resources = new ResourcesControl({
1851
+ connector: this,
1852
+ cacheId: options.cacheId
1853
+ });
1877
1854
  addConnector(this);
1878
1855
  }
1879
1856
  }
1880
1857
  static create(options) {
1881
1858
  return new this(options);
1882
1859
  }
1860
+ /**
1861
+ * Clear the cache.
1862
+ */
1863
+ clearCache() {
1864
+ this.cache.clean();
1865
+ this.resources.cache.clean();
1866
+ }
1883
1867
  setRequestTransform(requestTransform) {
1884
1868
  this.requestTransform = requestTransform;
1885
1869
  }
@@ -1907,7 +1891,6 @@ var NgwMap = (function (exports) {
1907
1891
  * ```
1908
1892
  */
1909
1893
  connect() {
1910
- const cache = new Cache();
1911
1894
  const auth = this.options.auth;
1912
1895
  const makeConnect = () => new CancelablePromise((resolve, reject) => {
1913
1896
  const makeQuery = () => {
@@ -1927,7 +1910,7 @@ var NgwMap = (function (exports) {
1927
1910
  }
1928
1911
  return makeQuery();
1929
1912
  });
1930
- return cache.add("route", makeConnect, {
1913
+ return this.cache.add("route", makeConnect, {
1931
1914
  id: this.id,
1932
1915
  auth,
1933
1916
  baseUrl: this.options.baseUrl
@@ -1950,8 +1933,8 @@ var NgwMap = (function (exports) {
1950
1933
  removeConnector(this);
1951
1934
  this.options.auth = void 0;
1952
1935
  this.user = void 0;
1936
+ this.clearCache();
1953
1937
  this.emitter.emit("logout");
1954
- this.resources.cache.clean();
1955
1938
  }
1956
1939
  getUserInfo(credentials, options) {
1957
1940
  if (this.user && this.user.id) {
@@ -2036,8 +2019,7 @@ var NgwMap = (function (exports) {
2036
2019
  const params = objectRemoveEmpty(params_);
2037
2020
  const makeApiRequest = () => apiRequest({ name, params, requestOptions, connector: this });
2038
2021
  if (requestOptions.cache && method === "GET") {
2039
- const cache = new Cache();
2040
- return cache.add(name, makeApiRequest, __spreadValues$s({
2022
+ return this.cache.add(name, makeApiRequest, __spreadValues$s({
2041
2023
  params
2042
2024
  }, objectRemoveEmpty({
2043
2025
  headers,
@@ -2323,10 +2305,8 @@ var NgwMap = (function (exports) {
2323
2305
  function like(b, a, iLike) {
2324
2306
  a = String(a);
2325
2307
  b = String(b);
2326
- if (a === b)
2327
- return true;
2328
- if (iLike && a.toUpperCase() === b.toUpperCase())
2329
- return true;
2308
+ if (a === b) return true;
2309
+ if (iLike && a.toUpperCase() === b.toUpperCase()) return true;
2330
2310
  const re = `^${reEscape(a)}$`.replace(/%/g, ".*").replace("_", ".");
2331
2311
  return new RegExp(re, iLike ? "i" : "").exec(b) !== null;
2332
2312
  }
@@ -2649,10 +2629,7 @@ var NgwMap = (function (exports) {
2649
2629
 
2650
2630
  var __defProp$z = Object.defineProperty;
2651
2631
  var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2652
- var __publicField$o = (obj, key, value) => {
2653
- __defNormalProp$z(obj, typeof key !== "symbol" ? key + "" : key, value);
2654
- return value;
2655
- };
2632
+ var __publicField$o = (obj, key, value) => __defNormalProp$z(obj, typeof key !== "symbol" ? key + "" : key, value);
2656
2633
  class BookmarkItem {
2657
2634
  constructor(options) {
2658
2635
  this.options = options;
@@ -2816,10 +2793,7 @@ var NgwMap = (function (exports) {
2816
2793
 
2817
2794
  var __defProp$y = Object.defineProperty;
2818
2795
  var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2819
- var __publicField$n = (obj, key, value) => {
2820
- __defNormalProp$y(obj, typeof key !== "symbol" ? key + "" : key, value);
2821
- return value;
2822
- };
2796
+ var __publicField$n = (obj, key, value) => __defNormalProp$y(obj, typeof key !== "symbol" ? key + "" : key, value);
2823
2797
  class TreeHelper {
2824
2798
  constructor(item) {
2825
2799
  __publicField$n(this, "item");
@@ -2889,10 +2863,7 @@ var NgwMap = (function (exports) {
2889
2863
 
2890
2864
  var __defProp$x = Object.defineProperty;
2891
2865
  var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2892
- var __publicField$m = (obj, key, value) => {
2893
- __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
2894
- return value;
2895
- };
2866
+ var __publicField$m = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
2896
2867
  class BaseProperty {
2897
2868
  constructor(name, item, options) {
2898
2869
  __publicField$m(this, "options");
@@ -3015,10 +2986,7 @@ var NgwMap = (function (exports) {
3015
2986
  }
3016
2987
  return a;
3017
2988
  };
3018
- var __publicField$l = (obj, key, value) => {
3019
- __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
3020
- return value;
3021
- };
2989
+ var __publicField$l = (obj, key, value) => __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
3022
2990
  const _CheckProperty = class _CheckProperty extends BaseProperty {
3023
2991
  constructor(name, item, options) {
3024
2992
  super(name, item, __spreadValues$o(__spreadValues$o({}, _CheckProperty.options), options));
@@ -3151,10 +3119,7 @@ var NgwMap = (function (exports) {
3151
3119
  }
3152
3120
  return a;
3153
3121
  };
3154
- var __publicField$k = (obj, key, value) => {
3155
- __defNormalProp$v(obj, typeof key !== "symbol" ? key + "" : key, value);
3156
- return value;
3157
- };
3122
+ var __publicField$k = (obj, key, value) => __defNormalProp$v(obj, typeof key !== "symbol" ? key + "" : key, value);
3158
3123
  const BOOLEAN_TYPE = "boolean";
3159
3124
  const STRING_TYPE = "string";
3160
3125
  const _ItemProperties = class _ItemProperties {
@@ -3246,10 +3211,7 @@ var NgwMap = (function (exports) {
3246
3211
  }
3247
3212
  return a;
3248
3213
  };
3249
- var __publicField$j = (obj, key, value) => {
3250
- __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
3251
- return value;
3252
- };
3214
+ var __publicField$j = (obj, key, value) => __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
3253
3215
  let ID$1 = 0;
3254
3216
  class Item {
3255
3217
  constructor(options) {
@@ -3408,10 +3370,7 @@ var NgwMap = (function (exports) {
3408
3370
 
3409
3371
  var __defProp$s = Object.defineProperty;
3410
3372
  var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3411
- var __publicField$i = (obj, key, value) => {
3412
- __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
3413
- return value;
3414
- };
3373
+ var __publicField$i = (obj, key, value) => __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
3415
3374
  var __async$k = (__this, __arguments, generator) => {
3416
3375
  return new Promise((resolve, reject) => {
3417
3376
  var fulfilled = (value) => {
@@ -3583,10 +3542,7 @@ var NgwMap = (function (exports) {
3583
3542
  }
3584
3543
  return target;
3585
3544
  };
3586
- var __publicField$h = (obj, key, value) => {
3587
- __defNormalProp$r(obj, typeof key !== "symbol" ? key + "" : key, value);
3588
- return value;
3589
- };
3545
+ var __publicField$h = (obj, key, value) => __defNormalProp$r(obj, typeof key !== "symbol" ? key + "" : key, value);
3590
3546
  var __async$i = (__this, __arguments, generator) => {
3591
3547
  return new Promise((resolve, reject) => {
3592
3548
  var fulfilled = (value) => {
@@ -3699,10 +3655,7 @@ var NgwMap = (function (exports) {
3699
3655
  }
3700
3656
  return a;
3701
3657
  };
3702
- var __publicField$g = (obj, key, value) => {
3703
- __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
3704
- return value;
3705
- };
3658
+ var __publicField$g = (obj, key, value) => __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
3706
3659
  class QmsKit {
3707
3660
  constructor(options) {
3708
3661
  __publicField$g(this, "options", {
@@ -3988,10 +3941,7 @@ var NgwMap = (function (exports) {
3988
3941
  return a;
3989
3942
  };
3990
3943
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
3991
- var __publicField$f = (obj, key, value) => {
3992
- __defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
3993
- return value;
3994
- };
3944
+ var __publicField$f = (obj, key, value) => __defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
3995
3945
  var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
3996
3946
  var __async$g = (__this, __arguments, generator) => {
3997
3947
  return new Promise((resolve, reject) => {
@@ -4424,10 +4374,7 @@ var NgwMap = (function (exports) {
4424
4374
  return a;
4425
4375
  };
4426
4376
  var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
4427
- var __publicField$e = (obj, key, value) => {
4428
- __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
4429
- return value;
4430
- };
4377
+ var __publicField$e = (obj, key, value) => __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
4431
4378
  var __async$e = (__this, __arguments, generator) => {
4432
4379
  return new Promise((resolve, reject) => {
4433
4380
  var fulfilled = (value) => {
@@ -4817,10 +4764,7 @@ var NgwMap = (function (exports) {
4817
4764
  }
4818
4765
  return a;
4819
4766
  };
4820
- var __publicField$d = (obj, key, value) => {
4821
- __defNormalProp$j(obj, typeof key !== "symbol" ? key + "" : key, value);
4822
- return value;
4823
- };
4767
+ var __publicField$d = (obj, key, value) => __defNormalProp$j(obj, typeof key !== "symbol" ? key + "" : key, value);
4824
4768
  var __async$c = (__this, __arguments, generator) => {
4825
4769
  return new Promise((resolve, reject) => {
4826
4770
  var fulfilled = (value) => {
@@ -5098,10 +5042,7 @@ var NgwMap = (function (exports) {
5098
5042
  }
5099
5043
  return a;
5100
5044
  };
5101
- var __publicField$c = (obj, key, value) => {
5102
- __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
5103
- return value;
5104
- };
5045
+ var __publicField$c = (obj, key, value) => __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
5105
5046
  var __async$b = (__this, __arguments, generator) => {
5106
5047
  return new Promise((resolve, reject) => {
5107
5048
  var fulfilled = (value) => {
@@ -5278,10 +5219,7 @@ var NgwMap = (function (exports) {
5278
5219
  }
5279
5220
  return a;
5280
5221
  };
5281
- var __publicField$b = (obj, key, value) => {
5282
- __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
5283
- return value;
5284
- };
5222
+ var __publicField$b = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
5285
5223
  var __async$9 = (__this, __arguments, generator) => {
5286
5224
  return new Promise((resolve, reject) => {
5287
5225
  var fulfilled = (value) => {
@@ -5347,8 +5285,7 @@ var NgwMap = (function (exports) {
5347
5285
  removeLayer() {
5348
5286
  const mapAdapter = this.options.webMap.mapAdapter;
5349
5287
  this.getDependLayers().forEach((x) => {
5350
- if (!("layer" in x))
5351
- return;
5288
+ if (!("layer" in x)) return;
5352
5289
  mapAdapter.removeLayer(x.layer.layer);
5353
5290
  });
5354
5291
  if (this._webmapBaselayersIds.length) {
@@ -5649,10 +5586,7 @@ var NgwMap = (function (exports) {
5649
5586
  }
5650
5587
  return a;
5651
5588
  };
5652
- var __publicField$a = (obj, key, value) => {
5653
- __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
5654
- return value;
5655
- };
5589
+ var __publicField$a = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
5656
5590
  var __async$8 = (__this, __arguments, generator) => {
5657
5591
  return new Promise((resolve, reject) => {
5658
5592
  var fulfilled = (value) => {
@@ -5755,10 +5689,7 @@ var NgwMap = (function (exports) {
5755
5689
  }
5756
5690
  return a;
5757
5691
  };
5758
- var __publicField$9 = (obj, key, value) => {
5759
- __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
5760
- return value;
5761
- };
5692
+ var __publicField$9 = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
5762
5693
  class IdentifyItem {
5763
5694
  constructor(options) {
5764
5695
  __publicField$9(this, "id");
@@ -5961,8 +5892,7 @@ var NgwMap = (function (exports) {
5961
5892
  }
5962
5893
  function convertGeomToWKT(geom) {
5963
5894
  const coordinates = getPolygonCoordinates(geom);
5964
- if (!coordinates)
5965
- return null;
5895
+ if (!coordinates) return null;
5966
5896
  const polygonStr = coordinates.map(([lng, lat]) => {
5967
5897
  const [x, y] = degrees2meters(lng, lat);
5968
5898
  return `${x} ${y}`;
@@ -6651,8 +6581,7 @@ var NgwMap = (function (exports) {
6651
6581
  return value;
6652
6582
  };
6653
6583
  function typeOfValue(value) {
6654
- if (value === null)
6655
- return "null";
6584
+ if (value === null) return "null";
6656
6585
  switch (typeof value) {
6657
6586
  case "string":
6658
6587
  return "string";
@@ -6923,10 +6852,7 @@ var NgwMap = (function (exports) {
6923
6852
 
6924
6853
  var __defProp$a = Object.defineProperty;
6925
6854
  var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6926
- var __publicField$8 = (obj, key, value) => {
6927
- __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
6928
- return value;
6929
- };
6855
+ var __publicField$8 = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
6930
6856
  class KeyCodes {
6931
6857
  constructor() {
6932
6858
  __publicField$8(this, "backspace", 8);
@@ -7005,10 +6931,7 @@ var NgwMap = (function (exports) {
7005
6931
 
7006
6932
  var __defProp$9 = Object.defineProperty;
7007
6933
  var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7008
- var __publicField$7 = (obj, key, value) => {
7009
- __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
7010
- return value;
7011
- };
6934
+ var __publicField$7 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
7012
6935
  class Keys {
7013
6936
  constructor() {
7014
6937
  __publicField$7(this, "keyCodeAlias", new KeyCodes());
@@ -7056,10 +6979,7 @@ var NgwMap = (function (exports) {
7056
6979
 
7057
6980
  var __defProp$8 = Object.defineProperty;
7058
6981
  var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7059
- var __publicField$6 = (obj, key, value) => {
7060
- __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
7061
- return value;
7062
- };
6982
+ var __publicField$6 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
7063
6983
  class StateItem {
7064
6984
  constructor(webMap, opt) {
7065
6985
  this.webMap = webMap;
@@ -7088,10 +7008,7 @@ var NgwMap = (function (exports) {
7088
7008
 
7089
7009
  var __defProp$7 = Object.defineProperty;
7090
7010
  var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7091
- var __publicField$5 = (obj, key, value) => {
7092
- __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
7093
- return value;
7094
- };
7011
+ var __publicField$5 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
7095
7012
  class CenterState extends StateItem {
7096
7013
  constructor() {
7097
7014
  super(...arguments);
@@ -7116,10 +7033,7 @@ var NgwMap = (function (exports) {
7116
7033
 
7117
7034
  var __defProp$6 = Object.defineProperty;
7118
7035
  var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7119
- var __publicField$4 = (obj, key, value) => {
7120
- __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
7121
- return value;
7122
- };
7036
+ var __publicField$4 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
7123
7037
  class ZoomState extends StateItem {
7124
7038
  constructor() {
7125
7039
  super(...arguments);
@@ -7149,10 +7063,7 @@ var NgwMap = (function (exports) {
7149
7063
 
7150
7064
  var __defProp$5 = Object.defineProperty;
7151
7065
  var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7152
- var __publicField$3 = (obj, key, value) => {
7153
- __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
7154
- return value;
7155
- };
7066
+ var __publicField$3 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
7156
7067
  var __async$6 = (__this, __arguments, generator) => {
7157
7068
  return new Promise((resolve, reject) => {
7158
7069
  var fulfilled = (value) => {
@@ -7769,10 +7680,7 @@ var NgwMap = (function (exports) {
7769
7680
  return a;
7770
7681
  };
7771
7682
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
7772
- var __publicField$2 = (obj, key, value) => {
7773
- __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
7774
- return value;
7775
- };
7683
+ var __publicField$2 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
7776
7684
  var __async$5 = (__this, __arguments, generator) => {
7777
7685
  return new Promise((resolve, reject) => {
7778
7686
  var fulfilled = (value) => {
@@ -8718,10 +8626,7 @@ var NgwMap = (function (exports) {
8718
8626
 
8719
8627
  var __defProp$3 = Object.defineProperty;
8720
8628
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8721
- var __publicField$1 = (obj, key, value) => {
8722
- __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
8723
- return value;
8724
- };
8629
+ var __publicField$1 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
8725
8630
  var __async$4 = (__this, __arguments, generator) => {
8726
8631
  return new Promise((resolve, reject) => {
8727
8632
  var fulfilled = (value) => {
@@ -8920,9 +8825,7 @@ var NgwMap = (function (exports) {
8920
8825
  var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
8921
8826
  var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
8922
8827
  var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
8923
- var __knownSymbol = (name, symbol) => {
8924
- return (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
8925
- };
8828
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
8926
8829
  var __objRest = (source, exclude) => {
8927
8830
  var target = {};
8928
8831
  for (var prop in source)
@@ -9215,10 +9118,7 @@ var NgwMap = (function (exports) {
9215
9118
  return a;
9216
9119
  };
9217
9120
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9218
- var __publicField = (obj, key, value) => {
9219
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9220
- return value;
9221
- };
9121
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9222
9122
  var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
9223
9123
  var __async$1 = (__this, __arguments, generator) => {
9224
9124
  return new Promise((resolve, reject) => {
@@ -9625,10 +9525,32 @@ var NgwMap = (function (exports) {
9625
9525
  return;
9626
9526
  }
9627
9527
  const radius = getIdentifyRadius(center, zoom, pixelRadius);
9528
+ let geom;
9529
+ if (this.options.highlightIdentification) {
9530
+ const highlightOptions = this.options.highlightIdentification;
9531
+ const highlightDuration = typeof highlightOptions === "number" ? highlightOptions : 1e3;
9532
+ const [lng, lat] = ev.lngLat;
9533
+ geom = {
9534
+ type: "Polygon",
9535
+ coordinates: [getCirclePolygonCoordinates(lng, lat, radius)]
9536
+ };
9537
+ const highlightIdentificationLayer = yield this.addGeoJsonLayer({
9538
+ data: {
9539
+ type: "Feature",
9540
+ geometry: geom
9541
+ }
9542
+ });
9543
+ if (highlightDuration !== Infinity) {
9544
+ setTimeout(() => {
9545
+ this.removeLayer(highlightIdentificationLayer);
9546
+ }, highlightDuration);
9547
+ }
9548
+ }
9628
9549
  const selectPromise = sendIdentifyRequest(ev, {
9629
9550
  layers: ids,
9630
9551
  connector: this.connector,
9631
- radius
9552
+ radius,
9553
+ geom
9632
9554
  }).then((resp) => {
9633
9555
  const identify = __spreadProps(__spreadValues({}, resp), {
9634
9556
  resources: ids,