@nextgis/ngw-leaflet 2.2.3 → 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-leaflet; version: 2.2.3; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 2.3.0; author: NextGIS */
2
2
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -14888,19 +14888,15 @@ var NgwLeaflet = (function () {
14888
14888
 
14889
14889
  function isEqual(a, b, o, p) {
14890
14890
  if (a instanceof Array) {
14891
- if (!(b instanceof Array))
14892
- return false;
14891
+ if (!(b instanceof Array)) return false;
14893
14892
  return b.sort().join("") === a.sort().join("");
14894
14893
  } else if (a instanceof Date) {
14895
- if (!(b instanceof Date))
14896
- return false;
14894
+ if (!(b instanceof Date)) return false;
14897
14895
  return "" + a === "" + b;
14898
14896
  } else if (a instanceof Function) {
14899
- if (!(b instanceof Function))
14900
- return false;
14897
+ if (!(b instanceof Function)) return false;
14901
14898
  } else if (a instanceof Object) {
14902
- if (!(b instanceof Object))
14903
- return false;
14899
+ if (!(b instanceof Object)) return false;
14904
14900
  if (a === o) {
14905
14901
  return b === p;
14906
14902
  } else {
@@ -14912,10 +14908,8 @@ var NgwLeaflet = (function () {
14912
14908
  function objectDeepEqual(o, p) {
14913
14909
  const keysO = Object.keys(o).sort();
14914
14910
  const keysP = Object.keys(p).sort();
14915
- if (keysO.length !== keysP.length)
14916
- return false;
14917
- if (keysO.join("") !== keysP.join(""))
14918
- return false;
14911
+ if (keysO.length !== keysP.length) return false;
14912
+ if (keysO.join("") !== keysP.join("")) return false;
14919
14913
  for (let i = 0; i < keysO.length; i++) {
14920
14914
  const oVal = o[keysO[i]];
14921
14915
  const pVal = p[keysP[i]];
@@ -15059,10 +15053,7 @@ var NgwLeaflet = (function () {
15059
15053
 
15060
15054
  var __defProp$$ = Object.defineProperty;
15061
15055
  var __defNormalProp$$ = (obj, key, value) => key in obj ? __defProp$$(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15062
- var __publicField$I = (obj, key, value) => {
15063
- __defNormalProp$$(obj, typeof key !== "symbol" ? key + "" : key, value);
15064
- return value;
15065
- };
15056
+ var __publicField$I = (obj, key, value) => __defNormalProp$$(obj, typeof key !== "symbol" ? key + "" : key, value);
15066
15057
  class BaseAdapter {
15067
15058
  constructor(map, options) {
15068
15059
  this.map = map;
@@ -15144,10 +15135,7 @@ var NgwLeaflet = (function () {
15144
15135
  }
15145
15136
  return a;
15146
15137
  };
15147
- var __publicField$H = (obj, key, value) => {
15148
- __defNormalProp$Z(obj, typeof key !== "symbol" ? key + "" : key, value);
15149
- return value;
15150
- };
15138
+ var __publicField$H = (obj, key, value) => __defNormalProp$Z(obj, typeof key !== "symbol" ? key + "" : key, value);
15151
15139
  class GeoJsonEvents {
15152
15140
  constructor(layer) {
15153
15141
  __publicField$H(this, "layer");
@@ -15806,8 +15794,7 @@ var NgwLeaflet = (function () {
15806
15794
  return value;
15807
15795
  };
15808
15796
  function typeOfValue(value) {
15809
- if (value === null)
15810
- return "null";
15797
+ if (value === null) return "null";
15811
15798
  switch (typeof value) {
15812
15799
  case "string":
15813
15800
  return "string";
@@ -15962,10 +15949,8 @@ var NgwLeaflet = (function () {
15962
15949
  function like(b, a, iLike) {
15963
15950
  a = String(a);
15964
15951
  b = String(b);
15965
- if (a === b)
15966
- return true;
15967
- if (iLike && a.toUpperCase() === b.toUpperCase())
15968
- return true;
15952
+ if (a === b) return true;
15953
+ if (iLike && a.toUpperCase() === b.toUpperCase()) return true;
15969
15954
  const re = `^${reEscape(a)}$`.replace(/%/g, ".*").replace("_", ".");
15970
15955
  return new RegExp(re, iLike ? "i" : "").exec(b) !== null;
15971
15956
  }
@@ -16203,10 +16188,7 @@ var NgwLeaflet = (function () {
16203
16188
  }
16204
16189
  return target;
16205
16190
  };
16206
- var __publicField$G = (obj, key, value) => {
16207
- __defNormalProp$U(obj, typeof key !== "symbol" ? key + "" : key, value);
16208
- return value;
16209
- };
16191
+ var __publicField$G = (obj, key, value) => __defNormalProp$U(obj, typeof key !== "symbol" ? key + "" : key, value);
16210
16192
  class GeoJsonPaint {
16211
16193
  constructor(layer) {
16212
16194
  __publicField$G(this, "layer");
@@ -16355,10 +16337,7 @@ var NgwLeaflet = (function () {
16355
16337
  return a;
16356
16338
  };
16357
16339
  var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
16358
- var __publicField$F = (obj, key, value) => {
16359
- __defNormalProp$T(obj, typeof key !== "symbol" ? key + "" : key, value);
16360
- return value;
16361
- };
16340
+ var __publicField$F = (obj, key, value) => __defNormalProp$T(obj, typeof key !== "symbol" ? key + "" : key, value);
16362
16341
  var __async$l = (__this, __arguments, generator) => {
16363
16342
  return new Promise((resolve, reject) => {
16364
16343
  var fulfilled = (value) => {
@@ -16945,10 +16924,7 @@ var NgwLeaflet = (function () {
16945
16924
 
16946
16925
  var __defProp$S = Object.defineProperty;
16947
16926
  var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16948
- var __publicField$E = (obj, key, value) => {
16949
- __defNormalProp$S(obj, typeof key !== "symbol" ? key + "" : key, value);
16950
- return value;
16951
- };
16927
+ var __publicField$E = (obj, key, value) => __defNormalProp$S(obj, typeof key !== "symbol" ? key + "" : key, value);
16952
16928
  class Queue {
16953
16929
  /**
16954
16930
  * @param {PromiseQueueOptions} options - Configuration options for the queue.
@@ -17037,10 +17013,7 @@ var NgwLeaflet = (function () {
17037
17013
 
17038
17014
  var __defProp$R = Object.defineProperty;
17039
17015
  var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17040
- var __publicField$D = (obj, key, value) => {
17041
- __defNormalProp$R(obj, typeof key !== "symbol" ? key + "" : key, value);
17042
- return value;
17043
- };
17016
+ var __publicField$D = (obj, key, value) => __defNormalProp$R(obj, typeof key !== "symbol" ? key + "" : key, value);
17044
17017
  class ImageOverlay extends leafletSrcExports.ImageOverlay {
17045
17018
  constructor(imageUrl, bounds, options) {
17046
17019
  super(imageUrl, bounds, options);
@@ -17071,10 +17044,7 @@ var NgwLeaflet = (function () {
17071
17044
 
17072
17045
  var __defProp$Q = Object.defineProperty;
17073
17046
  var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17074
- var __publicField$C = (obj, key, value) => {
17075
- __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
17076
- return value;
17077
- };
17047
+ var __publicField$C = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
17078
17048
  class ImageLayer extends leafletSrcExports.Layer {
17079
17049
  constructor(url, options) {
17080
17050
  super(options);
@@ -17278,10 +17248,7 @@ var NgwLeaflet = (function () {
17278
17248
  }
17279
17249
  return a;
17280
17250
  };
17281
- var __publicField$B = (obj, key, value) => {
17282
- __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
17283
- return value;
17284
- };
17251
+ var __publicField$B = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
17285
17252
  class ImageAdapter extends BaseAdapter {
17286
17253
  constructor() {
17287
17254
  super(...arguments);
@@ -17559,10 +17526,7 @@ var NgwLeaflet = (function () {
17559
17526
  }
17560
17527
  return a;
17561
17528
  };
17562
- var __publicField$A = (obj, key, value) => {
17563
- __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
17564
- return value;
17565
- };
17529
+ var __publicField$A = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
17566
17530
  const _LeafletMapAdapter = class _LeafletMapAdapter {
17567
17531
  constructor() {
17568
17532
  __publicField$A(this, "options", { target: "map" });
@@ -17640,8 +17604,7 @@ var NgwLeaflet = (function () {
17640
17604
  }
17641
17605
  setView(lngLatOrOpt, zoom) {
17642
17606
  const map = this.map;
17643
- if (!map)
17644
- return;
17607
+ if (!map) return;
17645
17608
  if (Array.isArray(lngLatOrOpt)) {
17646
17609
  const lngLat = lngLatOrOpt;
17647
17610
  const [lng, lat] = lngLat;
@@ -17709,8 +17672,7 @@ var NgwLeaflet = (function () {
17709
17672
  return (_a = this.map && this.map.getZoom()) != null ? _a : void 0;
17710
17673
  }
17711
17674
  getBounds() {
17712
- if (!this.map)
17713
- return void 0;
17675
+ if (!this.map) return void 0;
17714
17676
  const b = this.map.getBounds();
17715
17677
  const sw = b.getSouthWest();
17716
17678
  const ne = b.getNorthEast();
@@ -17899,10 +17861,7 @@ var NgwLeaflet = (function () {
17899
17861
 
17900
17862
  var __defProp$K = Object.defineProperty;
17901
17863
  var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17902
- var __publicField$z = (obj, key, value) => {
17903
- __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
17904
- return value;
17905
- };
17864
+ var __publicField$z = (obj, key, value) => __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
17906
17865
  class CancelError extends Error {
17907
17866
  constructor() {
17908
17867
  super();
@@ -17913,10 +17872,7 @@ var NgwLeaflet = (function () {
17913
17872
 
17914
17873
  var __defProp$J = Object.defineProperty;
17915
17874
  var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17916
- var __publicField$y = (obj, key, value) => {
17917
- __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
17918
- return value;
17919
- };
17875
+ var __publicField$y = (obj, key, value) => __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
17920
17876
  class PromiseControl {
17921
17877
  constructor(options = {}) {
17922
17878
  this.options = options;
@@ -17998,10 +17954,7 @@ var NgwLeaflet = (function () {
17998
17954
 
17999
17955
  var __defProp$I = Object.defineProperty;
18000
17956
  var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18001
- var __publicField$x = (obj, key, value) => {
18002
- __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
18003
- return value;
18004
- };
17957
+ var __publicField$x = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
18005
17958
  class TimeoutError extends Error {
18006
17959
  constructor() {
18007
17960
  super();
@@ -18012,10 +17965,7 @@ var NgwLeaflet = (function () {
18012
17965
 
18013
17966
  var __defProp$H = Object.defineProperty;
18014
17967
  var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18015
- var __publicField$w = (obj, key, value) => {
18016
- __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
18017
- return value;
18018
- };
17968
+ var __publicField$w = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
18019
17969
  var _a;
18020
17970
  const handleCallback = (resolve, reject, callback, r) => {
18021
17971
  try {
@@ -18025,6 +17975,7 @@ var NgwLeaflet = (function () {
18025
17975
  }
18026
17976
  };
18027
17977
  let ID$3 = 0;
17978
+ _a = Symbol.toStringTag;
18028
17979
  const _CancelablePromise = class _CancelablePromise {
18029
17980
  constructor(executor, timeout) {
18030
17981
  // @ts-ignore
@@ -18204,7 +18155,6 @@ var NgwLeaflet = (function () {
18204
18155
  this._promise = void 0;
18205
18156
  }
18206
18157
  };
18207
- _a = Symbol.toStringTag;
18208
18158
  __publicField$w(_CancelablePromise, "CancelError", CancelError);
18209
18159
  __publicField$w(_CancelablePromise, "TimeoutError", TimeoutError);
18210
18160
  __publicField$w(_CancelablePromise, "PromiseControl", PromiseControl);
@@ -18285,10 +18235,7 @@ var NgwLeaflet = (function () {
18285
18235
 
18286
18236
  var __defProp$G = Object.defineProperty;
18287
18237
  var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18288
- var __publicField$v = (obj, key, value) => {
18289
- __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
18290
- return value;
18291
- };
18238
+ var __publicField$v = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
18292
18239
  const _Cache = class _Cache {
18293
18240
  constructor(options = {}) {
18294
18241
  __publicField$v(this, "cache", []);
@@ -18415,10 +18362,7 @@ var NgwLeaflet = (function () {
18415
18362
 
18416
18363
  var __defProp$F = Object.defineProperty;
18417
18364
  var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18418
- var __publicField$u = (obj, key, value) => {
18419
- __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18420
- return value;
18421
- };
18365
+ var __publicField$u = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18422
18366
  class NgwError extends Error {
18423
18367
  constructor(er) {
18424
18368
  super();
@@ -18437,10 +18381,7 @@ var NgwLeaflet = (function () {
18437
18381
 
18438
18382
  var __defProp$E = Object.defineProperty;
18439
18383
  var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18440
- var __publicField$t = (obj, key, value) => {
18441
- __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18442
- return value;
18443
- };
18384
+ var __publicField$t = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18444
18385
  class ResourceNotFoundError extends NgwError {
18445
18386
  constructor(obj) {
18446
18387
  super(obj);
@@ -18498,10 +18439,7 @@ var NgwLeaflet = (function () {
18498
18439
  return a;
18499
18440
  };
18500
18441
  var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
18501
- var __publicField$s = (obj, key, value) => {
18502
- __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18503
- return value;
18504
- };
18442
+ var __publicField$s = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18505
18443
  var __async$k = (__this, __arguments, generator) => {
18506
18444
  return new Promise((resolve, reject) => {
18507
18445
  var fulfilled = (value) => {
@@ -18523,9 +18461,14 @@ var NgwLeaflet = (function () {
18523
18461
  });
18524
18462
  };
18525
18463
  class ResourcesControl {
18526
- constructor(connector) {
18464
+ constructor({
18465
+ connector,
18466
+ cacheId
18467
+ }) {
18468
+ __publicField$s(this, "cache");
18469
+ __publicField$s(this, "connector");
18527
18470
  this.connector = connector;
18528
- __publicField$s(this, "cache", new Cache());
18471
+ this.cache = new Cache({ namespace: cacheId });
18529
18472
  }
18530
18473
  // -------------------------------------------------------------------------
18531
18474
  // Resource Methods
@@ -18538,7 +18481,7 @@ var NgwLeaflet = (function () {
18538
18481
  * Fetching resource would be cached to speed up next call
18539
18482
  */
18540
18483
  getOne(resource, requestOptions) {
18541
- const cache = new Cache();
18484
+ const cache = this.cache;
18542
18485
  const forCache = {};
18543
18486
  const opt = __spreadProps$e(__spreadValues$q({}, requestOptions), { cache: false });
18544
18487
  if (typeof resource === "string") {
@@ -18789,10 +18732,7 @@ var NgwLeaflet = (function () {
18789
18732
 
18790
18733
  var __defProp$C = Object.defineProperty;
18791
18734
  var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18792
- var __publicField$r = (obj, key, value) => {
18793
- __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
18794
- return value;
18795
- };
18735
+ var __publicField$r = (obj, key, value) => __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
18796
18736
  class InsufficientPermissionsError extends NgwError {
18797
18737
  constructor(obj) {
18798
18738
  super(obj);
@@ -18872,10 +18812,7 @@ var NgwLeaflet = (function () {
18872
18812
 
18873
18813
  var __defProp$B = Object.defineProperty;
18874
18814
  var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18875
- var __publicField$q = (obj, key, value) => {
18876
- __defNormalProp$B(obj, typeof key !== "symbol" ? key + "" : key, value);
18877
- return value;
18878
- };
18815
+ var __publicField$q = (obj, key, value) => __defNormalProp$B(obj, typeof key !== "symbol" ? key + "" : key, value);
18879
18816
  class NetworkError extends Error {
18880
18817
  constructor(url) {
18881
18818
  super();
@@ -18984,10 +18921,7 @@ var NgwLeaflet = (function () {
18984
18921
  }
18985
18922
  return a;
18986
18923
  };
18987
- var __publicField$p = (obj, key, value) => {
18988
- __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
18989
- return value;
18990
- };
18924
+ var __publicField$p = (obj, key, value) => __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
18991
18925
  let ID$2 = 0;
18992
18926
  class NgwConnector {
18993
18927
  constructor(options) {
@@ -18996,10 +18930,12 @@ var NgwLeaflet = (function () {
18996
18930
  __publicField$p(this, "emitter", new EventEmitter());
18997
18931
  __publicField$p(this, "user");
18998
18932
  __publicField$p(this, "resources");
18933
+ __publicField$p(this, "cache");
18999
18934
  __publicField$p(this, "routeStr", "/api/component/pyramid/route");
19000
18935
  __publicField$p(this, "activeRequests", []);
19001
18936
  __publicField$p(this, "requestTransform");
19002
18937
  const exist = findConnector(options);
18938
+ this.cache = new Cache({ namespace: options.cacheId });
19003
18939
  if (exist) {
19004
18940
  return exist;
19005
18941
  } else {
@@ -19009,13 +18945,23 @@ var NgwLeaflet = (function () {
19009
18945
  if (this.options.requestTransform) {
19010
18946
  this.requestTransform = this.options.requestTransform;
19011
18947
  }
19012
- this.resources = new ResourcesControl(this);
18948
+ this.resources = new ResourcesControl({
18949
+ connector: this,
18950
+ cacheId: options.cacheId
18951
+ });
19013
18952
  addConnector(this);
19014
18953
  }
19015
18954
  }
19016
18955
  static create(options) {
19017
18956
  return new this(options);
19018
18957
  }
18958
+ /**
18959
+ * Clear the cache.
18960
+ */
18961
+ clearCache() {
18962
+ this.cache.clean();
18963
+ this.resources.cache.clean();
18964
+ }
19019
18965
  setRequestTransform(requestTransform) {
19020
18966
  this.requestTransform = requestTransform;
19021
18967
  }
@@ -19043,7 +18989,6 @@ var NgwLeaflet = (function () {
19043
18989
  * ```
19044
18990
  */
19045
18991
  connect() {
19046
- const cache = new Cache();
19047
18992
  const auth = this.options.auth;
19048
18993
  const makeConnect = () => new CancelablePromise((resolve, reject) => {
19049
18994
  const makeQuery = () => {
@@ -19063,7 +19008,7 @@ var NgwLeaflet = (function () {
19063
19008
  }
19064
19009
  return makeQuery();
19065
19010
  });
19066
- return cache.add("route", makeConnect, {
19011
+ return this.cache.add("route", makeConnect, {
19067
19012
  id: this.id,
19068
19013
  auth,
19069
19014
  baseUrl: this.options.baseUrl
@@ -19086,8 +19031,8 @@ var NgwLeaflet = (function () {
19086
19031
  removeConnector(this);
19087
19032
  this.options.auth = void 0;
19088
19033
  this.user = void 0;
19034
+ this.clearCache();
19089
19035
  this.emitter.emit("logout");
19090
- this.resources.cache.clean();
19091
19036
  }
19092
19037
  getUserInfo(credentials, options) {
19093
19038
  if (this.user && this.user.id) {
@@ -19172,8 +19117,7 @@ var NgwLeaflet = (function () {
19172
19117
  const params = objectRemoveEmpty(params_);
19173
19118
  const makeApiRequest = () => apiRequest({ name, params, requestOptions, connector: this });
19174
19119
  if (requestOptions.cache && method === "GET") {
19175
- const cache = new Cache();
19176
- return cache.add(name, makeApiRequest, __spreadValues$p({
19120
+ return this.cache.add(name, makeApiRequest, __spreadValues$p({
19177
19121
  params
19178
19122
  }, objectRemoveEmpty({
19179
19123
  headers,
@@ -19689,10 +19633,7 @@ var NgwLeaflet = (function () {
19689
19633
 
19690
19634
  var __defProp$x = Object.defineProperty;
19691
19635
  var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19692
- var __publicField$o = (obj, key, value) => {
19693
- __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
19694
- return value;
19695
- };
19636
+ var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
19696
19637
  class BookmarkItem {
19697
19638
  constructor(options) {
19698
19639
  this.options = options;
@@ -19856,10 +19797,7 @@ var NgwLeaflet = (function () {
19856
19797
 
19857
19798
  var __defProp$w = Object.defineProperty;
19858
19799
  var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19859
- var __publicField$n = (obj, key, value) => {
19860
- __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
19861
- return value;
19862
- };
19800
+ var __publicField$n = (obj, key, value) => __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
19863
19801
  class TreeHelper {
19864
19802
  constructor(item) {
19865
19803
  __publicField$n(this, "item");
@@ -19929,10 +19867,7 @@ var NgwLeaflet = (function () {
19929
19867
 
19930
19868
  var __defProp$v = Object.defineProperty;
19931
19869
  var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19932
- var __publicField$m = (obj, key, value) => {
19933
- __defNormalProp$v(obj, typeof key !== "symbol" ? key + "" : key, value);
19934
- return value;
19935
- };
19870
+ var __publicField$m = (obj, key, value) => __defNormalProp$v(obj, typeof key !== "symbol" ? key + "" : key, value);
19936
19871
  class BaseProperty {
19937
19872
  constructor(name, item, options) {
19938
19873
  __publicField$m(this, "options");
@@ -20055,10 +19990,7 @@ var NgwLeaflet = (function () {
20055
19990
  }
20056
19991
  return a;
20057
19992
  };
20058
- var __publicField$l = (obj, key, value) => {
20059
- __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
20060
- return value;
20061
- };
19993
+ var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
20062
19994
  const _CheckProperty = class _CheckProperty extends BaseProperty {
20063
19995
  constructor(name, item, options) {
20064
19996
  super(name, item, __spreadValues$m(__spreadValues$m({}, _CheckProperty.options), options));
@@ -20191,10 +20123,7 @@ var NgwLeaflet = (function () {
20191
20123
  }
20192
20124
  return a;
20193
20125
  };
20194
- var __publicField$k = (obj, key, value) => {
20195
- __defNormalProp$t(obj, typeof key !== "symbol" ? key + "" : key, value);
20196
- return value;
20197
- };
20126
+ var __publicField$k = (obj, key, value) => __defNormalProp$t(obj, typeof key !== "symbol" ? key + "" : key, value);
20198
20127
  const BOOLEAN_TYPE = "boolean";
20199
20128
  const STRING_TYPE = "string";
20200
20129
  const _ItemProperties = class _ItemProperties {
@@ -20286,10 +20215,7 @@ var NgwLeaflet = (function () {
20286
20215
  }
20287
20216
  return a;
20288
20217
  };
20289
- var __publicField$j = (obj, key, value) => {
20290
- __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
20291
- return value;
20292
- };
20218
+ var __publicField$j = (obj, key, value) => __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
20293
20219
  let ID$1 = 0;
20294
20220
  class Item {
20295
20221
  constructor(options) {
@@ -20448,10 +20374,7 @@ var NgwLeaflet = (function () {
20448
20374
 
20449
20375
  var __defProp$q = Object.defineProperty;
20450
20376
  var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20451
- var __publicField$i = (obj, key, value) => {
20452
- __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
20453
- return value;
20454
- };
20377
+ var __publicField$i = (obj, key, value) => __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
20455
20378
  var __async$j = (__this, __arguments, generator) => {
20456
20379
  return new Promise((resolve, reject) => {
20457
20380
  var fulfilled = (value) => {
@@ -20623,10 +20546,7 @@ var NgwLeaflet = (function () {
20623
20546
  }
20624
20547
  return target;
20625
20548
  };
20626
- var __publicField$h = (obj, key, value) => {
20627
- __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
20628
- return value;
20629
- };
20549
+ var __publicField$h = (obj, key, value) => __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
20630
20550
  var __async$h = (__this, __arguments, generator) => {
20631
20551
  return new Promise((resolve, reject) => {
20632
20552
  var fulfilled = (value) => {
@@ -20739,10 +20659,7 @@ var NgwLeaflet = (function () {
20739
20659
  }
20740
20660
  return a;
20741
20661
  };
20742
- var __publicField$g = (obj, key, value) => {
20743
- __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
20744
- return value;
20745
- };
20662
+ var __publicField$g = (obj, key, value) => __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
20746
20663
  class QmsKit {
20747
20664
  constructor(options) {
20748
20665
  __publicField$g(this, "options", {
@@ -21028,10 +20945,7 @@ var NgwLeaflet = (function () {
21028
20945
  return a;
21029
20946
  };
21030
20947
  var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
21031
- var __publicField$f = (obj, key, value) => {
21032
- __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
21033
- return value;
21034
- };
20948
+ var __publicField$f = (obj, key, value) => __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
21035
20949
  var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
21036
20950
  var __async$f = (__this, __arguments, generator) => {
21037
20951
  return new Promise((resolve, reject) => {
@@ -21464,10 +21378,7 @@ var NgwLeaflet = (function () {
21464
21378
  return a;
21465
21379
  };
21466
21380
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
21467
- var __publicField$e = (obj, key, value) => {
21468
- __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
21469
- return value;
21470
- };
21381
+ var __publicField$e = (obj, key, value) => __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
21471
21382
  var __async$d = (__this, __arguments, generator) => {
21472
21383
  return new Promise((resolve, reject) => {
21473
21384
  var fulfilled = (value) => {
@@ -21857,10 +21768,7 @@ var NgwLeaflet = (function () {
21857
21768
  }
21858
21769
  return a;
21859
21770
  };
21860
- var __publicField$d = (obj, key, value) => {
21861
- __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
21862
- return value;
21863
- };
21771
+ var __publicField$d = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
21864
21772
  var __async$b = (__this, __arguments, generator) => {
21865
21773
  return new Promise((resolve, reject) => {
21866
21774
  var fulfilled = (value) => {
@@ -22138,10 +22046,7 @@ var NgwLeaflet = (function () {
22138
22046
  }
22139
22047
  return a;
22140
22048
  };
22141
- var __publicField$c = (obj, key, value) => {
22142
- __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
22143
- return value;
22144
- };
22049
+ var __publicField$c = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
22145
22050
  var __async$a = (__this, __arguments, generator) => {
22146
22051
  return new Promise((resolve, reject) => {
22147
22052
  var fulfilled = (value) => {
@@ -22318,10 +22223,7 @@ var NgwLeaflet = (function () {
22318
22223
  }
22319
22224
  return a;
22320
22225
  };
22321
- var __publicField$b = (obj, key, value) => {
22322
- __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
22323
- return value;
22324
- };
22226
+ var __publicField$b = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
22325
22227
  var __async$8 = (__this, __arguments, generator) => {
22326
22228
  return new Promise((resolve, reject) => {
22327
22229
  var fulfilled = (value) => {
@@ -22387,8 +22289,7 @@ var NgwLeaflet = (function () {
22387
22289
  removeLayer() {
22388
22290
  const mapAdapter = this.options.webMap.mapAdapter;
22389
22291
  this.getDependLayers().forEach((x) => {
22390
- if (!("layer" in x))
22391
- return;
22292
+ if (!("layer" in x)) return;
22392
22293
  mapAdapter.removeLayer(x.layer.layer);
22393
22294
  });
22394
22295
  if (this._webmapBaselayersIds.length) {
@@ -22689,10 +22590,7 @@ var NgwLeaflet = (function () {
22689
22590
  }
22690
22591
  return a;
22691
22592
  };
22692
- var __publicField$a = (obj, key, value) => {
22693
- __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
22694
- return value;
22695
- };
22593
+ var __publicField$a = (obj, key, value) => __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
22696
22594
  var __async$7 = (__this, __arguments, generator) => {
22697
22595
  return new Promise((resolve, reject) => {
22698
22596
  var fulfilled = (value) => {
@@ -22795,10 +22693,7 @@ var NgwLeaflet = (function () {
22795
22693
  }
22796
22694
  return a;
22797
22695
  };
22798
- var __publicField$9 = (obj, key, value) => {
22799
- __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
22800
- return value;
22801
- };
22696
+ var __publicField$9 = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
22802
22697
  class IdentifyItem {
22803
22698
  constructor(options) {
22804
22699
  __publicField$9(this, "id");
@@ -23001,8 +22896,7 @@ var NgwLeaflet = (function () {
23001
22896
  }
23002
22897
  function convertGeomToWKT(geom) {
23003
22898
  const coordinates = getPolygonCoordinates(geom);
23004
- if (!coordinates)
23005
- return null;
22899
+ if (!coordinates) return null;
23006
22900
  const polygonStr = coordinates.map(([lng, lat]) => {
23007
22901
  const [x, y] = degrees2meters(lng, lat);
23008
22902
  return `${x} ${y}`;
@@ -23098,10 +22992,7 @@ var NgwLeaflet = (function () {
23098
22992
 
23099
22993
  var __defProp$b = Object.defineProperty;
23100
22994
  var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23101
- var __publicField$8 = (obj, key, value) => {
23102
- __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
23103
- return value;
23104
- };
22995
+ var __publicField$8 = (obj, key, value) => __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
23105
22996
  class KeyCodes {
23106
22997
  constructor() {
23107
22998
  __publicField$8(this, "backspace", 8);
@@ -23180,10 +23071,7 @@ var NgwLeaflet = (function () {
23180
23071
 
23181
23072
  var __defProp$a = Object.defineProperty;
23182
23073
  var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23183
- var __publicField$7 = (obj, key, value) => {
23184
- __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
23185
- return value;
23186
- };
23074
+ var __publicField$7 = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
23187
23075
  class Keys {
23188
23076
  constructor() {
23189
23077
  __publicField$7(this, "keyCodeAlias", new KeyCodes());
@@ -23231,10 +23119,7 @@ var NgwLeaflet = (function () {
23231
23119
 
23232
23120
  var __defProp$9 = Object.defineProperty;
23233
23121
  var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23234
- var __publicField$6 = (obj, key, value) => {
23235
- __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
23236
- return value;
23237
- };
23122
+ var __publicField$6 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
23238
23123
  class StateItem {
23239
23124
  constructor(webMap, opt) {
23240
23125
  this.webMap = webMap;
@@ -23263,10 +23148,7 @@ var NgwLeaflet = (function () {
23263
23148
 
23264
23149
  var __defProp$8 = Object.defineProperty;
23265
23150
  var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23266
- var __publicField$5 = (obj, key, value) => {
23267
- __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
23268
- return value;
23269
- };
23151
+ var __publicField$5 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
23270
23152
  class CenterState extends StateItem {
23271
23153
  constructor() {
23272
23154
  super(...arguments);
@@ -23291,10 +23173,7 @@ var NgwLeaflet = (function () {
23291
23173
 
23292
23174
  var __defProp$7 = Object.defineProperty;
23293
23175
  var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23294
- var __publicField$4 = (obj, key, value) => {
23295
- __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
23296
- return value;
23297
- };
23176
+ var __publicField$4 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
23298
23177
  class ZoomState extends StateItem {
23299
23178
  constructor() {
23300
23179
  super(...arguments);
@@ -23324,10 +23203,7 @@ var NgwLeaflet = (function () {
23324
23203
 
23325
23204
  var __defProp$6 = Object.defineProperty;
23326
23205
  var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23327
- var __publicField$3 = (obj, key, value) => {
23328
- __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
23329
- return value;
23330
- };
23206
+ var __publicField$3 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
23331
23207
  var __async$5 = (__this, __arguments, generator) => {
23332
23208
  return new Promise((resolve, reject) => {
23333
23209
  var fulfilled = (value) => {
@@ -23944,10 +23820,7 @@ var NgwLeaflet = (function () {
23944
23820
  return a;
23945
23821
  };
23946
23822
  var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
23947
- var __publicField$2 = (obj, key, value) => {
23948
- __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
23949
- return value;
23950
- };
23823
+ var __publicField$2 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
23951
23824
  var __async$4 = (__this, __arguments, generator) => {
23952
23825
  return new Promise((resolve, reject) => {
23953
23826
  var fulfilled = (value) => {
@@ -24893,10 +24766,7 @@ var NgwLeaflet = (function () {
24893
24766
 
24894
24767
  var __defProp$4 = Object.defineProperty;
24895
24768
  var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
24896
- var __publicField$1 = (obj, key, value) => {
24897
- __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
24898
- return value;
24899
- };
24769
+ var __publicField$1 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
24900
24770
  var __async$3 = (__this, __arguments, generator) => {
24901
24771
  return new Promise((resolve, reject) => {
24902
24772
  var fulfilled = (value) => {
@@ -25095,9 +24965,7 @@ var NgwLeaflet = (function () {
25095
24965
  var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
25096
24966
  var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
25097
24967
  var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
25098
- var __knownSymbol = (name, symbol) => {
25099
- return (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
25100
- };
24968
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
25101
24969
  var __objRest = (source, exclude) => {
25102
24970
  var target = {};
25103
24971
  for (var prop in source)
@@ -25363,10 +25231,7 @@ var NgwLeaflet = (function () {
25363
25231
  return a;
25364
25232
  };
25365
25233
  var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
25366
- var __publicField = (obj, key, value) => {
25367
- __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
25368
- return value;
25369
- };
25234
+ var __publicField = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
25370
25235
  var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
25371
25236
  var __async$1 = (__this, __arguments, generator) => {
25372
25237
  return new Promise((resolve, reject) => {
@@ -25773,10 +25638,32 @@ var NgwLeaflet = (function () {
25773
25638
  return;
25774
25639
  }
25775
25640
  const radius = getIdentifyRadius(center, zoom, pixelRadius);
25641
+ let geom;
25642
+ if (this.options.highlightIdentification) {
25643
+ const highlightOptions = this.options.highlightIdentification;
25644
+ const highlightDuration = typeof highlightOptions === "number" ? highlightOptions : 1e3;
25645
+ const [lng, lat] = ev.lngLat;
25646
+ geom = {
25647
+ type: "Polygon",
25648
+ coordinates: [getCirclePolygonCoordinates(lng, lat, radius)]
25649
+ };
25650
+ const highlightIdentificationLayer = yield this.addGeoJsonLayer({
25651
+ data: {
25652
+ type: "Feature",
25653
+ geometry: geom
25654
+ }
25655
+ });
25656
+ if (highlightDuration !== Infinity) {
25657
+ setTimeout(() => {
25658
+ this.removeLayer(highlightIdentificationLayer);
25659
+ }, highlightDuration);
25660
+ }
25661
+ }
25776
25662
  const selectPromise = sendIdentifyRequest(ev, {
25777
25663
  layers: ids,
25778
25664
  connector: this.connector,
25779
- radius
25665
+ radius,
25666
+ geom
25780
25667
  }).then((resp) => {
25781
25668
  const identify = __spreadProps$1(__spreadValues$1({}, resp), {
25782
25669
  resources: ids,