@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
  function styleInject(css, ref) {
3
3
  if ( ref === void 0 ) ref = {};
4
4
  var insertAt = ref.insertAt;
@@ -14885,19 +14885,15 @@ function checkExtent(extent) {
14885
14885
 
14886
14886
  function isEqual(a, b, o, p) {
14887
14887
  if (a instanceof Array) {
14888
- if (!(b instanceof Array))
14889
- return false;
14888
+ if (!(b instanceof Array)) return false;
14890
14889
  return b.sort().join("") === a.sort().join("");
14891
14890
  } else if (a instanceof Date) {
14892
- if (!(b instanceof Date))
14893
- return false;
14891
+ if (!(b instanceof Date)) return false;
14894
14892
  return "" + a === "" + b;
14895
14893
  } else if (a instanceof Function) {
14896
- if (!(b instanceof Function))
14897
- return false;
14894
+ if (!(b instanceof Function)) return false;
14898
14895
  } else if (a instanceof Object) {
14899
- if (!(b instanceof Object))
14900
- return false;
14896
+ if (!(b instanceof Object)) return false;
14901
14897
  if (a === o) {
14902
14898
  return b === p;
14903
14899
  } else {
@@ -14909,10 +14905,8 @@ function isEqual(a, b, o, p) {
14909
14905
  function objectDeepEqual(o, p) {
14910
14906
  const keysO = Object.keys(o).sort();
14911
14907
  const keysP = Object.keys(p).sort();
14912
- if (keysO.length !== keysP.length)
14913
- return false;
14914
- if (keysO.join("") !== keysP.join(""))
14915
- return false;
14908
+ if (keysO.length !== keysP.length) return false;
14909
+ if (keysO.join("") !== keysP.join("")) return false;
14916
14910
  for (let i = 0; i < keysO.length; i++) {
14917
14911
  const oVal = o[keysO[i]];
14918
14912
  const pVal = p[keysP[i]];
@@ -15056,10 +15050,7 @@ function createFeaturePositionOptions(features) {
15056
15050
 
15057
15051
  var __defProp$$ = Object.defineProperty;
15058
15052
  var __defNormalProp$$ = (obj, key, value) => key in obj ? __defProp$$(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15059
- var __publicField$I = (obj, key, value) => {
15060
- __defNormalProp$$(obj, typeof key !== "symbol" ? key + "" : key, value);
15061
- return value;
15062
- };
15053
+ var __publicField$I = (obj, key, value) => __defNormalProp$$(obj, typeof key !== "symbol" ? key + "" : key, value);
15063
15054
  class BaseAdapter {
15064
15055
  constructor(map, options) {
15065
15056
  this.map = map;
@@ -15141,10 +15132,7 @@ var __spreadValues$C = (a, b) => {
15141
15132
  }
15142
15133
  return a;
15143
15134
  };
15144
- var __publicField$H = (obj, key, value) => {
15145
- __defNormalProp$Z(obj, typeof key !== "symbol" ? key + "" : key, value);
15146
- return value;
15147
- };
15135
+ var __publicField$H = (obj, key, value) => __defNormalProp$Z(obj, typeof key !== "symbol" ? key + "" : key, value);
15148
15136
  class GeoJsonEvents {
15149
15137
  constructor(layer) {
15150
15138
  __publicField$H(this, "layer");
@@ -15803,8 +15791,7 @@ const array = (args) => {
15803
15791
  return value;
15804
15792
  };
15805
15793
  function typeOfValue(value) {
15806
- if (value === null)
15807
- return "null";
15794
+ if (value === null) return "null";
15808
15795
  switch (typeof value) {
15809
15796
  case "string":
15810
15797
  return "string";
@@ -15959,10 +15946,8 @@ function reEscape(s) {
15959
15946
  function like(b, a, iLike) {
15960
15947
  a = String(a);
15961
15948
  b = String(b);
15962
- if (a === b)
15963
- return true;
15964
- if (iLike && a.toUpperCase() === b.toUpperCase())
15965
- return true;
15949
+ if (a === b) return true;
15950
+ if (iLike && a.toUpperCase() === b.toUpperCase()) return true;
15966
15951
  const re = `^${reEscape(a)}$`.replace(/%/g, ".*").replace("_", ".");
15967
15952
  return new RegExp(re, iLike ? "i" : "").exec(b) !== null;
15968
15953
  }
@@ -16200,10 +16185,7 @@ var __objRest$4 = (source, exclude) => {
16200
16185
  }
16201
16186
  return target;
16202
16187
  };
16203
- var __publicField$G = (obj, key, value) => {
16204
- __defNormalProp$U(obj, typeof key !== "symbol" ? key + "" : key, value);
16205
- return value;
16206
- };
16188
+ var __publicField$G = (obj, key, value) => __defNormalProp$U(obj, typeof key !== "symbol" ? key + "" : key, value);
16207
16189
  class GeoJsonPaint {
16208
16190
  constructor(layer) {
16209
16191
  __publicField$G(this, "layer");
@@ -16352,10 +16334,7 @@ var __spreadValues$w = (a, b) => {
16352
16334
  return a;
16353
16335
  };
16354
16336
  var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
16355
- var __publicField$F = (obj, key, value) => {
16356
- __defNormalProp$T(obj, typeof key !== "symbol" ? key + "" : key, value);
16357
- return value;
16358
- };
16337
+ var __publicField$F = (obj, key, value) => __defNormalProp$T(obj, typeof key !== "symbol" ? key + "" : key, value);
16359
16338
  var __async$l = (__this, __arguments, generator) => {
16360
16339
  return new Promise((resolve, reject) => {
16361
16340
  var fulfilled = (value) => {
@@ -16942,10 +16921,7 @@ function callAjax(src, headers) {
16942
16921
 
16943
16922
  var __defProp$S = Object.defineProperty;
16944
16923
  var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16945
- var __publicField$E = (obj, key, value) => {
16946
- __defNormalProp$S(obj, typeof key !== "symbol" ? key + "" : key, value);
16947
- return value;
16948
- };
16924
+ var __publicField$E = (obj, key, value) => __defNormalProp$S(obj, typeof key !== "symbol" ? key + "" : key, value);
16949
16925
  class Queue {
16950
16926
  /**
16951
16927
  * @param {PromiseQueueOptions} options - Configuration options for the queue.
@@ -17034,10 +17010,7 @@ const imageQueue = new Queue({ concurrency: 6, delay: 200 });
17034
17010
 
17035
17011
  var __defProp$R = Object.defineProperty;
17036
17012
  var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17037
- var __publicField$D = (obj, key, value) => {
17038
- __defNormalProp$R(obj, typeof key !== "symbol" ? key + "" : key, value);
17039
- return value;
17040
- };
17013
+ var __publicField$D = (obj, key, value) => __defNormalProp$R(obj, typeof key !== "symbol" ? key + "" : key, value);
17041
17014
  class ImageOverlay extends leafletSrcExports.ImageOverlay {
17042
17015
  constructor(imageUrl, bounds, options) {
17043
17016
  super(imageUrl, bounds, options);
@@ -17068,10 +17041,7 @@ class ImageOverlay extends leafletSrcExports.ImageOverlay {
17068
17041
 
17069
17042
  var __defProp$Q = Object.defineProperty;
17070
17043
  var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17071
- var __publicField$C = (obj, key, value) => {
17072
- __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
17073
- return value;
17074
- };
17044
+ var __publicField$C = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
17075
17045
  class ImageLayer extends leafletSrcExports.Layer {
17076
17046
  constructor(url, options) {
17077
17047
  super(options);
@@ -17275,10 +17245,7 @@ var __spreadValues$v = (a, b) => {
17275
17245
  }
17276
17246
  return a;
17277
17247
  };
17278
- var __publicField$B = (obj, key, value) => {
17279
- __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
17280
- return value;
17281
- };
17248
+ var __publicField$B = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
17282
17249
  class ImageAdapter extends BaseAdapter {
17283
17250
  constructor() {
17284
17251
  super(...arguments);
@@ -17556,10 +17523,7 @@ var __spreadValues$r = (a, b) => {
17556
17523
  }
17557
17524
  return a;
17558
17525
  };
17559
- var __publicField$A = (obj, key, value) => {
17560
- __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
17561
- return value;
17562
- };
17526
+ var __publicField$A = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
17563
17527
  const _LeafletMapAdapter = class _LeafletMapAdapter {
17564
17528
  constructor() {
17565
17529
  __publicField$A(this, "options", { target: "map" });
@@ -17637,8 +17601,7 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
17637
17601
  }
17638
17602
  setView(lngLatOrOpt, zoom) {
17639
17603
  const map = this.map;
17640
- if (!map)
17641
- return;
17604
+ if (!map) return;
17642
17605
  if (Array.isArray(lngLatOrOpt)) {
17643
17606
  const lngLat = lngLatOrOpt;
17644
17607
  const [lng, lat] = lngLat;
@@ -17706,8 +17669,7 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
17706
17669
  return (_a = this.map && this.map.getZoom()) != null ? _a : void 0;
17707
17670
  }
17708
17671
  getBounds() {
17709
- if (!this.map)
17710
- return void 0;
17672
+ if (!this.map) return void 0;
17711
17673
  const b = this.map.getBounds();
17712
17674
  const sw = b.getSouthWest();
17713
17675
  const ne = b.getNorthEast();
@@ -17896,10 +17858,7 @@ let LeafletMapAdapter = _LeafletMapAdapter;
17896
17858
 
17897
17859
  var __defProp$K = Object.defineProperty;
17898
17860
  var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17899
- var __publicField$z = (obj, key, value) => {
17900
- __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
17901
- return value;
17902
- };
17861
+ var __publicField$z = (obj, key, value) => __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
17903
17862
  class CancelError extends Error {
17904
17863
  constructor() {
17905
17864
  super();
@@ -17910,10 +17869,7 @@ class CancelError extends Error {
17910
17869
 
17911
17870
  var __defProp$J = Object.defineProperty;
17912
17871
  var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17913
- var __publicField$y = (obj, key, value) => {
17914
- __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
17915
- return value;
17916
- };
17872
+ var __publicField$y = (obj, key, value) => __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
17917
17873
  class PromiseControl {
17918
17874
  constructor(options = {}) {
17919
17875
  this.options = options;
@@ -17995,10 +17951,7 @@ class PromiseControl {
17995
17951
 
17996
17952
  var __defProp$I = Object.defineProperty;
17997
17953
  var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17998
- var __publicField$x = (obj, key, value) => {
17999
- __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
18000
- return value;
18001
- };
17954
+ var __publicField$x = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
18002
17955
  class TimeoutError extends Error {
18003
17956
  constructor() {
18004
17957
  super();
@@ -18009,10 +17962,7 @@ class TimeoutError extends Error {
18009
17962
 
18010
17963
  var __defProp$H = Object.defineProperty;
18011
17964
  var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18012
- var __publicField$w = (obj, key, value) => {
18013
- __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
18014
- return value;
18015
- };
17965
+ var __publicField$w = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
18016
17966
  var _a;
18017
17967
  const handleCallback = (resolve, reject, callback, r) => {
18018
17968
  try {
@@ -18022,6 +17972,7 @@ const handleCallback = (resolve, reject, callback, r) => {
18022
17972
  }
18023
17973
  };
18024
17974
  let ID$3 = 0;
17975
+ _a = Symbol.toStringTag;
18025
17976
  const _CancelablePromise = class _CancelablePromise {
18026
17977
  constructor(executor, timeout) {
18027
17978
  // @ts-ignore
@@ -18201,7 +18152,6 @@ const _CancelablePromise = class _CancelablePromise {
18201
18152
  this._promise = void 0;
18202
18153
  }
18203
18154
  };
18204
- _a = Symbol.toStringTag;
18205
18155
  __publicField$w(_CancelablePromise, "CancelError", CancelError);
18206
18156
  __publicField$w(_CancelablePromise, "TimeoutError", TimeoutError);
18207
18157
  __publicField$w(_CancelablePromise, "PromiseControl", PromiseControl);
@@ -18282,10 +18232,7 @@ function getIcon(opt = {}) {
18282
18232
 
18283
18233
  var __defProp$G = Object.defineProperty;
18284
18234
  var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18285
- var __publicField$v = (obj, key, value) => {
18286
- __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
18287
- return value;
18288
- };
18235
+ var __publicField$v = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
18289
18236
  const _Cache = class _Cache {
18290
18237
  constructor(options = {}) {
18291
18238
  __publicField$v(this, "cache", []);
@@ -18412,10 +18359,7 @@ let Cache = _Cache;
18412
18359
 
18413
18360
  var __defProp$F = Object.defineProperty;
18414
18361
  var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18415
- var __publicField$u = (obj, key, value) => {
18416
- __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18417
- return value;
18418
- };
18362
+ var __publicField$u = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18419
18363
  class NgwError extends Error {
18420
18364
  constructor(er) {
18421
18365
  super();
@@ -18434,10 +18378,7 @@ class NgwError extends Error {
18434
18378
 
18435
18379
  var __defProp$E = Object.defineProperty;
18436
18380
  var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18437
- var __publicField$t = (obj, key, value) => {
18438
- __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18439
- return value;
18440
- };
18381
+ var __publicField$t = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18441
18382
  class ResourceNotFoundError extends NgwError {
18442
18383
  constructor(obj) {
18443
18384
  super(obj);
@@ -18495,10 +18436,7 @@ var __spreadValues$q = (a, b) => {
18495
18436
  return a;
18496
18437
  };
18497
18438
  var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
18498
- var __publicField$s = (obj, key, value) => {
18499
- __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18500
- return value;
18501
- };
18439
+ var __publicField$s = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18502
18440
  var __async$k = (__this, __arguments, generator) => {
18503
18441
  return new Promise((resolve, reject) => {
18504
18442
  var fulfilled = (value) => {
@@ -18520,9 +18458,14 @@ var __async$k = (__this, __arguments, generator) => {
18520
18458
  });
18521
18459
  };
18522
18460
  class ResourcesControl {
18523
- constructor(connector) {
18461
+ constructor({
18462
+ connector,
18463
+ cacheId
18464
+ }) {
18465
+ __publicField$s(this, "cache");
18466
+ __publicField$s(this, "connector");
18524
18467
  this.connector = connector;
18525
- __publicField$s(this, "cache", new Cache());
18468
+ this.cache = new Cache({ namespace: cacheId });
18526
18469
  }
18527
18470
  // -------------------------------------------------------------------------
18528
18471
  // Resource Methods
@@ -18535,7 +18478,7 @@ class ResourcesControl {
18535
18478
  * Fetching resource would be cached to speed up next call
18536
18479
  */
18537
18480
  getOne(resource, requestOptions) {
18538
- const cache = new Cache();
18481
+ const cache = this.cache;
18539
18482
  const forCache = {};
18540
18483
  const opt = __spreadProps$e(__spreadValues$q({}, requestOptions), { cache: false });
18541
18484
  if (typeof resource === "string") {
@@ -18564,7 +18507,10 @@ class ResourcesControl {
18564
18507
  }
18565
18508
  return CancelablePromise.resolve(void 0);
18566
18509
  };
18567
- return cache.addFull("resource", makeRequest, forCache);
18510
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
18511
+ return cache.addFull("resource", makeRequest, forCache);
18512
+ }
18513
+ return makeRequest();
18568
18514
  }
18569
18515
  getOneOrFail(resource, requestOptions) {
18570
18516
  return this.getOne(resource, requestOptions).then((res) => {
@@ -18725,14 +18671,17 @@ class ResourcesControl {
18725
18671
  }
18726
18672
  _fetchResourceById(id, requestOptions) {
18727
18673
  const promise = () => this.connector.get("resource.item", requestOptions, { id });
18728
- return this.cache.add("resource.item", promise, {
18729
- id
18730
- }).catch((er) => {
18731
- if (!(er instanceof ResourceNotFoundError)) {
18732
- throw er;
18733
- }
18734
- return void 0;
18735
- });
18674
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
18675
+ return this.cache.add("resource.item", promise, {
18676
+ id
18677
+ }).catch((er) => {
18678
+ if (!(er instanceof ResourceNotFoundError)) {
18679
+ throw er;
18680
+ }
18681
+ return void 0;
18682
+ });
18683
+ }
18684
+ return promise();
18736
18685
  }
18737
18686
  _fetchResourceBy(resource, requestOptions) {
18738
18687
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -18786,10 +18735,7 @@ function removeConnector(connector) {
18786
18735
 
18787
18736
  var __defProp$C = Object.defineProperty;
18788
18737
  var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18789
- var __publicField$r = (obj, key, value) => {
18790
- __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
18791
- return value;
18792
- };
18738
+ var __publicField$r = (obj, key, value) => __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
18793
18739
  class InsufficientPermissionsError extends NgwError {
18794
18740
  constructor(obj) {
18795
18741
  super(obj);
@@ -18815,7 +18761,7 @@ function template(str, data) {
18815
18761
  function apiRequest(opt) {
18816
18762
  const params = opt.params;
18817
18763
  return new CancelablePromise((resolve, reject) => {
18818
- opt.connector.connect().then((apiItems) => {
18764
+ return opt.connector.connect().then((apiItems) => {
18819
18765
  let apiItem = apiItems && apiItems[opt.name];
18820
18766
  if (apiItem) {
18821
18767
  apiItem = [...apiItem];
@@ -18869,10 +18815,7 @@ function apiRequest(opt) {
18869
18815
 
18870
18816
  var __defProp$B = Object.defineProperty;
18871
18817
  var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18872
- var __publicField$q = (obj, key, value) => {
18873
- __defNormalProp$B(obj, typeof key !== "symbol" ? key + "" : key, value);
18874
- return value;
18875
- };
18818
+ var __publicField$q = (obj, key, value) => __defNormalProp$B(obj, typeof key !== "symbol" ? key + "" : key, value);
18876
18819
  class NetworkError extends Error {
18877
18820
  constructor(url) {
18878
18821
  super();
@@ -18981,10 +18924,7 @@ var __spreadValues$p = (a, b) => {
18981
18924
  }
18982
18925
  return a;
18983
18926
  };
18984
- var __publicField$p = (obj, key, value) => {
18985
- __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
18986
- return value;
18987
- };
18927
+ var __publicField$p = (obj, key, value) => __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
18988
18928
  let ID$2 = 0;
18989
18929
  class NgwConnector {
18990
18930
  constructor(options) {
@@ -18993,10 +18933,12 @@ class NgwConnector {
18993
18933
  __publicField$p(this, "emitter", new EventEmitter());
18994
18934
  __publicField$p(this, "user");
18995
18935
  __publicField$p(this, "resources");
18936
+ __publicField$p(this, "cache");
18996
18937
  __publicField$p(this, "routeStr", "/api/component/pyramid/route");
18997
18938
  __publicField$p(this, "activeRequests", []);
18998
18939
  __publicField$p(this, "requestTransform");
18999
18940
  const exist = findConnector(options);
18941
+ this.cache = new Cache({ namespace: options.cacheId });
19000
18942
  if (exist) {
19001
18943
  return exist;
19002
18944
  } else {
@@ -19006,13 +18948,23 @@ class NgwConnector {
19006
18948
  if (this.options.requestTransform) {
19007
18949
  this.requestTransform = this.options.requestTransform;
19008
18950
  }
19009
- this.resources = new ResourcesControl(this);
18951
+ this.resources = new ResourcesControl({
18952
+ connector: this,
18953
+ cacheId: options.cacheId
18954
+ });
19010
18955
  addConnector(this);
19011
18956
  }
19012
18957
  }
19013
18958
  static create(options) {
19014
18959
  return new this(options);
19015
18960
  }
18961
+ /**
18962
+ * Clear the cache.
18963
+ */
18964
+ clearCache() {
18965
+ this.cache.clean();
18966
+ this.resources.cache.clean();
18967
+ }
19016
18968
  setRequestTransform(requestTransform) {
19017
18969
  this.requestTransform = requestTransform;
19018
18970
  }
@@ -19040,7 +18992,6 @@ class NgwConnector {
19040
18992
  * ```
19041
18993
  */
19042
18994
  connect() {
19043
- const cache = new Cache();
19044
18995
  const auth = this.options.auth;
19045
18996
  const makeConnect = () => new CancelablePromise((resolve, reject) => {
19046
18997
  const makeQuery = () => {
@@ -19060,7 +19011,7 @@ class NgwConnector {
19060
19011
  }
19061
19012
  return makeQuery();
19062
19013
  });
19063
- return cache.add("route", makeConnect, {
19014
+ return this.cache.add("route", makeConnect, {
19064
19015
  id: this.id,
19065
19016
  auth,
19066
19017
  baseUrl: this.options.baseUrl
@@ -19083,8 +19034,8 @@ class NgwConnector {
19083
19034
  removeConnector(this);
19084
19035
  this.options.auth = void 0;
19085
19036
  this.user = void 0;
19037
+ this.clearCache();
19086
19038
  this.emitter.emit("logout");
19087
- this.resources.cache.clean();
19088
19039
  }
19089
19040
  getUserInfo(credentials, options) {
19090
19041
  if (this.user && this.user.id) {
@@ -19169,8 +19120,7 @@ class NgwConnector {
19169
19120
  const params = objectRemoveEmpty(params_);
19170
19121
  const makeApiRequest = () => apiRequest({ name, params, requestOptions, connector: this });
19171
19122
  if (requestOptions.cache && method === "GET") {
19172
- const cache = new Cache();
19173
- return cache.add(name, makeApiRequest, __spreadValues$p({
19123
+ return this.cache.add(name, makeApiRequest, __spreadValues$p({
19174
19124
  params
19175
19125
  }, objectRemoveEmpty({
19176
19126
  headers,
@@ -19686,10 +19636,7 @@ function fetchNgwLayerItem(options) {
19686
19636
 
19687
19637
  var __defProp$x = Object.defineProperty;
19688
19638
  var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19689
- var __publicField$o = (obj, key, value) => {
19690
- __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
19691
- return value;
19692
- };
19639
+ var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
19693
19640
  class BookmarkItem {
19694
19641
  constructor(options) {
19695
19642
  this.options = options;
@@ -19853,10 +19800,7 @@ function treeEvery_(item, filterFunc = (x) => !!x, relation, _filtered = []) {
19853
19800
 
19854
19801
  var __defProp$w = Object.defineProperty;
19855
19802
  var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19856
- var __publicField$n = (obj, key, value) => {
19857
- __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
19858
- return value;
19859
- };
19803
+ var __publicField$n = (obj, key, value) => __defNormalProp$w(obj, typeof key !== "symbol" ? key + "" : key, value);
19860
19804
  class TreeHelper {
19861
19805
  constructor(item) {
19862
19806
  __publicField$n(this, "item");
@@ -19926,10 +19870,7 @@ class TreeHelper {
19926
19870
 
19927
19871
  var __defProp$v = Object.defineProperty;
19928
19872
  var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19929
- var __publicField$m = (obj, key, value) => {
19930
- __defNormalProp$v(obj, typeof key !== "symbol" ? key + "" : key, value);
19931
- return value;
19932
- };
19873
+ var __publicField$m = (obj, key, value) => __defNormalProp$v(obj, typeof key !== "symbol" ? key + "" : key, value);
19933
19874
  class BaseProperty {
19934
19875
  constructor(name, item, options) {
19935
19876
  __publicField$m(this, "options");
@@ -20052,10 +19993,7 @@ var __spreadValues$m = (a, b) => {
20052
19993
  }
20053
19994
  return a;
20054
19995
  };
20055
- var __publicField$l = (obj, key, value) => {
20056
- __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
20057
- return value;
20058
- };
19996
+ var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
20059
19997
  const _CheckProperty = class _CheckProperty extends BaseProperty {
20060
19998
  constructor(name, item, options) {
20061
19999
  super(name, item, __spreadValues$m(__spreadValues$m({}, _CheckProperty.options), options));
@@ -20188,10 +20126,7 @@ var __spreadValues$l = (a, b) => {
20188
20126
  }
20189
20127
  return a;
20190
20128
  };
20191
- var __publicField$k = (obj, key, value) => {
20192
- __defNormalProp$t(obj, typeof key !== "symbol" ? key + "" : key, value);
20193
- return value;
20194
- };
20129
+ var __publicField$k = (obj, key, value) => __defNormalProp$t(obj, typeof key !== "symbol" ? key + "" : key, value);
20195
20130
  const BOOLEAN_TYPE = "boolean";
20196
20131
  const STRING_TYPE = "string";
20197
20132
  const _ItemProperties = class _ItemProperties {
@@ -20283,10 +20218,7 @@ var __spreadValues$k = (a, b) => {
20283
20218
  }
20284
20219
  return a;
20285
20220
  };
20286
- var __publicField$j = (obj, key, value) => {
20287
- __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
20288
- return value;
20289
- };
20221
+ var __publicField$j = (obj, key, value) => __defNormalProp$s(obj, typeof key !== "symbol" ? key + "" : key, value);
20290
20222
  let ID$1 = 0;
20291
20223
  class Item {
20292
20224
  constructor(options) {
@@ -20445,10 +20377,7 @@ function fetchNgwResourceExtent(item, connector, options) {
20445
20377
 
20446
20378
  var __defProp$q = Object.defineProperty;
20447
20379
  var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20448
- var __publicField$i = (obj, key, value) => {
20449
- __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
20450
- return value;
20451
- };
20380
+ var __publicField$i = (obj, key, value) => __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
20452
20381
  var __async$j = (__this, __arguments, generator) => {
20453
20382
  return new Promise((resolve, reject) => {
20454
20383
  var fulfilled = (value) => {
@@ -20620,10 +20549,7 @@ var __objRest$1 = (source, exclude) => {
20620
20549
  }
20621
20550
  return target;
20622
20551
  };
20623
- var __publicField$h = (obj, key, value) => {
20624
- __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
20625
- return value;
20626
- };
20552
+ var __publicField$h = (obj, key, value) => __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
20627
20553
  var __async$h = (__this, __arguments, generator) => {
20628
20554
  return new Promise((resolve, reject) => {
20629
20555
  var fulfilled = (value) => {
@@ -20736,10 +20662,7 @@ var __spreadValues$h = (a, b) => {
20736
20662
  }
20737
20663
  return a;
20738
20664
  };
20739
- var __publicField$g = (obj, key, value) => {
20740
- __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
20741
- return value;
20742
- };
20665
+ var __publicField$g = (obj, key, value) => __defNormalProp$o(obj, typeof key !== "symbol" ? key + "" : key, value);
20743
20666
  class QmsKit {
20744
20667
  constructor(options) {
20745
20668
  __publicField$g(this, "options", {
@@ -21025,10 +20948,7 @@ var __spreadValues$e = (a, b) => {
21025
20948
  return a;
21026
20949
  };
21027
20950
  var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
21028
- var __publicField$f = (obj, key, value) => {
21029
- __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
21030
- return value;
21031
- };
20951
+ var __publicField$f = (obj, key, value) => __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
21032
20952
  var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
21033
20953
  var __async$f = (__this, __arguments, generator) => {
21034
20954
  return new Promise((resolve, reject) => {
@@ -21461,10 +21381,7 @@ var __spreadValues$d = (a, b) => {
21461
21381
  return a;
21462
21382
  };
21463
21383
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
21464
- var __publicField$e = (obj, key, value) => {
21465
- __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
21466
- return value;
21467
- };
21384
+ var __publicField$e = (obj, key, value) => __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
21468
21385
  var __async$d = (__this, __arguments, generator) => {
21469
21386
  return new Promise((resolve, reject) => {
21470
21387
  var fulfilled = (value) => {
@@ -21854,10 +21771,7 @@ var __spreadValues$a = (a, b) => {
21854
21771
  }
21855
21772
  return a;
21856
21773
  };
21857
- var __publicField$d = (obj, key, value) => {
21858
- __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
21859
- return value;
21860
- };
21774
+ var __publicField$d = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
21861
21775
  var __async$b = (__this, __arguments, generator) => {
21862
21776
  return new Promise((resolve, reject) => {
21863
21777
  var fulfilled = (value) => {
@@ -22135,10 +22049,7 @@ var __spreadValues$9 = (a, b) => {
22135
22049
  }
22136
22050
  return a;
22137
22051
  };
22138
- var __publicField$c = (obj, key, value) => {
22139
- __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
22140
- return value;
22141
- };
22052
+ var __publicField$c = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
22142
22053
  var __async$a = (__this, __arguments, generator) => {
22143
22054
  return new Promise((resolve, reject) => {
22144
22055
  var fulfilled = (value) => {
@@ -22315,10 +22226,7 @@ var __spreadValues$8 = (a, b) => {
22315
22226
  }
22316
22227
  return a;
22317
22228
  };
22318
- var __publicField$b = (obj, key, value) => {
22319
- __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
22320
- return value;
22321
- };
22229
+ var __publicField$b = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
22322
22230
  var __async$8 = (__this, __arguments, generator) => {
22323
22231
  return new Promise((resolve, reject) => {
22324
22232
  var fulfilled = (value) => {
@@ -22384,8 +22292,7 @@ class NgwWebmapLayerAdapter {
22384
22292
  removeLayer() {
22385
22293
  const mapAdapter = this.options.webMap.mapAdapter;
22386
22294
  this.getDependLayers().forEach((x) => {
22387
- if (!("layer" in x))
22388
- return;
22295
+ if (!("layer" in x)) return;
22389
22296
  mapAdapter.removeLayer(x.layer.layer);
22390
22297
  });
22391
22298
  if (this._webmapBaselayersIds.length) {
@@ -22686,10 +22593,7 @@ var __spreadValues$7 = (a, b) => {
22686
22593
  }
22687
22594
  return a;
22688
22595
  };
22689
- var __publicField$a = (obj, key, value) => {
22690
- __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
22691
- return value;
22692
- };
22596
+ var __publicField$a = (obj, key, value) => __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
22693
22597
  var __async$7 = (__this, __arguments, generator) => {
22694
22598
  return new Promise((resolve, reject) => {
22695
22599
  var fulfilled = (value) => {
@@ -22792,10 +22696,7 @@ var __spreadValues$6 = (a, b) => {
22792
22696
  }
22793
22697
  return a;
22794
22698
  };
22795
- var __publicField$9 = (obj, key, value) => {
22796
- __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
22797
- return value;
22798
- };
22699
+ var __publicField$9 = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
22799
22700
  class IdentifyItem {
22800
22701
  constructor(options) {
22801
22702
  __publicField$9(this, "id");
@@ -22998,8 +22899,7 @@ function featureLayerIdentify(options) {
22998
22899
  }
22999
22900
  function convertGeomToWKT(geom) {
23000
22901
  const coordinates = getPolygonCoordinates(geom);
23001
- if (!coordinates)
23002
- return null;
22902
+ if (!coordinates) return null;
23003
22903
  const polygonStr = coordinates.map(([lng, lat]) => {
23004
22904
  const [x, y] = degrees2meters(lng, lat);
23005
22905
  return `${x} ${y}`;
@@ -23095,10 +22995,7 @@ function getCompanyLogo(connector, options) {
23095
22995
 
23096
22996
  var __defProp$b = Object.defineProperty;
23097
22997
  var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23098
- var __publicField$8 = (obj, key, value) => {
23099
- __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
23100
- return value;
23101
- };
22998
+ var __publicField$8 = (obj, key, value) => __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
23102
22999
  class KeyCodes {
23103
23000
  constructor() {
23104
23001
  __publicField$8(this, "backspace", 8);
@@ -23177,10 +23074,7 @@ class KeyCodes {
23177
23074
 
23178
23075
  var __defProp$a = Object.defineProperty;
23179
23076
  var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23180
- var __publicField$7 = (obj, key, value) => {
23181
- __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
23182
- return value;
23183
- };
23077
+ var __publicField$7 = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
23184
23078
  class Keys {
23185
23079
  constructor() {
23186
23080
  __publicField$7(this, "keyCodeAlias", new KeyCodes());
@@ -23228,10 +23122,7 @@ class Keys {
23228
23122
 
23229
23123
  var __defProp$9 = Object.defineProperty;
23230
23124
  var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23231
- var __publicField$6 = (obj, key, value) => {
23232
- __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
23233
- return value;
23234
- };
23125
+ var __publicField$6 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
23235
23126
  class StateItem {
23236
23127
  constructor(webMap, opt) {
23237
23128
  this.webMap = webMap;
@@ -23260,10 +23151,7 @@ class StateItem {
23260
23151
 
23261
23152
  var __defProp$8 = Object.defineProperty;
23262
23153
  var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23263
- var __publicField$5 = (obj, key, value) => {
23264
- __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
23265
- return value;
23266
- };
23154
+ var __publicField$5 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
23267
23155
  class CenterState extends StateItem {
23268
23156
  constructor() {
23269
23157
  super(...arguments);
@@ -23288,10 +23176,7 @@ class CenterState extends StateItem {
23288
23176
 
23289
23177
  var __defProp$7 = Object.defineProperty;
23290
23178
  var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23291
- var __publicField$4 = (obj, key, value) => {
23292
- __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
23293
- return value;
23294
- };
23179
+ var __publicField$4 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
23295
23180
  class ZoomState extends StateItem {
23296
23181
  constructor() {
23297
23182
  super(...arguments);
@@ -23321,10 +23206,7 @@ function clearObject(obj) {
23321
23206
 
23322
23207
  var __defProp$6 = Object.defineProperty;
23323
23208
  var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
23324
- var __publicField$3 = (obj, key, value) => {
23325
- __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
23326
- return value;
23327
- };
23209
+ var __publicField$3 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
23328
23210
  var __async$5 = (__this, __arguments, generator) => {
23329
23211
  return new Promise((resolve, reject) => {
23330
23212
  var fulfilled = (value) => {
@@ -23941,10 +23823,7 @@ var __spreadValues$4 = (a, b) => {
23941
23823
  return a;
23942
23824
  };
23943
23825
  var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
23944
- var __publicField$2 = (obj, key, value) => {
23945
- __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
23946
- return value;
23947
- };
23826
+ var __publicField$2 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
23948
23827
  var __async$4 = (__this, __arguments, generator) => {
23949
23828
  return new Promise((resolve, reject) => {
23950
23829
  var fulfilled = (value) => {
@@ -24890,10 +24769,7 @@ function createToggleControl(createButtonControl, options) {
24890
24769
 
24891
24770
  var __defProp$4 = Object.defineProperty;
24892
24771
  var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
24893
- var __publicField$1 = (obj, key, value) => {
24894
- __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
24895
- return value;
24896
- };
24772
+ var __publicField$1 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
24897
24773
  var __async$3 = (__this, __arguments, generator) => {
24898
24774
  return new Promise((resolve, reject) => {
24899
24775
  var fulfilled = (value) => {
@@ -25092,9 +24968,7 @@ function setWebMap(id, webMap) {
25092
24968
  var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
25093
24969
  var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
25094
24970
  var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
25095
- var __knownSymbol = (name, symbol) => {
25096
- return (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
25097
- };
24971
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
25098
24972
  var __objRest = (source, exclude) => {
25099
24973
  var target = {};
25100
24974
  for (var prop in source)
@@ -25360,10 +25234,7 @@ var __spreadValues$1 = (a, b) => {
25360
25234
  return a;
25361
25235
  };
25362
25236
  var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
25363
- var __publicField = (obj, key, value) => {
25364
- __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
25365
- return value;
25366
- };
25237
+ var __publicField = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
25367
25238
  var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
25368
25239
  var __async$1 = (__this, __arguments, generator) => {
25369
25240
  return new Promise((resolve, reject) => {
@@ -25770,10 +25641,32 @@ const _NgwMap = class _NgwMap extends WebMap {
25770
25641
  return;
25771
25642
  }
25772
25643
  const radius = getIdentifyRadius(center, zoom, pixelRadius);
25644
+ let geom;
25645
+ if (this.options.highlightIdentification) {
25646
+ const highlightOptions = this.options.highlightIdentification;
25647
+ const highlightDuration = typeof highlightOptions === "number" ? highlightOptions : 1e3;
25648
+ const [lng, lat] = ev.lngLat;
25649
+ geom = {
25650
+ type: "Polygon",
25651
+ coordinates: [getCirclePolygonCoordinates(lng, lat, radius)]
25652
+ };
25653
+ const highlightIdentificationLayer = yield this.addGeoJsonLayer({
25654
+ data: {
25655
+ type: "Feature",
25656
+ geometry: geom
25657
+ }
25658
+ });
25659
+ if (highlightDuration !== Infinity) {
25660
+ setTimeout(() => {
25661
+ this.removeLayer(highlightIdentificationLayer);
25662
+ }, highlightDuration);
25663
+ }
25664
+ }
25773
25665
  const selectPromise = sendIdentifyRequest(ev, {
25774
25666
  layers: ids,
25775
25667
  connector: this.connector,
25776
- radius
25668
+ radius,
25669
+ geom
25777
25670
  }).then((resp) => {
25778
25671
  const identify = __spreadProps$1(__spreadValues$1({}, resp), {
25779
25672
  resources: ids,