@nextgis/ngw-map 2.1.1 → 2.3.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.1.1; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-map; version: 2.3.0; author: NextGIS */
2
2
  var domain;
3
3
 
4
4
  // This constructor is used to store event handlers. Instantiating this is
@@ -473,10 +473,7 @@ function unwrapListeners(arr) {
473
473
 
474
474
  var __defProp$N = Object.defineProperty;
475
475
  var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
476
- var __publicField$z = (obj, key, value) => {
477
- __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
478
- return value;
479
- };
476
+ var __publicField$z = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
480
477
  class CancelError extends Error {
481
478
  constructor() {
482
479
  super();
@@ -487,10 +484,7 @@ class CancelError extends Error {
487
484
 
488
485
  var __defProp$M = Object.defineProperty;
489
486
  var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
490
- var __publicField$y = (obj, key, value) => {
491
- __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
492
- return value;
493
- };
487
+ var __publicField$y = (obj, key, value) => __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
494
488
  class PromiseControl {
495
489
  constructor(options = {}) {
496
490
  this.options = options;
@@ -572,10 +566,7 @@ class PromiseControl {
572
566
 
573
567
  var __defProp$L = Object.defineProperty;
574
568
  var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
575
- var __publicField$x = (obj, key, value) => {
576
- __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
577
- return value;
578
- };
569
+ var __publicField$x = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
579
570
  class TimeoutError extends Error {
580
571
  constructor() {
581
572
  super();
@@ -586,10 +577,7 @@ class TimeoutError extends Error {
586
577
 
587
578
  var __defProp$K = Object.defineProperty;
588
579
  var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
589
- var __publicField$w = (obj, key, value) => {
590
- __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
591
- return value;
592
- };
580
+ var __publicField$w = (obj, key, value) => __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
593
581
  var _a;
594
582
  const handleCallback = (resolve, reject, callback, r) => {
595
583
  try {
@@ -599,6 +587,7 @@ const handleCallback = (resolve, reject, callback, r) => {
599
587
  }
600
588
  };
601
589
  let ID$3 = 0;
590
+ _a = Symbol.toStringTag;
602
591
  const _CancelablePromise = class _CancelablePromise {
603
592
  constructor(executor, timeout) {
604
593
  // @ts-ignore
@@ -778,7 +767,6 @@ const _CancelablePromise = class _CancelablePromise {
778
767
  this._promise = void 0;
779
768
  }
780
769
  };
781
- _a = Symbol.toStringTag;
782
770
  __publicField$w(_CancelablePromise, "CancelError", CancelError);
783
771
  __publicField$w(_CancelablePromise, "TimeoutError", TimeoutError);
784
772
  __publicField$w(_CancelablePromise, "PromiseControl", PromiseControl);
@@ -1050,21 +1038,43 @@ function getIdentifyRadius(center, zoom, pixelRadius) {
1050
1038
  return radius;
1051
1039
  }
1052
1040
 
1041
+ function checkExtent(extent) {
1042
+ const [minLon, minLat, maxLon, maxLat] = extent;
1043
+ const isOrderValid = minLon < maxLon && minLat < maxLat;
1044
+ if (!isOrderValid) {
1045
+ console.log("Error: The extent coordinates are not in the correct order.");
1046
+ console.log(
1047
+ `Received extent: [${minLon}, ${minLat}, ${maxLon}, ${maxLat}]`
1048
+ );
1049
+ const correctedExtent = [
1050
+ Math.min(minLon, maxLon),
1051
+ Math.min(minLat, maxLat),
1052
+ Math.max(minLon, maxLon),
1053
+ Math.max(maxLat, minLat)
1054
+ ];
1055
+ console.log(`Expected order: [${correctedExtent.join(", ")}]`);
1056
+ }
1057
+ const isValidLon = minLon >= -180 && maxLon <= 180;
1058
+ const isValidLat = minLat >= -90 && maxLat <= 90;
1059
+ if (!isValidLon || !isValidLat) {
1060
+ console.log(
1061
+ "Warning: The coordinates may not be within valid geographic ranges."
1062
+ );
1063
+ }
1064
+ return isOrderValid && isValidLon && isValidLat;
1065
+ }
1066
+
1053
1067
  function isEqual(a, b, o, p) {
1054
1068
  if (a instanceof Array) {
1055
- if (!(b instanceof Array))
1056
- return false;
1069
+ if (!(b instanceof Array)) return false;
1057
1070
  return b.sort().join("") === a.sort().join("");
1058
1071
  } else if (a instanceof Date) {
1059
- if (!(b instanceof Date))
1060
- return false;
1072
+ if (!(b instanceof Date)) return false;
1061
1073
  return "" + a === "" + b;
1062
1074
  } else if (a instanceof Function) {
1063
- if (!(b instanceof Function))
1064
- return false;
1075
+ if (!(b instanceof Function)) return false;
1065
1076
  } else if (a instanceof Object) {
1066
- if (!(b instanceof Object))
1067
- return false;
1077
+ if (!(b instanceof Object)) return false;
1068
1078
  if (a === o) {
1069
1079
  return b === p;
1070
1080
  } else {
@@ -1076,10 +1086,8 @@ function isEqual(a, b, o, p) {
1076
1086
  function objectDeepEqual(o, p) {
1077
1087
  const keysO = Object.keys(o).sort();
1078
1088
  const keysP = Object.keys(p).sort();
1079
- if (keysO.length !== keysP.length)
1080
- return false;
1081
- if (keysO.join("") !== keysP.join(""))
1082
- return false;
1089
+ if (keysO.length !== keysP.length) return false;
1090
+ if (keysO.join("") !== keysP.join("")) return false;
1083
1091
  for (let i = 0; i < keysO.length; i++) {
1084
1092
  const oVal = o[keysO[i]];
1085
1093
  const pVal = p[keysP[i]];
@@ -1120,10 +1128,7 @@ function fixUrlStr(url) {
1120
1128
 
1121
1129
  var __defProp$J = Object.defineProperty;
1122
1130
  var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1123
- var __publicField$v = (obj, key, value) => {
1124
- __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
1125
- return value;
1126
- };
1131
+ var __publicField$v = (obj, key, value) => __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
1127
1132
  const _Cache = class _Cache {
1128
1133
  constructor(options = {}) {
1129
1134
  __publicField$v(this, "cache", []);
@@ -1250,10 +1255,7 @@ let Cache = _Cache;
1250
1255
 
1251
1256
  var __defProp$I = Object.defineProperty;
1252
1257
  var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1253
- var __publicField$u = (obj, key, value) => {
1254
- __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
1255
- return value;
1256
- };
1258
+ var __publicField$u = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
1257
1259
  class NgwError extends Error {
1258
1260
  constructor(er) {
1259
1261
  super();
@@ -1272,10 +1274,7 @@ class NgwError extends Error {
1272
1274
 
1273
1275
  var __defProp$H = Object.defineProperty;
1274
1276
  var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1275
- var __publicField$t = (obj, key, value) => {
1276
- __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
1277
- return value;
1278
- };
1277
+ var __publicField$t = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
1279
1278
  class ResourceNotFoundError extends NgwError {
1280
1279
  constructor(obj) {
1281
1280
  super(obj);
@@ -1333,10 +1332,7 @@ var __spreadValues$t = (a, b) => {
1333
1332
  return a;
1334
1333
  };
1335
1334
  var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
1336
- var __publicField$s = (obj, key, value) => {
1337
- __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
1338
- return value;
1339
- };
1335
+ var __publicField$s = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
1340
1336
  var __async$l = (__this, __arguments, generator) => {
1341
1337
  return new Promise((resolve, reject) => {
1342
1338
  var fulfilled = (value) => {
@@ -1358,9 +1354,14 @@ var __async$l = (__this, __arguments, generator) => {
1358
1354
  });
1359
1355
  };
1360
1356
  class ResourcesControl {
1361
- constructor(connector) {
1357
+ constructor({
1358
+ connector,
1359
+ cacheId
1360
+ }) {
1361
+ __publicField$s(this, "cache");
1362
+ __publicField$s(this, "connector");
1362
1363
  this.connector = connector;
1363
- __publicField$s(this, "cache", new Cache());
1364
+ this.cache = new Cache({ namespace: cacheId });
1364
1365
  }
1365
1366
  // -------------------------------------------------------------------------
1366
1367
  // Resource Methods
@@ -1373,7 +1374,7 @@ class ResourcesControl {
1373
1374
  * Fetching resource would be cached to speed up next call
1374
1375
  */
1375
1376
  getOne(resource, requestOptions) {
1376
- const cache = new Cache();
1377
+ const cache = this.cache;
1377
1378
  const forCache = {};
1378
1379
  const opt = __spreadProps$d(__spreadValues$t({}, requestOptions), { cache: false });
1379
1380
  if (typeof resource === "string") {
@@ -1624,10 +1625,7 @@ function removeConnector(connector) {
1624
1625
 
1625
1626
  var __defProp$F = Object.defineProperty;
1626
1627
  var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1627
- var __publicField$r = (obj, key, value) => {
1628
- __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
1629
- return value;
1630
- };
1628
+ var __publicField$r = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
1631
1629
  class InsufficientPermissionsError extends NgwError {
1632
1630
  constructor(obj) {
1633
1631
  super(obj);
@@ -1707,10 +1705,7 @@ function apiRequest(opt) {
1707
1705
 
1708
1706
  var __defProp$E = Object.defineProperty;
1709
1707
  var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1710
- var __publicField$q = (obj, key, value) => {
1711
- __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
1712
- return value;
1713
- };
1708
+ var __publicField$q = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
1714
1709
  class NetworkError extends Error {
1715
1710
  constructor(url) {
1716
1711
  super();
@@ -1819,10 +1814,7 @@ var __spreadValues$s = (a, b) => {
1819
1814
  }
1820
1815
  return a;
1821
1816
  };
1822
- var __publicField$p = (obj, key, value) => {
1823
- __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
1824
- return value;
1825
- };
1817
+ var __publicField$p = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
1826
1818
  let ID$2 = 0;
1827
1819
  class NgwConnector {
1828
1820
  constructor(options) {
@@ -1831,10 +1823,12 @@ class NgwConnector {
1831
1823
  __publicField$p(this, "emitter", new EventEmitter());
1832
1824
  __publicField$p(this, "user");
1833
1825
  __publicField$p(this, "resources");
1826
+ __publicField$p(this, "cache");
1834
1827
  __publicField$p(this, "routeStr", "/api/component/pyramid/route");
1835
1828
  __publicField$p(this, "activeRequests", []);
1836
1829
  __publicField$p(this, "requestTransform");
1837
1830
  const exist = findConnector(options);
1831
+ this.cache = new Cache({ namespace: options.cacheId });
1838
1832
  if (exist) {
1839
1833
  return exist;
1840
1834
  } else {
@@ -1844,13 +1838,23 @@ class NgwConnector {
1844
1838
  if (this.options.requestTransform) {
1845
1839
  this.requestTransform = this.options.requestTransform;
1846
1840
  }
1847
- this.resources = new ResourcesControl(this);
1841
+ this.resources = new ResourcesControl({
1842
+ connector: this,
1843
+ cacheId: options.cacheId
1844
+ });
1848
1845
  addConnector(this);
1849
1846
  }
1850
1847
  }
1851
1848
  static create(options) {
1852
1849
  return new this(options);
1853
1850
  }
1851
+ /**
1852
+ * Clear the cache.
1853
+ */
1854
+ clearCache() {
1855
+ this.cache.clean();
1856
+ this.resources.cache.clean();
1857
+ }
1854
1858
  setRequestTransform(requestTransform) {
1855
1859
  this.requestTransform = requestTransform;
1856
1860
  }
@@ -1878,7 +1882,6 @@ class NgwConnector {
1878
1882
  * ```
1879
1883
  */
1880
1884
  connect() {
1881
- const cache = new Cache();
1882
1885
  const auth = this.options.auth;
1883
1886
  const makeConnect = () => new CancelablePromise((resolve, reject) => {
1884
1887
  const makeQuery = () => {
@@ -1898,7 +1901,7 @@ class NgwConnector {
1898
1901
  }
1899
1902
  return makeQuery();
1900
1903
  });
1901
- return cache.add("route", makeConnect, {
1904
+ return this.cache.add("route", makeConnect, {
1902
1905
  id: this.id,
1903
1906
  auth,
1904
1907
  baseUrl: this.options.baseUrl
@@ -1921,8 +1924,8 @@ class NgwConnector {
1921
1924
  removeConnector(this);
1922
1925
  this.options.auth = void 0;
1923
1926
  this.user = void 0;
1927
+ this.clearCache();
1924
1928
  this.emitter.emit("logout");
1925
- this.resources.cache.clean();
1926
1929
  }
1927
1930
  getUserInfo(credentials, options) {
1928
1931
  if (this.user && this.user.id) {
@@ -2007,8 +2010,7 @@ class NgwConnector {
2007
2010
  const params = objectRemoveEmpty(params_);
2008
2011
  const makeApiRequest = () => apiRequest({ name, params, requestOptions, connector: this });
2009
2012
  if (requestOptions.cache && method === "GET") {
2010
- const cache = new Cache();
2011
- return cache.add(name, makeApiRequest, __spreadValues$s({
2013
+ return this.cache.add(name, makeApiRequest, __spreadValues$s({
2012
2014
  params
2013
2015
  }, objectRemoveEmpty({
2014
2016
  headers,
@@ -2294,10 +2296,8 @@ function reEscape(s) {
2294
2296
  function like(b, a, iLike) {
2295
2297
  a = String(a);
2296
2298
  b = String(b);
2297
- if (a === b)
2298
- return true;
2299
- if (iLike && a.toUpperCase() === b.toUpperCase())
2300
- return true;
2299
+ if (a === b) return true;
2300
+ if (iLike && a.toUpperCase() === b.toUpperCase()) return true;
2301
2301
  const re = `^${reEscape(a)}$`.replace(/%/g, ".*").replace("_", ".");
2302
2302
  return new RegExp(re, iLike ? "i" : "").exec(b) !== null;
2303
2303
  }
@@ -2620,10 +2620,7 @@ function fetchNgwLayerItem(options) {
2620
2620
 
2621
2621
  var __defProp$z = Object.defineProperty;
2622
2622
  var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2623
- var __publicField$o = (obj, key, value) => {
2624
- __defNormalProp$z(obj, typeof key !== "symbol" ? key + "" : key, value);
2625
- return value;
2626
- };
2623
+ var __publicField$o = (obj, key, value) => __defNormalProp$z(obj, typeof key !== "symbol" ? key + "" : key, value);
2627
2624
  class BookmarkItem {
2628
2625
  constructor(options) {
2629
2626
  this.options = options;
@@ -2787,10 +2784,7 @@ function treeEvery_(item, filterFunc = (x) => !!x, relation, _filtered = []) {
2787
2784
 
2788
2785
  var __defProp$y = Object.defineProperty;
2789
2786
  var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2790
- var __publicField$n = (obj, key, value) => {
2791
- __defNormalProp$y(obj, typeof key !== "symbol" ? key + "" : key, value);
2792
- return value;
2793
- };
2787
+ var __publicField$n = (obj, key, value) => __defNormalProp$y(obj, typeof key !== "symbol" ? key + "" : key, value);
2794
2788
  class TreeHelper {
2795
2789
  constructor(item) {
2796
2790
  __publicField$n(this, "item");
@@ -2860,10 +2854,7 @@ class TreeHelper {
2860
2854
 
2861
2855
  var __defProp$x = Object.defineProperty;
2862
2856
  var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2863
- var __publicField$m = (obj, key, value) => {
2864
- __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
2865
- return value;
2866
- };
2857
+ var __publicField$m = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
2867
2858
  class BaseProperty {
2868
2859
  constructor(name, item, options) {
2869
2860
  __publicField$m(this, "options");
@@ -2986,10 +2977,7 @@ var __spreadValues$o = (a, b) => {
2986
2977
  }
2987
2978
  return a;
2988
2979
  };
2989
- var __publicField$l = (obj, key, value) => {
2990
- __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
2991
- return value;
2992
- };
2980
+ var __publicField$l = (obj, key, value) => __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
2993
2981
  const _CheckProperty = class _CheckProperty extends BaseProperty {
2994
2982
  constructor(name, item, options) {
2995
2983
  super(name, item, __spreadValues$o(__spreadValues$o({}, _CheckProperty.options), options));
@@ -3122,10 +3110,7 @@ var __spreadValues$n = (a, b) => {
3122
3110
  }
3123
3111
  return a;
3124
3112
  };
3125
- var __publicField$k = (obj, key, value) => {
3126
- __defNormalProp$v(obj, typeof key !== "symbol" ? key + "" : key, value);
3127
- return value;
3128
- };
3113
+ var __publicField$k = (obj, key, value) => __defNormalProp$v(obj, typeof key !== "symbol" ? key + "" : key, value);
3129
3114
  const BOOLEAN_TYPE = "boolean";
3130
3115
  const STRING_TYPE = "string";
3131
3116
  const _ItemProperties = class _ItemProperties {
@@ -3217,10 +3202,7 @@ var __spreadValues$m = (a, b) => {
3217
3202
  }
3218
3203
  return a;
3219
3204
  };
3220
- var __publicField$j = (obj, key, value) => {
3221
- __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
3222
- return value;
3223
- };
3205
+ var __publicField$j = (obj, key, value) => __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
3224
3206
  let ID$1 = 0;
3225
3207
  class Item {
3226
3208
  constructor(options) {
@@ -3379,10 +3361,7 @@ function fetchNgwResourceExtent(item, connector, options) {
3379
3361
 
3380
3362
  var __defProp$s = Object.defineProperty;
3381
3363
  var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3382
- var __publicField$i = (obj, key, value) => {
3383
- __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
3384
- return value;
3385
- };
3364
+ var __publicField$i = (obj, key, value) => __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
3386
3365
  var __async$k = (__this, __arguments, generator) => {
3387
3366
  return new Promise((resolve, reject) => {
3388
3367
  var fulfilled = (value) => {
@@ -3554,10 +3533,7 @@ var __objRest$1 = (source, exclude) => {
3554
3533
  }
3555
3534
  return target;
3556
3535
  };
3557
- var __publicField$h = (obj, key, value) => {
3558
- __defNormalProp$r(obj, typeof key !== "symbol" ? key + "" : key, value);
3559
- return value;
3560
- };
3536
+ var __publicField$h = (obj, key, value) => __defNormalProp$r(obj, typeof key !== "symbol" ? key + "" : key, value);
3561
3537
  var __async$i = (__this, __arguments, generator) => {
3562
3538
  return new Promise((resolve, reject) => {
3563
3539
  var fulfilled = (value) => {
@@ -3670,10 +3646,7 @@ var __spreadValues$j = (a, b) => {
3670
3646
  }
3671
3647
  return a;
3672
3648
  };
3673
- var __publicField$g = (obj, key, value) => {
3674
- __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
3675
- return value;
3676
- };
3649
+ var __publicField$g = (obj, key, value) => __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
3677
3650
  class QmsKit {
3678
3651
  constructor(options) {
3679
3652
  __publicField$g(this, "options", {
@@ -3959,10 +3932,7 @@ var __spreadValues$g = (a, b) => {
3959
3932
  return a;
3960
3933
  };
3961
3934
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
3962
- var __publicField$f = (obj, key, value) => {
3963
- __defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
3964
- return value;
3965
- };
3935
+ var __publicField$f = (obj, key, value) => __defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
3966
3936
  var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
3967
3937
  var __async$g = (__this, __arguments, generator) => {
3968
3938
  return new Promise((resolve, reject) => {
@@ -4395,10 +4365,7 @@ var __spreadValues$f = (a, b) => {
4395
4365
  return a;
4396
4366
  };
4397
4367
  var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
4398
- var __publicField$e = (obj, key, value) => {
4399
- __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
4400
- return value;
4401
- };
4368
+ var __publicField$e = (obj, key, value) => __defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
4402
4369
  var __async$e = (__this, __arguments, generator) => {
4403
4370
  return new Promise((resolve, reject) => {
4404
4371
  var fulfilled = (value) => {
@@ -4788,10 +4755,7 @@ var __spreadValues$c = (a, b) => {
4788
4755
  }
4789
4756
  return a;
4790
4757
  };
4791
- var __publicField$d = (obj, key, value) => {
4792
- __defNormalProp$j(obj, typeof key !== "symbol" ? key + "" : key, value);
4793
- return value;
4794
- };
4758
+ var __publicField$d = (obj, key, value) => __defNormalProp$j(obj, typeof key !== "symbol" ? key + "" : key, value);
4795
4759
  var __async$c = (__this, __arguments, generator) => {
4796
4760
  return new Promise((resolve, reject) => {
4797
4761
  var fulfilled = (value) => {
@@ -5069,10 +5033,7 @@ var __spreadValues$b = (a, b) => {
5069
5033
  }
5070
5034
  return a;
5071
5035
  };
5072
- var __publicField$c = (obj, key, value) => {
5073
- __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
5074
- return value;
5075
- };
5036
+ var __publicField$c = (obj, key, value) => __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
5076
5037
  var __async$b = (__this, __arguments, generator) => {
5077
5038
  return new Promise((resolve, reject) => {
5078
5039
  var fulfilled = (value) => {
@@ -5249,10 +5210,7 @@ var __spreadValues$a = (a, b) => {
5249
5210
  }
5250
5211
  return a;
5251
5212
  };
5252
- var __publicField$b = (obj, key, value) => {
5253
- __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
5254
- return value;
5255
- };
5213
+ var __publicField$b = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
5256
5214
  var __async$9 = (__this, __arguments, generator) => {
5257
5215
  return new Promise((resolve, reject) => {
5258
5216
  var fulfilled = (value) => {
@@ -5318,8 +5276,7 @@ class NgwWebmapLayerAdapter {
5318
5276
  removeLayer() {
5319
5277
  const mapAdapter = this.options.webMap.mapAdapter;
5320
5278
  this.getDependLayers().forEach((x) => {
5321
- if (!("layer" in x))
5322
- return;
5279
+ if (!("layer" in x)) return;
5323
5280
  mapAdapter.removeLayer(x.layer.layer);
5324
5281
  });
5325
5282
  if (this._webmapBaselayersIds.length) {
@@ -5620,10 +5577,7 @@ var __spreadValues$9 = (a, b) => {
5620
5577
  }
5621
5578
  return a;
5622
5579
  };
5623
- var __publicField$a = (obj, key, value) => {
5624
- __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
5625
- return value;
5626
- };
5580
+ var __publicField$a = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
5627
5581
  var __async$8 = (__this, __arguments, generator) => {
5628
5582
  return new Promise((resolve, reject) => {
5629
5583
  var fulfilled = (value) => {
@@ -5726,10 +5680,7 @@ var __spreadValues$8 = (a, b) => {
5726
5680
  }
5727
5681
  return a;
5728
5682
  };
5729
- var __publicField$9 = (obj, key, value) => {
5730
- __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
5731
- return value;
5732
- };
5683
+ var __publicField$9 = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
5733
5684
  class IdentifyItem {
5734
5685
  constructor(options) {
5735
5686
  __publicField$9(this, "id");
@@ -5932,8 +5883,7 @@ function featureLayerIdentify(options) {
5932
5883
  }
5933
5884
  function convertGeomToWKT(geom) {
5934
5885
  const coordinates = getPolygonCoordinates(geom);
5935
- if (!coordinates)
5936
- return null;
5886
+ if (!coordinates) return null;
5937
5887
  const polygonStr = coordinates.map(([lng, lat]) => {
5938
5888
  const [x, y] = degrees2meters(lng, lat);
5939
5889
  return `${x} ${y}`;
@@ -6622,8 +6572,7 @@ const array = (args) => {
6622
6572
  return value;
6623
6573
  };
6624
6574
  function typeOfValue(value) {
6625
- if (value === null)
6626
- return "null";
6575
+ if (value === null) return "null";
6627
6576
  switch (typeof value) {
6628
6577
  case "string":
6629
6578
  return "string";
@@ -6894,10 +6843,7 @@ function preparePaint({
6894
6843
 
6895
6844
  var __defProp$a = Object.defineProperty;
6896
6845
  var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6897
- var __publicField$8 = (obj, key, value) => {
6898
- __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
6899
- return value;
6900
- };
6846
+ var __publicField$8 = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
6901
6847
  class KeyCodes {
6902
6848
  constructor() {
6903
6849
  __publicField$8(this, "backspace", 8);
@@ -6976,10 +6922,7 @@ class KeyCodes {
6976
6922
 
6977
6923
  var __defProp$9 = Object.defineProperty;
6978
6924
  var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6979
- var __publicField$7 = (obj, key, value) => {
6980
- __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
6981
- return value;
6982
- };
6925
+ var __publicField$7 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
6983
6926
  class Keys {
6984
6927
  constructor() {
6985
6928
  __publicField$7(this, "keyCodeAlias", new KeyCodes());
@@ -7027,10 +6970,7 @@ class Keys {
7027
6970
 
7028
6971
  var __defProp$8 = Object.defineProperty;
7029
6972
  var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7030
- var __publicField$6 = (obj, key, value) => {
7031
- __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
7032
- return value;
7033
- };
6973
+ var __publicField$6 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
7034
6974
  class StateItem {
7035
6975
  constructor(webMap, opt) {
7036
6976
  this.webMap = webMap;
@@ -7059,10 +6999,7 @@ class StateItem {
7059
6999
 
7060
7000
  var __defProp$7 = Object.defineProperty;
7061
7001
  var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7062
- var __publicField$5 = (obj, key, value) => {
7063
- __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
7064
- return value;
7065
- };
7002
+ var __publicField$5 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
7066
7003
  class CenterState extends StateItem {
7067
7004
  constructor() {
7068
7005
  super(...arguments);
@@ -7087,10 +7024,7 @@ class CenterState extends StateItem {
7087
7024
 
7088
7025
  var __defProp$6 = Object.defineProperty;
7089
7026
  var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7090
- var __publicField$4 = (obj, key, value) => {
7091
- __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
7092
- return value;
7093
- };
7027
+ var __publicField$4 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
7094
7028
  class ZoomState extends StateItem {
7095
7029
  constructor() {
7096
7030
  super(...arguments);
@@ -7120,10 +7054,7 @@ function clearObject(obj) {
7120
7054
 
7121
7055
  var __defProp$5 = Object.defineProperty;
7122
7056
  var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7123
- var __publicField$3 = (obj, key, value) => {
7124
- __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
7125
- return value;
7126
- };
7057
+ var __publicField$3 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
7127
7058
  var __async$6 = (__this, __arguments, generator) => {
7128
7059
  return new Promise((resolve, reject) => {
7129
7060
  var fulfilled = (value) => {
@@ -7405,6 +7336,7 @@ const _WebMapMain = class _WebMapMain {
7405
7336
  * ```
7406
7337
  */
7407
7338
  fitBounds(bounds, options) {
7339
+ checkExtent(bounds);
7408
7340
  if (bounds.every((x) => defined(x))) {
7409
7341
  if (bounds[1] < -85.06) {
7410
7342
  bounds[1] = -85.06;
@@ -7739,10 +7671,7 @@ var __spreadValues$3 = (a, b) => {
7739
7671
  return a;
7740
7672
  };
7741
7673
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
7742
- var __publicField$2 = (obj, key, value) => {
7743
- __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
7744
- return value;
7745
- };
7674
+ var __publicField$2 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
7746
7675
  var __async$5 = (__this, __arguments, generator) => {
7747
7676
  return new Promise((resolve, reject) => {
7748
7677
  var fulfilled = (value) => {
@@ -8522,6 +8451,13 @@ class WebMapLayers extends WebMapMain {
8522
8451
  return Promise.resolve(options);
8523
8452
  });
8524
8453
  }
8454
+ _onLayerDoubleClick(options) {
8455
+ return __async$5(this, null, function* () {
8456
+ const id = options.layer.id;
8457
+ this._emitLayerEvent("layer:dblclick", id || "", options);
8458
+ return Promise.resolve(options);
8459
+ });
8460
+ }
8525
8461
  _onLayerSelect(options) {
8526
8462
  return __async$5(this, null, function* () {
8527
8463
  this._emitLayerEvent("layer:select", options.layer.id || "", options);
@@ -8533,17 +8469,25 @@ class WebMapLayers extends WebMapMain {
8533
8469
  onSelect,
8534
8470
  onLayerSelect,
8535
8471
  onClick,
8472
+ onDoubleClick,
8536
8473
  onLayerClick,
8537
8474
  onMouseOut,
8538
8475
  onMouseOver
8539
8476
  } = options;
8540
8477
  const onLayerClickFromOpt = onClick || onLayerClick;
8478
+ const onLayerDblClickFromOpt = onDoubleClick || onLayerClick;
8541
8479
  options.onClick = (e) => {
8542
8480
  if (onLayerClickFromOpt) {
8543
8481
  onLayerClickFromOpt(e);
8544
8482
  }
8545
8483
  return this._onLayerClick(e);
8546
8484
  };
8485
+ options.onDoubleClick = (e) => {
8486
+ if (onLayerDblClickFromOpt) {
8487
+ onLayerDblClickFromOpt(e);
8488
+ }
8489
+ return this._onLayerDoubleClick(e);
8490
+ };
8547
8491
  options.onMouseOut = (e) => {
8548
8492
  const id = e.layer.id;
8549
8493
  onMouseOut && onMouseOut(e);
@@ -8673,10 +8617,7 @@ function createToggleControl(createButtonControl, options) {
8673
8617
 
8674
8618
  var __defProp$3 = Object.defineProperty;
8675
8619
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8676
- var __publicField$1 = (obj, key, value) => {
8677
- __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
8678
- return value;
8679
- };
8620
+ var __publicField$1 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
8680
8621
  var __async$4 = (__this, __arguments, generator) => {
8681
8622
  return new Promise((resolve, reject) => {
8682
8623
  var fulfilled = (value) => {
@@ -8875,9 +8816,7 @@ function setWebMap(id, webMap) {
8875
8816
  var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
8876
8817
  var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
8877
8818
  var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
8878
- var __knownSymbol = (name, symbol) => {
8879
- return (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
8880
- };
8819
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
8881
8820
  var __objRest = (source, exclude) => {
8882
8821
  var target = {};
8883
8822
  for (var prop in source)
@@ -9170,10 +9109,7 @@ var __spreadValues = (a, b) => {
9170
9109
  return a;
9171
9110
  };
9172
9111
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9173
- var __publicField = (obj, key, value) => {
9174
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9175
- return value;
9176
- };
9112
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9177
9113
  var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
9178
9114
  var __async$1 = (__this, __arguments, generator) => {
9179
9115
  return new Promise((resolve, reject) => {
@@ -9580,10 +9516,32 @@ const _NgwMap = class _NgwMap extends WebMap {
9580
9516
  return;
9581
9517
  }
9582
9518
  const radius = getIdentifyRadius(center, zoom, pixelRadius);
9519
+ let geom;
9520
+ if (this.options.highlightIdentification) {
9521
+ const highlightOptions = this.options.highlightIdentification;
9522
+ const highlightDuration = typeof highlightOptions === "number" ? highlightOptions : 1e3;
9523
+ const [lng, lat] = ev.lngLat;
9524
+ geom = {
9525
+ type: "Polygon",
9526
+ coordinates: [getCirclePolygonCoordinates(lng, lat, radius)]
9527
+ };
9528
+ const highlightIdentificationLayer = yield this.addGeoJsonLayer({
9529
+ data: {
9530
+ type: "Feature",
9531
+ geometry: geom
9532
+ }
9533
+ });
9534
+ if (highlightDuration !== Infinity) {
9535
+ setTimeout(() => {
9536
+ this.removeLayer(highlightIdentificationLayer);
9537
+ }, highlightDuration);
9538
+ }
9539
+ }
9583
9540
  const selectPromise = sendIdentifyRequest(ev, {
9584
9541
  layers: ids,
9585
9542
  connector: this.connector,
9586
- radius
9543
+ radius,
9544
+ geom
9587
9545
  }).then((resp) => {
9588
9546
  const identify = __spreadProps(__spreadValues({}, resp), {
9589
9547
  resources: ids,