@nextgis/ngw-leaflet 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-leaflet; version: 2.2.3; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 2.4.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") {
@@ -18567,7 +18510,10 @@ var NgwLeaflet = (function () {
18567
18510
  }
18568
18511
  return CancelablePromise.resolve(void 0);
18569
18512
  };
18570
- return cache.addFull("resource", makeRequest, forCache);
18513
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
18514
+ return cache.addFull("resource", makeRequest, forCache);
18515
+ }
18516
+ return makeRequest();
18571
18517
  }
18572
18518
  getOneOrFail(resource, requestOptions) {
18573
18519
  return this.getOne(resource, requestOptions).then((res) => {
@@ -18728,14 +18674,17 @@ var NgwLeaflet = (function () {
18728
18674
  }
18729
18675
  _fetchResourceById(id, requestOptions) {
18730
18676
  const promise = () => this.connector.get("resource.item", requestOptions, { id });
18731
- return this.cache.add("resource.item", promise, {
18732
- id
18733
- }).catch((er) => {
18734
- if (!(er instanceof ResourceNotFoundError)) {
18735
- throw er;
18736
- }
18737
- return void 0;
18738
- });
18677
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
18678
+ return this.cache.add("resource.item", promise, {
18679
+ id
18680
+ }).catch((er) => {
18681
+ if (!(er instanceof ResourceNotFoundError)) {
18682
+ throw er;
18683
+ }
18684
+ return void 0;
18685
+ });
18686
+ }
18687
+ return promise();
18739
18688
  }
18740
18689
  _fetchResourceBy(resource, requestOptions) {
18741
18690
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -18789,10 +18738,7 @@ var NgwLeaflet = (function () {
18789
18738
 
18790
18739
  var __defProp$C = Object.defineProperty;
18791
18740
  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
- };
18741
+ var __publicField$r = (obj, key, value) => __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
18796
18742
  class InsufficientPermissionsError extends NgwError {
18797
18743
  constructor(obj) {
18798
18744
  super(obj);
@@ -18818,7 +18764,7 @@ var NgwLeaflet = (function () {
18818
18764
  function apiRequest(opt) {
18819
18765
  const params = opt.params;
18820
18766
  return new CancelablePromise((resolve, reject) => {
18821
- opt.connector.connect().then((apiItems) => {
18767
+ return opt.connector.connect().then((apiItems) => {
18822
18768
  let apiItem = apiItems && apiItems[opt.name];
18823
18769
  if (apiItem) {
18824
18770
  apiItem = [...apiItem];
@@ -18872,10 +18818,7 @@ var NgwLeaflet = (function () {
18872
18818
 
18873
18819
  var __defProp$B = Object.defineProperty;
18874
18820
  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
- };
18821
+ var __publicField$q = (obj, key, value) => __defNormalProp$B(obj, typeof key !== "symbol" ? key + "" : key, value);
18879
18822
  class NetworkError extends Error {
18880
18823
  constructor(url) {
18881
18824
  super();
@@ -18984,10 +18927,7 @@ var NgwLeaflet = (function () {
18984
18927
  }
18985
18928
  return a;
18986
18929
  };
18987
- var __publicField$p = (obj, key, value) => {
18988
- __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
18989
- return value;
18990
- };
18930
+ var __publicField$p = (obj, key, value) => __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
18991
18931
  let ID$2 = 0;
18992
18932
  class NgwConnector {
18993
18933
  constructor(options) {
@@ -18996,10 +18936,12 @@ var NgwLeaflet = (function () {
18996
18936
  __publicField$p(this, "emitter", new EventEmitter());
18997
18937
  __publicField$p(this, "user");
18998
18938
  __publicField$p(this, "resources");
18939
+ __publicField$p(this, "cache");
18999
18940
  __publicField$p(this, "routeStr", "/api/component/pyramid/route");
19000
18941
  __publicField$p(this, "activeRequests", []);
19001
18942
  __publicField$p(this, "requestTransform");
19002
18943
  const exist = findConnector(options);
18944
+ this.cache = new Cache({ namespace: options.cacheId });
19003
18945
  if (exist) {
19004
18946
  return exist;
19005
18947
  } else {
@@ -19009,13 +18951,23 @@ var NgwLeaflet = (function () {
19009
18951
  if (this.options.requestTransform) {
19010
18952
  this.requestTransform = this.options.requestTransform;
19011
18953
  }
19012
- this.resources = new ResourcesControl(this);
18954
+ this.resources = new ResourcesControl({
18955
+ connector: this,
18956
+ cacheId: options.cacheId
18957
+ });
19013
18958
  addConnector(this);
19014
18959
  }
19015
18960
  }
19016
18961
  static create(options) {
19017
18962
  return new this(options);
19018
18963
  }
18964
+ /**
18965
+ * Clear the cache.
18966
+ */
18967
+ clearCache() {
18968
+ this.cache.clean();
18969
+ this.resources.cache.clean();
18970
+ }
19019
18971
  setRequestTransform(requestTransform) {
19020
18972
  this.requestTransform = requestTransform;
19021
18973
  }
@@ -19043,7 +18995,6 @@ var NgwLeaflet = (function () {
19043
18995
  * ```
19044
18996
  */
19045
18997
  connect() {
19046
- const cache = new Cache();
19047
18998
  const auth = this.options.auth;
19048
18999
  const makeConnect = () => new CancelablePromise((resolve, reject) => {
19049
19000
  const makeQuery = () => {
@@ -19063,7 +19014,7 @@ var NgwLeaflet = (function () {
19063
19014
  }
19064
19015
  return makeQuery();
19065
19016
  });
19066
- return cache.add("route", makeConnect, {
19017
+ return this.cache.add("route", makeConnect, {
19067
19018
  id: this.id,
19068
19019
  auth,
19069
19020
  baseUrl: this.options.baseUrl
@@ -19086,8 +19037,8 @@ var NgwLeaflet = (function () {
19086
19037
  removeConnector(this);
19087
19038
  this.options.auth = void 0;
19088
19039
  this.user = void 0;
19040
+ this.clearCache();
19089
19041
  this.emitter.emit("logout");
19090
- this.resources.cache.clean();
19091
19042
  }
19092
19043
  getUserInfo(credentials, options) {
19093
19044
  if (this.user && this.user.id) {
@@ -19172,8 +19123,7 @@ var NgwLeaflet = (function () {
19172
19123
  const params = objectRemoveEmpty(params_);
19173
19124
  const makeApiRequest = () => apiRequest({ name, params, requestOptions, connector: this });
19174
19125
  if (requestOptions.cache && method === "GET") {
19175
- const cache = new Cache();
19176
- return cache.add(name, makeApiRequest, __spreadValues$p({
19126
+ return this.cache.add(name, makeApiRequest, __spreadValues$p({
19177
19127
  params
19178
19128
  }, objectRemoveEmpty({
19179
19129
  headers,
@@ -19689,10 +19639,7 @@ var NgwLeaflet = (function () {
19689
19639
 
19690
19640
  var __defProp$x = Object.defineProperty;
19691
19641
  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
- };
19642
+ var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
19696
19643
  class BookmarkItem {
19697
19644
  constructor(options) {
19698
19645
  this.options = options;
@@ -19856,10 +19803,7 @@ var NgwLeaflet = (function () {
19856
19803
 
19857
19804
  var __defProp$w = Object.defineProperty;
19858
19805
  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
- };
19806
+ var __publicField$n = (obj, key, value) => __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
19863
19807
  class TreeHelper {
19864
19808
  constructor(item) {
19865
19809
  __publicField$n(this, "item");
@@ -19929,10 +19873,7 @@ var NgwLeaflet = (function () {
19929
19873
 
19930
19874
  var __defProp$v = Object.defineProperty;
19931
19875
  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
- };
19876
+ var __publicField$m = (obj, key, value) => __defNormalProp$v(obj, typeof key !== "symbol" ? key + "" : key, value);
19936
19877
  class BaseProperty {
19937
19878
  constructor(name, item, options) {
19938
19879
  __publicField$m(this, "options");
@@ -20055,10 +19996,7 @@ var NgwLeaflet = (function () {
20055
19996
  }
20056
19997
  return a;
20057
19998
  };
20058
- var __publicField$l = (obj, key, value) => {
20059
- __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
20060
- return value;
20061
- };
19999
+ var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
20062
20000
  const _CheckProperty = class _CheckProperty extends BaseProperty {
20063
20001
  constructor(name, item, options) {
20064
20002
  super(name, item, __spreadValues$m(__spreadValues$m({}, _CheckProperty.options), options));
@@ -20191,10 +20129,7 @@ var NgwLeaflet = (function () {
20191
20129
  }
20192
20130
  return a;
20193
20131
  };
20194
- var __publicField$k = (obj, key, value) => {
20195
- __defNormalProp$t(obj, typeof key !== "symbol" ? key + "" : key, value);
20196
- return value;
20197
- };
20132
+ var __publicField$k = (obj, key, value) => __defNormalProp$t(obj, typeof key !== "symbol" ? key + "" : key, value);
20198
20133
  const BOOLEAN_TYPE = "boolean";
20199
20134
  const STRING_TYPE = "string";
20200
20135
  const _ItemProperties = class _ItemProperties {
@@ -20286,10 +20221,7 @@ var NgwLeaflet = (function () {
20286
20221
  }
20287
20222
  return a;
20288
20223
  };
20289
- var __publicField$j = (obj, key, value) => {
20290
- __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
20291
- return value;
20292
- };
20224
+ var __publicField$j = (obj, key, value) => __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
20293
20225
  let ID$1 = 0;
20294
20226
  class Item {
20295
20227
  constructor(options) {
@@ -20448,10 +20380,7 @@ var NgwLeaflet = (function () {
20448
20380
 
20449
20381
  var __defProp$q = Object.defineProperty;
20450
20382
  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
- };
20383
+ var __publicField$i = (obj, key, value) => __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
20455
20384
  var __async$j = (__this, __arguments, generator) => {
20456
20385
  return new Promise((resolve, reject) => {
20457
20386
  var fulfilled = (value) => {
@@ -20623,10 +20552,7 @@ var NgwLeaflet = (function () {
20623
20552
  }
20624
20553
  return target;
20625
20554
  };
20626
- var __publicField$h = (obj, key, value) => {
20627
- __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
20628
- return value;
20629
- };
20555
+ var __publicField$h = (obj, key, value) => __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
20630
20556
  var __async$h = (__this, __arguments, generator) => {
20631
20557
  return new Promise((resolve, reject) => {
20632
20558
  var fulfilled = (value) => {
@@ -20739,10 +20665,7 @@ var NgwLeaflet = (function () {
20739
20665
  }
20740
20666
  return a;
20741
20667
  };
20742
- var __publicField$g = (obj, key, value) => {
20743
- __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
20744
- return value;
20745
- };
20668
+ var __publicField$g = (obj, key, value) => __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
20746
20669
  class QmsKit {
20747
20670
  constructor(options) {
20748
20671
  __publicField$g(this, "options", {
@@ -21028,10 +20951,7 @@ var NgwLeaflet = (function () {
21028
20951
  return a;
21029
20952
  };
21030
20953
  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
- };
20954
+ var __publicField$f = (obj, key, value) => __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
21035
20955
  var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
21036
20956
  var __async$f = (__this, __arguments, generator) => {
21037
20957
  return new Promise((resolve, reject) => {
@@ -21464,10 +21384,7 @@ var NgwLeaflet = (function () {
21464
21384
  return a;
21465
21385
  };
21466
21386
  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
- };
21387
+ var __publicField$e = (obj, key, value) => __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
21471
21388
  var __async$d = (__this, __arguments, generator) => {
21472
21389
  return new Promise((resolve, reject) => {
21473
21390
  var fulfilled = (value) => {
@@ -21857,10 +21774,7 @@ var NgwLeaflet = (function () {
21857
21774
  }
21858
21775
  return a;
21859
21776
  };
21860
- var __publicField$d = (obj, key, value) => {
21861
- __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
21862
- return value;
21863
- };
21777
+ var __publicField$d = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
21864
21778
  var __async$b = (__this, __arguments, generator) => {
21865
21779
  return new Promise((resolve, reject) => {
21866
21780
  var fulfilled = (value) => {
@@ -22138,10 +22052,7 @@ var NgwLeaflet = (function () {
22138
22052
  }
22139
22053
  return a;
22140
22054
  };
22141
- var __publicField$c = (obj, key, value) => {
22142
- __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
22143
- return value;
22144
- };
22055
+ var __publicField$c = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
22145
22056
  var __async$a = (__this, __arguments, generator) => {
22146
22057
  return new Promise((resolve, reject) => {
22147
22058
  var fulfilled = (value) => {
@@ -22318,10 +22229,7 @@ var NgwLeaflet = (function () {
22318
22229
  }
22319
22230
  return a;
22320
22231
  };
22321
- var __publicField$b = (obj, key, value) => {
22322
- __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
22323
- return value;
22324
- };
22232
+ var __publicField$b = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
22325
22233
  var __async$8 = (__this, __arguments, generator) => {
22326
22234
  return new Promise((resolve, reject) => {
22327
22235
  var fulfilled = (value) => {
@@ -22387,8 +22295,7 @@ var NgwLeaflet = (function () {
22387
22295
  removeLayer() {
22388
22296
  const mapAdapter = this.options.webMap.mapAdapter;
22389
22297
  this.getDependLayers().forEach((x) => {
22390
- if (!("layer" in x))
22391
- return;
22298
+ if (!("layer" in x)) return;
22392
22299
  mapAdapter.removeLayer(x.layer.layer);
22393
22300
  });
22394
22301
  if (this._webmapBaselayersIds.length) {
@@ -22689,10 +22596,7 @@ var NgwLeaflet = (function () {
22689
22596
  }
22690
22597
  return a;
22691
22598
  };
22692
- var __publicField$a = (obj, key, value) => {
22693
- __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
22694
- return value;
22695
- };
22599
+ var __publicField$a = (obj, key, value) => __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
22696
22600
  var __async$7 = (__this, __arguments, generator) => {
22697
22601
  return new Promise((resolve, reject) => {
22698
22602
  var fulfilled = (value) => {
@@ -22795,10 +22699,7 @@ var NgwLeaflet = (function () {
22795
22699
  }
22796
22700
  return a;
22797
22701
  };
22798
- var __publicField$9 = (obj, key, value) => {
22799
- __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
22800
- return value;
22801
- };
22702
+ var __publicField$9 = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
22802
22703
  class IdentifyItem {
22803
22704
  constructor(options) {
22804
22705
  __publicField$9(this, "id");
@@ -23001,8 +22902,7 @@ var NgwLeaflet = (function () {
23001
22902
  }
23002
22903
  function convertGeomToWKT(geom) {
23003
22904
  const coordinates = getPolygonCoordinates(geom);
23004
- if (!coordinates)
23005
- return null;
22905
+ if (!coordinates) return null;
23006
22906
  const polygonStr = coordinates.map(([lng, lat]) => {
23007
22907
  const [x, y] = degrees2meters(lng, lat);
23008
22908
  return `${x} ${y}`;
@@ -23098,10 +22998,7 @@ var NgwLeaflet = (function () {
23098
22998
 
23099
22999
  var __defProp$b = Object.defineProperty;
23100
23000
  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
- };
23001
+ var __publicField$8 = (obj, key, value) => __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
23105
23002
  class KeyCodes {
23106
23003
  constructor() {
23107
23004
  __publicField$8(this, "backspace", 8);
@@ -23180,10 +23077,7 @@ var NgwLeaflet = (function () {
23180
23077
 
23181
23078
  var __defProp$a = Object.defineProperty;
23182
23079
  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
- };
23080
+ var __publicField$7 = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
23187
23081
  class Keys {
23188
23082
  constructor() {
23189
23083
  __publicField$7(this, "keyCodeAlias", new KeyCodes());
@@ -23231,10 +23125,7 @@ var NgwLeaflet = (function () {
23231
23125
 
23232
23126
  var __defProp$9 = Object.defineProperty;
23233
23127
  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
- };
23128
+ var __publicField$6 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
23238
23129
  class StateItem {
23239
23130
  constructor(webMap, opt) {
23240
23131
  this.webMap = webMap;
@@ -23263,10 +23154,7 @@ var NgwLeaflet = (function () {
23263
23154
 
23264
23155
  var __defProp$8 = Object.defineProperty;
23265
23156
  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
- };
23157
+ var __publicField$5 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
23270
23158
  class CenterState extends StateItem {
23271
23159
  constructor() {
23272
23160
  super(...arguments);
@@ -23291,10 +23179,7 @@ var NgwLeaflet = (function () {
23291
23179
 
23292
23180
  var __defProp$7 = Object.defineProperty;
23293
23181
  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
- };
23182
+ var __publicField$4 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
23298
23183
  class ZoomState extends StateItem {
23299
23184
  constructor() {
23300
23185
  super(...arguments);
@@ -23324,10 +23209,7 @@ var NgwLeaflet = (function () {
23324
23209
 
23325
23210
  var __defProp$6 = Object.defineProperty;
23326
23211
  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
- };
23212
+ var __publicField$3 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
23331
23213
  var __async$5 = (__this, __arguments, generator) => {
23332
23214
  return new Promise((resolve, reject) => {
23333
23215
  var fulfilled = (value) => {
@@ -23944,10 +23826,7 @@ var NgwLeaflet = (function () {
23944
23826
  return a;
23945
23827
  };
23946
23828
  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
- };
23829
+ var __publicField$2 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
23951
23830
  var __async$4 = (__this, __arguments, generator) => {
23952
23831
  return new Promise((resolve, reject) => {
23953
23832
  var fulfilled = (value) => {
@@ -24893,10 +24772,7 @@ var NgwLeaflet = (function () {
24893
24772
 
24894
24773
  var __defProp$4 = Object.defineProperty;
24895
24774
  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
- };
24775
+ var __publicField$1 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
24900
24776
  var __async$3 = (__this, __arguments, generator) => {
24901
24777
  return new Promise((resolve, reject) => {
24902
24778
  var fulfilled = (value) => {
@@ -25095,9 +24971,7 @@ var NgwLeaflet = (function () {
25095
24971
  var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
25096
24972
  var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
25097
24973
  var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
25098
- var __knownSymbol = (name, symbol) => {
25099
- return (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
25100
- };
24974
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
25101
24975
  var __objRest = (source, exclude) => {
25102
24976
  var target = {};
25103
24977
  for (var prop in source)
@@ -25363,10 +25237,7 @@ var NgwLeaflet = (function () {
25363
25237
  return a;
25364
25238
  };
25365
25239
  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
- };
25240
+ var __publicField = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
25370
25241
  var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
25371
25242
  var __async$1 = (__this, __arguments, generator) => {
25372
25243
  return new Promise((resolve, reject) => {
@@ -25773,10 +25644,32 @@ var NgwLeaflet = (function () {
25773
25644
  return;
25774
25645
  }
25775
25646
  const radius = getIdentifyRadius(center, zoom, pixelRadius);
25647
+ let geom;
25648
+ if (this.options.highlightIdentification) {
25649
+ const highlightOptions = this.options.highlightIdentification;
25650
+ const highlightDuration = typeof highlightOptions === "number" ? highlightOptions : 1e3;
25651
+ const [lng, lat] = ev.lngLat;
25652
+ geom = {
25653
+ type: "Polygon",
25654
+ coordinates: [getCirclePolygonCoordinates(lng, lat, radius)]
25655
+ };
25656
+ const highlightIdentificationLayer = yield this.addGeoJsonLayer({
25657
+ data: {
25658
+ type: "Feature",
25659
+ geometry: geom
25660
+ }
25661
+ });
25662
+ if (highlightDuration !== Infinity) {
25663
+ setTimeout(() => {
25664
+ this.removeLayer(highlightIdentificationLayer);
25665
+ }, highlightDuration);
25666
+ }
25667
+ }
25776
25668
  const selectPromise = sendIdentifyRequest(ev, {
25777
25669
  layers: ids,
25778
25670
  connector: this.connector,
25779
- radius
25671
+ radius,
25672
+ geom
25780
25673
  }).then((resp) => {
25781
25674
  const identify = __spreadProps$1(__spreadValues$1({}, resp), {
25782
25675
  resources: ids,