@nextgis/ngw-leaflet 2.5.0 → 3.0.0-alpha.1

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.5.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 3.0.0-alpha.1; author: NextGIS */
2
2
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -15051,15 +15051,15 @@ var NgwLeaflet = (function () {
15051
15051
  };
15052
15052
  }
15053
15053
 
15054
- var __defProp$$ = Object.defineProperty;
15055
- var __defNormalProp$$ = (obj, key, value) => key in obj ? __defProp$$(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15056
- var __publicField$I = (obj, key, value) => __defNormalProp$$(obj, typeof key !== "symbol" ? key + "" : key, value);
15054
+ var __defProp$Y = Object.defineProperty;
15055
+ var __defNormalProp$Y = (obj, key, value) => key in obj ? __defProp$Y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15056
+ var __publicField$E = (obj, key, value) => __defNormalProp$Y(obj, typeof key !== "symbol" ? key + "" : key, value);
15057
15057
  class BaseAdapter {
15058
15058
  constructor(map, options) {
15059
15059
  this.map = map;
15060
15060
  this.options = options;
15061
- __publicField$I(this, "layer");
15062
- __publicField$I(this, "pane", "order-0");
15061
+ __publicField$E(this, "layer");
15062
+ __publicField$E(this, "pane", "order-0");
15063
15063
  if (options.order !== void 0) {
15064
15064
  const pane = "order-" + options.order;
15065
15065
  let exist = map.getPane(pane);
@@ -15088,19 +15088,19 @@ var NgwLeaflet = (function () {
15088
15088
  };
15089
15089
  }
15090
15090
 
15091
- var __defProp$_ = Object.defineProperty;
15092
- var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
15093
- var __hasOwnProp$E = Object.prototype.hasOwnProperty;
15094
- var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
15095
- var __defNormalProp$_ = (obj, key, value) => key in obj ? __defProp$_(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15096
- var __spreadValues$D = (a, b) => {
15091
+ var __defProp$X = Object.defineProperty;
15092
+ var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
15093
+ var __hasOwnProp$G = Object.prototype.hasOwnProperty;
15094
+ var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
15095
+ var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15096
+ var __spreadValues$F = (a, b) => {
15097
15097
  for (var prop in b || (b = {}))
15098
- if (__hasOwnProp$E.call(b, prop))
15099
- __defNormalProp$_(a, prop, b[prop]);
15100
- if (__getOwnPropSymbols$E)
15101
- for (var prop of __getOwnPropSymbols$E(b)) {
15102
- if (__propIsEnum$E.call(b, prop))
15103
- __defNormalProp$_(a, prop, b[prop]);
15098
+ if (__hasOwnProp$G.call(b, prop))
15099
+ __defNormalProp$X(a, prop, b[prop]);
15100
+ if (__getOwnPropSymbols$G)
15101
+ for (var prop of __getOwnPropSymbols$G(b)) {
15102
+ if (__propIsEnum$G.call(b, prop))
15103
+ __defNormalProp$X(a, prop, b[prop]);
15104
15104
  }
15105
15105
  return a;
15106
15106
  };
@@ -15110,7 +15110,7 @@ var NgwLeaflet = (function () {
15110
15110
  }) {
15111
15111
  const layer_ = source.target;
15112
15112
  const feature = layer_.feature;
15113
- const opt = __spreadValues$D({
15113
+ const opt = __spreadValues$F({
15114
15114
  layer,
15115
15115
  feature,
15116
15116
  event: convertMapClickEvent(source),
@@ -15119,30 +15119,30 @@ var NgwLeaflet = (function () {
15119
15119
  return opt;
15120
15120
  }
15121
15121
 
15122
- var __defProp$Z = Object.defineProperty;
15123
- var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
15124
- var __hasOwnProp$D = Object.prototype.hasOwnProperty;
15125
- var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
15126
- var __defNormalProp$Z = (obj, key, value) => key in obj ? __defProp$Z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15127
- var __spreadValues$C = (a, b) => {
15122
+ var __defProp$W = Object.defineProperty;
15123
+ var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
15124
+ var __hasOwnProp$F = Object.prototype.hasOwnProperty;
15125
+ var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
15126
+ var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15127
+ var __spreadValues$E = (a, b) => {
15128
15128
  for (var prop in b || (b = {}))
15129
- if (__hasOwnProp$D.call(b, prop))
15130
- __defNormalProp$Z(a, prop, b[prop]);
15131
- if (__getOwnPropSymbols$D)
15132
- for (var prop of __getOwnPropSymbols$D(b)) {
15133
- if (__propIsEnum$D.call(b, prop))
15134
- __defNormalProp$Z(a, prop, b[prop]);
15129
+ if (__hasOwnProp$F.call(b, prop))
15130
+ __defNormalProp$W(a, prop, b[prop]);
15131
+ if (__getOwnPropSymbols$F)
15132
+ for (var prop of __getOwnPropSymbols$F(b)) {
15133
+ if (__propIsEnum$F.call(b, prop))
15134
+ __defNormalProp$W(a, prop, b[prop]);
15135
15135
  }
15136
15136
  return a;
15137
15137
  };
15138
- var __publicField$H = (obj, key, value) => __defNormalProp$Z(obj, typeof key !== "symbol" ? key + "" : key, value);
15138
+ var __publicField$D = (obj, key, value) => __defNormalProp$W(obj, typeof key !== "symbol" ? key + "" : key, value);
15139
15139
  class GeoJsonEvents {
15140
15140
  constructor(layer) {
15141
- __publicField$H(this, "layer");
15142
- __publicField$H(this, "_onclick");
15143
- __publicField$H(this, "_ondblclick");
15144
- __publicField$H(this, "_mouseout");
15145
- __publicField$H(this, "_mouseover");
15141
+ __publicField$D(this, "layer");
15142
+ __publicField$D(this, "_onclick");
15143
+ __publicField$D(this, "_ondblclick");
15144
+ __publicField$D(this, "_mouseout");
15145
+ __publicField$D(this, "_mouseover");
15146
15146
  this.layer = layer;
15147
15147
  }
15148
15148
  handleMouseEvents(layer) {
@@ -15151,7 +15151,7 @@ var NgwLeaflet = (function () {
15151
15151
  if (onClick_) {
15152
15152
  this._onclick = (e) => {
15153
15153
  const selected = !!this.layer._getSelected(layer);
15154
- onClick_(__spreadValues$C({
15154
+ onClick_(__spreadValues$E({
15155
15155
  selected
15156
15156
  }, this._createMouseEvent(e)));
15157
15157
  };
@@ -15161,7 +15161,7 @@ var NgwLeaflet = (function () {
15161
15161
  this._ondblclick = (e) => {
15162
15162
  leafletSrcExports.DomEvent.stopPropagation(e);
15163
15163
  const selected = !!this.layer._getSelected(layer);
15164
- onDoubleClick(__spreadValues$C({
15164
+ onDoubleClick(__spreadValues$E({
15165
15165
  selected
15166
15166
  }, this._createMouseEvent(e)));
15167
15167
  };
@@ -15839,19 +15839,19 @@ var NgwLeaflet = (function () {
15839
15839
  typeof: evaluateArgs(([arg]) => typeOfValue(arg))
15840
15840
  };
15841
15841
 
15842
- var __defProp$Y = Object.defineProperty;
15843
- var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
15844
- var __hasOwnProp$C = Object.prototype.hasOwnProperty;
15845
- var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
15846
- var __defNormalProp$Y = (obj, key, value) => key in obj ? __defProp$Y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15847
- var __spreadValues$B = (a, b) => {
15842
+ var __defProp$V = Object.defineProperty;
15843
+ var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
15844
+ var __hasOwnProp$E = Object.prototype.hasOwnProperty;
15845
+ var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
15846
+ var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15847
+ var __spreadValues$D = (a, b) => {
15848
15848
  for (var prop in b || (b = {}))
15849
- if (__hasOwnProp$C.call(b, prop))
15850
- __defNormalProp$Y(a, prop, b[prop]);
15851
- if (__getOwnPropSymbols$C)
15852
- for (var prop of __getOwnPropSymbols$C(b)) {
15853
- if (__propIsEnum$C.call(b, prop))
15854
- __defNormalProp$Y(a, prop, b[prop]);
15849
+ if (__hasOwnProp$E.call(b, prop))
15850
+ __defNormalProp$V(a, prop, b[prop]);
15851
+ if (__getOwnPropSymbols$E)
15852
+ for (var prop of __getOwnPropSymbols$E(b)) {
15853
+ if (__propIsEnum$E.call(b, prop))
15854
+ __defNormalProp$V(a, prop, b[prop]);
15855
15855
  }
15856
15856
  return a;
15857
15857
  };
@@ -15863,7 +15863,7 @@ var NgwLeaflet = (function () {
15863
15863
  }
15864
15864
  return false;
15865
15865
  }
15866
- const expressions = __spreadValues$B(__spreadValues$B(__spreadValues$B(__spreadValues$B(__spreadValues$B(__spreadValues$B({}, mathExpressions), typeExpressions), stringExpressions), lookupExpressions), decisionExpressions), interpolationExpressions);
15866
+ const expressions = __spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D({}, mathExpressions), typeExpressions), stringExpressions), lookupExpressions), decisionExpressions), interpolationExpressions);
15867
15867
  function evaluate(expression, data = {}) {
15868
15868
  const [name, ...args] = expression;
15869
15869
  const expressionFun = expressions[name];
@@ -15876,19 +15876,19 @@ var NgwLeaflet = (function () {
15876
15876
  throw new Error(`Expression "${name}" is not supported.`);
15877
15877
  }
15878
15878
 
15879
- var __defProp$X = Object.defineProperty;
15880
- var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
15881
- var __hasOwnProp$B = Object.prototype.hasOwnProperty;
15882
- var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
15883
- var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15884
- var __spreadValues$A = (a, b) => {
15879
+ var __defProp$U = Object.defineProperty;
15880
+ var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
15881
+ var __hasOwnProp$D = Object.prototype.hasOwnProperty;
15882
+ var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
15883
+ var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15884
+ var __spreadValues$C = (a, b) => {
15885
15885
  for (var prop in b || (b = {}))
15886
- if (__hasOwnProp$B.call(b, prop))
15887
- __defNormalProp$X(a, prop, b[prop]);
15888
- if (__getOwnPropSymbols$B)
15889
- for (var prop of __getOwnPropSymbols$B(b)) {
15890
- if (__propIsEnum$B.call(b, prop))
15891
- __defNormalProp$X(a, prop, b[prop]);
15886
+ if (__hasOwnProp$D.call(b, prop))
15887
+ __defNormalProp$U(a, prop, b[prop]);
15888
+ if (__getOwnPropSymbols$D)
15889
+ for (var prop of __getOwnPropSymbols$D(b)) {
15890
+ if (__propIsEnum$D.call(b, prop))
15891
+ __defNormalProp$U(a, prop, b[prop]);
15892
15892
  }
15893
15893
  return a;
15894
15894
  };
@@ -15921,25 +15921,25 @@ var NgwLeaflet = (function () {
15921
15921
  for (const p in expressions) {
15922
15922
  fromCb[p] = expressions[p](feature);
15923
15923
  }
15924
- return __spreadValues$A(__spreadValues$A({}, paint), fromCb);
15924
+ return __spreadValues$C(__spreadValues$C({}, paint), fromCb);
15925
15925
  };
15926
15926
  }
15927
15927
  return;
15928
15928
  }
15929
15929
 
15930
- var __defProp$W = Object.defineProperty;
15931
- var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
15932
- var __hasOwnProp$A = Object.prototype.hasOwnProperty;
15933
- var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
15934
- var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15935
- var __spreadValues$z = (a, b) => {
15930
+ var __defProp$T = Object.defineProperty;
15931
+ var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
15932
+ var __hasOwnProp$C = Object.prototype.hasOwnProperty;
15933
+ var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
15934
+ var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15935
+ var __spreadValues$B = (a, b) => {
15936
15936
  for (var prop in b || (b = {}))
15937
- if (__hasOwnProp$A.call(b, prop))
15938
- __defNormalProp$W(a, prop, b[prop]);
15939
- if (__getOwnPropSymbols$A)
15940
- for (var prop of __getOwnPropSymbols$A(b)) {
15941
- if (__propIsEnum$A.call(b, prop))
15942
- __defNormalProp$W(a, prop, b[prop]);
15937
+ if (__hasOwnProp$C.call(b, prop))
15938
+ __defNormalProp$T(a, prop, b[prop]);
15939
+ if (__getOwnPropSymbols$C)
15940
+ for (var prop of __getOwnPropSymbols$C(b)) {
15941
+ if (__propIsEnum$C.call(b, prop))
15942
+ __defNormalProp$T(a, prop, b[prop]);
15943
15943
  }
15944
15944
  return a;
15945
15945
  };
@@ -15986,7 +15986,7 @@ var NgwLeaflet = (function () {
15986
15986
  return false;
15987
15987
  }
15988
15988
  function featureFilter(feature, filters) {
15989
- const properties = __spreadValues$z({}, feature.properties);
15989
+ const properties = __spreadValues$B({}, feature.properties);
15990
15990
  if (properties) {
15991
15991
  properties.$id = feature.id;
15992
15992
  return propertiesFilter(properties, filters);
@@ -16021,19 +16021,19 @@ var NgwLeaflet = (function () {
16021
16021
  return logic === "any" ? filters_.some(filterFunction) : filters_.every(filterFunction);
16022
16022
  }
16023
16023
 
16024
- var __defProp$V = Object.defineProperty;
16025
- var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
16026
- var __hasOwnProp$z = Object.prototype.hasOwnProperty;
16027
- var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
16028
- var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16029
- var __spreadValues$y = (a, b) => {
16024
+ var __defProp$S = Object.defineProperty;
16025
+ var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
16026
+ var __hasOwnProp$B = Object.prototype.hasOwnProperty;
16027
+ var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
16028
+ var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16029
+ var __spreadValues$A = (a, b) => {
16030
16030
  for (var prop in b || (b = {}))
16031
- if (__hasOwnProp$z.call(b, prop))
16032
- __defNormalProp$V(a, prop, b[prop]);
16033
- if (__getOwnPropSymbols$z)
16034
- for (var prop of __getOwnPropSymbols$z(b)) {
16035
- if (__propIsEnum$z.call(b, prop))
16036
- __defNormalProp$V(a, prop, b[prop]);
16031
+ if (__hasOwnProp$B.call(b, prop))
16032
+ __defNormalProp$S(a, prop, b[prop]);
16033
+ if (__getOwnPropSymbols$B)
16034
+ for (var prop of __getOwnPropSymbols$B(b)) {
16035
+ if (__propIsEnum$B.call(b, prop))
16036
+ __defNormalProp$S(a, prop, b[prop]);
16037
16037
  }
16038
16038
  return a;
16039
16039
  };
@@ -16062,7 +16062,7 @@ var NgwLeaflet = (function () {
16062
16062
  return (feature) => {
16063
16063
  const paint = paintsFilters.find((x) => featureFilter(feature, x[0]));
16064
16064
  if (paint) {
16065
- return __spreadValues$y(__spreadValues$y({}, mask), paint[1]);
16065
+ return __spreadValues$A(__spreadValues$A({}, mask), paint[1]);
16066
16066
  }
16067
16067
  return mask;
16068
16068
  };
@@ -16086,8 +16086,8 @@ var NgwLeaflet = (function () {
16086
16086
  }
16087
16087
  function finalizePaint({ paint, defaultPaint }) {
16088
16088
  var _a;
16089
- let newPaint = __spreadValues$y({}, defaultPaint);
16090
- newPaint = __spreadValues$y(__spreadValues$y({}, newPaint), paint);
16089
+ let newPaint = __spreadValues$A({}, defaultPaint);
16090
+ newPaint = __spreadValues$A(__spreadValues$A({}, newPaint), paint);
16091
16091
  newPaint.fill = (_a = newPaint.fill) != null ? _a : true;
16092
16092
  newPaint.stroke = newPaint.stroke !== void 0 ? newPaint.stroke : !newPaint.fill || !!(newPaint.strokeColor || newPaint.strokeOpacity);
16093
16093
  return newPaint;
@@ -16100,7 +16100,7 @@ var NgwLeaflet = (function () {
16100
16100
  if (!paint) {
16101
16101
  throw new Error("paint is empty");
16102
16102
  }
16103
- let newPaint = __spreadValues$y({}, defaultPaint);
16103
+ let newPaint = __spreadValues$A({}, defaultPaint);
16104
16104
  if (isPaintCallback(paint)) {
16105
16105
  const getPaintFunction = (feature) => {
16106
16106
  const getPaint = preparePaint({
@@ -16157,41 +16157,41 @@ var NgwLeaflet = (function () {
16157
16157
  return newPaint;
16158
16158
  }
16159
16159
 
16160
- var __defProp$U = Object.defineProperty;
16160
+ var __defProp$R = Object.defineProperty;
16161
16161
  var __defProps$l = Object.defineProperties;
16162
16162
  var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
16163
- var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
16164
- var __hasOwnProp$y = Object.prototype.hasOwnProperty;
16165
- var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
16166
- var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16167
- var __spreadValues$x = (a, b) => {
16163
+ var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
16164
+ var __hasOwnProp$A = Object.prototype.hasOwnProperty;
16165
+ var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
16166
+ var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16167
+ var __spreadValues$z = (a, b) => {
16168
16168
  for (var prop in b || (b = {}))
16169
- if (__hasOwnProp$y.call(b, prop))
16170
- __defNormalProp$U(a, prop, b[prop]);
16171
- if (__getOwnPropSymbols$y)
16172
- for (var prop of __getOwnPropSymbols$y(b)) {
16173
- if (__propIsEnum$y.call(b, prop))
16174
- __defNormalProp$U(a, prop, b[prop]);
16169
+ if (__hasOwnProp$A.call(b, prop))
16170
+ __defNormalProp$R(a, prop, b[prop]);
16171
+ if (__getOwnPropSymbols$A)
16172
+ for (var prop of __getOwnPropSymbols$A(b)) {
16173
+ if (__propIsEnum$A.call(b, prop))
16174
+ __defNormalProp$R(a, prop, b[prop]);
16175
16175
  }
16176
16176
  return a;
16177
16177
  };
16178
16178
  var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
16179
- var __objRest$4 = (source, exclude) => {
16179
+ var __objRest$5 = (source, exclude) => {
16180
16180
  var target = {};
16181
16181
  for (var prop in source)
16182
- if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
16182
+ if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
16183
16183
  target[prop] = source[prop];
16184
- if (source != null && __getOwnPropSymbols$y)
16185
- for (var prop of __getOwnPropSymbols$y(source)) {
16186
- if (exclude.indexOf(prop) < 0 && __propIsEnum$y.call(source, prop))
16184
+ if (source != null && __getOwnPropSymbols$A)
16185
+ for (var prop of __getOwnPropSymbols$A(source)) {
16186
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
16187
16187
  target[prop] = source[prop];
16188
16188
  }
16189
16189
  return target;
16190
16190
  };
16191
- var __publicField$G = (obj, key, value) => __defNormalProp$U(obj, key + "" , value);
16191
+ var __publicField$C = (obj, key, value) => __defNormalProp$R(obj, key + "" , value);
16192
16192
  class GeoJsonPaint {
16193
16193
  constructor(layer) {
16194
- __publicField$G(this, "layer");
16194
+ __publicField$C(this, "layer");
16195
16195
  this.layer = layer;
16196
16196
  }
16197
16197
  setPaintEachLayer(paint) {
@@ -16259,7 +16259,7 @@ var NgwLeaflet = (function () {
16259
16259
  return PAINT;
16260
16260
  }
16261
16261
  _createDivIcon(icon) {
16262
- const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$4(_a, ["html", "rotate", "className"]);
16262
+ const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$5(_a, ["html", "rotate", "className"]);
16263
16263
  const element = document.createElement("div");
16264
16264
  if (className) {
16265
16265
  element.className = className;
@@ -16270,7 +16270,7 @@ var NgwLeaflet = (function () {
16270
16270
  if (html) {
16271
16271
  element.innerHTML = html;
16272
16272
  }
16273
- const divIcon = new leafletSrcExports.DivIcon(__spreadProps$l(__spreadValues$x({
16273
+ const divIcon = new leafletSrcExports.DivIcon(__spreadProps$l(__spreadValues$z({
16274
16274
  className: ""
16275
16275
  }, toLIconOpt), {
16276
16276
  html: element
@@ -16296,7 +16296,7 @@ var NgwLeaflet = (function () {
16296
16296
  }
16297
16297
  return (_, latlng) => {
16298
16298
  const p = PAINT;
16299
- return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$x(__spreadValues$x({}, p), icon)));
16299
+ return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$z(__spreadValues$z({}, p), icon)));
16300
16300
  };
16301
16301
  }
16302
16302
  createPaintOptions(paint) {
@@ -16318,27 +16318,27 @@ var NgwLeaflet = (function () {
16318
16318
  }
16319
16319
  }
16320
16320
 
16321
- var __defProp$T = Object.defineProperty;
16321
+ var __defProp$Q = Object.defineProperty;
16322
16322
  var __defProps$k = Object.defineProperties;
16323
16323
  var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
16324
- var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
16325
- var __hasOwnProp$x = Object.prototype.hasOwnProperty;
16326
- var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
16327
- var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16328
- var __spreadValues$w = (a, b) => {
16324
+ var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
16325
+ var __hasOwnProp$z = Object.prototype.hasOwnProperty;
16326
+ var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
16327
+ var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16328
+ var __spreadValues$y = (a, b) => {
16329
16329
  for (var prop in b || (b = {}))
16330
- if (__hasOwnProp$x.call(b, prop))
16331
- __defNormalProp$T(a, prop, b[prop]);
16332
- if (__getOwnPropSymbols$x)
16333
- for (var prop of __getOwnPropSymbols$x(b)) {
16334
- if (__propIsEnum$x.call(b, prop))
16335
- __defNormalProp$T(a, prop, b[prop]);
16330
+ if (__hasOwnProp$z.call(b, prop))
16331
+ __defNormalProp$Q(a, prop, b[prop]);
16332
+ if (__getOwnPropSymbols$z)
16333
+ for (var prop of __getOwnPropSymbols$z(b)) {
16334
+ if (__propIsEnum$z.call(b, prop))
16335
+ __defNormalProp$Q(a, prop, b[prop]);
16336
16336
  }
16337
16337
  return a;
16338
16338
  };
16339
16339
  var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
16340
- var __publicField$F = (obj, key, value) => __defNormalProp$T(obj, typeof key !== "symbol" ? key + "" : key, value);
16341
- var __async$l = (__this, __arguments, generator) => {
16340
+ var __publicField$B = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
16341
+ var __async$s = (__this, __arguments, generator) => {
16342
16342
  return new Promise((resolve, reject) => {
16343
16343
  var fulfilled = (value) => {
16344
16344
  try {
@@ -16361,22 +16361,22 @@ var NgwLeaflet = (function () {
16361
16361
  class GeoJsonAdapter extends BaseAdapter {
16362
16362
  constructor(map, options) {
16363
16363
  super(map, options);
16364
- __publicField$F(this, "layer");
16365
- __publicField$F(this, "selected", false);
16366
- __publicField$F(this, "type");
16367
- __publicField$F(this, "_layers", []);
16368
- __publicField$F(this, "_events");
16369
- __publicField$F(this, "paint");
16370
- __publicField$F(this, "selectedPaint");
16371
- __publicField$F(this, "_selectedLayers", []);
16372
- __publicField$F(this, "_filteredLayers", []);
16373
- __publicField$F(this, "_filterFun");
16374
- __publicField$F(this, "_openedPopup", []);
16375
- __publicField$F(this, "_paint");
16376
- __publicField$F(this, "$updateTooltip", debounce(() => {
16364
+ __publicField$B(this, "layer");
16365
+ __publicField$B(this, "selected", false);
16366
+ __publicField$B(this, "type");
16367
+ __publicField$B(this, "_layers", []);
16368
+ __publicField$B(this, "_events");
16369
+ __publicField$B(this, "paint");
16370
+ __publicField$B(this, "selectedPaint");
16371
+ __publicField$B(this, "_selectedLayers", []);
16372
+ __publicField$B(this, "_filteredLayers", []);
16373
+ __publicField$B(this, "_filterFun");
16374
+ __publicField$B(this, "_openedPopup", []);
16375
+ __publicField$B(this, "_paint");
16376
+ __publicField$B(this, "$updateTooltip", debounce(() => {
16377
16377
  this.updateTooltip();
16378
16378
  }, 300));
16379
- __publicField$F(this, "$unselect", () => {
16379
+ __publicField$B(this, "$unselect", () => {
16380
16380
  this.unselect();
16381
16381
  });
16382
16382
  this._events = new GeoJsonEvents(this);
@@ -16385,7 +16385,7 @@ var NgwLeaflet = (function () {
16385
16385
  addLayer(options) {
16386
16386
  Object.assign(this.options, options);
16387
16387
  this.paint = options.paint;
16388
- this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$k(__spreadValues$w({}, options.nativeOptions), {
16388
+ this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$k(__spreadValues$y({}, options.nativeOptions), {
16389
16389
  pane: this.pane
16390
16390
  }));
16391
16391
  this.selectedPaint = options.selectedPaint;
@@ -16434,7 +16434,7 @@ var NgwLeaflet = (function () {
16434
16434
  }
16435
16435
  getSelected() {
16436
16436
  return this._selectedLayers.map((x) => {
16437
- return __spreadValues$w({
16437
+ return __spreadValues$y({
16438
16438
  target: this,
16439
16439
  feature: x.feature,
16440
16440
  layer: x
@@ -16453,14 +16453,14 @@ var NgwLeaflet = (function () {
16453
16453
  const filteredLayers = [];
16454
16454
  this._layers.forEach(({ feature, layer }) => {
16455
16455
  if (layer) {
16456
- const ok = fun ? fun(__spreadValues$w({
16456
+ const ok = fun ? fun(__spreadValues$y({
16457
16457
  target: this,
16458
16458
  feature,
16459
16459
  layer
16460
16460
  }, createFeaturePositionOptions(feature))) : true;
16461
16461
  if (ok) {
16462
16462
  layer_.addLayer(layer);
16463
- filteredLayers.push(__spreadValues$w({
16463
+ filteredLayers.push(__spreadValues$y({
16464
16464
  target: this,
16465
16465
  feature,
16466
16466
  layer
@@ -16481,7 +16481,7 @@ var NgwLeaflet = (function () {
16481
16481
  getLayers() {
16482
16482
  return this._layers.map(({ layer, feature }) => {
16483
16483
  const visible = layer && !!layer._map;
16484
- return __spreadValues$w({
16484
+ return __spreadValues$y({
16485
16485
  feature,
16486
16486
  layer,
16487
16487
  visible,
@@ -16599,13 +16599,13 @@ var NgwLeaflet = (function () {
16599
16599
  }
16600
16600
  }
16601
16601
  updatePaint(paint) {
16602
- this.paint = __spreadValues$w(__spreadValues$w({}, this.paint), paint);
16602
+ this.paint = __spreadValues$y(__spreadValues$y({}, this.paint), paint);
16603
16603
  for (const l of this._layers) {
16604
16604
  this._paint.setPaint(l, this.paint);
16605
16605
  }
16606
16606
  }
16607
16607
  updateSelectedPaint(paint) {
16608
- this.selectedPaint = __spreadValues$w(__spreadValues$w({}, this.selectedPaint), paint);
16608
+ this.selectedPaint = __spreadValues$y(__spreadValues$y({}, this.selectedPaint), paint);
16609
16609
  for (const l of this._selectedLayers) {
16610
16610
  this._paint.setPaint(l, this.selectedPaint);
16611
16611
  }
@@ -16622,7 +16622,7 @@ var NgwLeaflet = (function () {
16622
16622
  if (feature.properties && labelField) {
16623
16623
  message = feature.properties[labelField];
16624
16624
  } else if (label) {
16625
- message = label(__spreadValues$w(__spreadValues$w({
16625
+ message = label(__spreadValues$y(__spreadValues$y({
16626
16626
  target: this
16627
16627
  }, layerDef), createFeaturePositionOptions(feature)));
16628
16628
  }
@@ -16633,7 +16633,7 @@ var NgwLeaflet = (function () {
16633
16633
  }
16634
16634
  }
16635
16635
  _openPopup(_0) {
16636
- return __async$l(this, arguments, function* (def, options = {}, type, latLng) {
16636
+ return __async$s(this, arguments, function* (def, options = {}, type, latLng) {
16637
16637
  var _a, _b;
16638
16638
  const { feature, layer } = def;
16639
16639
  const {
@@ -16641,7 +16641,7 @@ var NgwLeaflet = (function () {
16641
16641
  autoPan,
16642
16642
  maxWidth,
16643
16643
  closeButton: closeButton_
16644
- } = __spreadValues$w({
16644
+ } = __spreadValues$y({
16645
16645
  minWidth: 300
16646
16646
  }, options);
16647
16647
  const closeButton = closeButton_ != null ? closeButton_ : !this.options.selectOnHover;
@@ -16657,7 +16657,7 @@ var NgwLeaflet = (function () {
16657
16657
  };
16658
16658
  let content;
16659
16659
  if (options.createPopupContent) {
16660
- content = yield options.createPopupContent(__spreadValues$w({
16660
+ content = yield options.createPopupContent(__spreadValues$y({
16661
16661
  layer,
16662
16662
  feature,
16663
16663
  target: this,
@@ -16733,9 +16733,9 @@ var NgwLeaflet = (function () {
16733
16733
  lopt = {
16734
16734
  style: (feature) => {
16735
16735
  if (feature) {
16736
- return this._paint.preparePaint(__spreadValues$w(__spreadValues$w({}, PAINT), paint(feature)));
16736
+ return this._paint.preparePaint(__spreadValues$y(__spreadValues$y({}, PAINT), paint(feature)));
16737
16737
  } else {
16738
- return this._paint.preparePaint(__spreadProps$k(__spreadValues$w({}, PAINT), { type: "path" }));
16738
+ return this._paint.preparePaint(__spreadProps$k(__spreadValues$y({}, PAINT), { type: "path" }));
16739
16739
  }
16740
16740
  }
16741
16741
  };
@@ -16751,7 +16751,7 @@ var NgwLeaflet = (function () {
16751
16751
  _onEachFeature(feature, layer) {
16752
16752
  const layer_ = this.layer;
16753
16753
  if (layer_) {
16754
- const def = __spreadValues$w({
16754
+ const def = __spreadValues$y({
16755
16755
  target: this,
16756
16756
  feature,
16757
16757
  layer
@@ -16786,7 +16786,7 @@ var NgwLeaflet = (function () {
16786
16786
  setTimeout(() => {
16787
16787
  if (popup) {
16788
16788
  this._openPopup(
16789
- __spreadValues$w({
16789
+ __spreadValues$y({
16790
16790
  target: this,
16791
16791
  layer,
16792
16792
  feature
@@ -16804,7 +16804,7 @@ var NgwLeaflet = (function () {
16804
16804
  leafletSrcExports.DomEvent.stopPropagation(e);
16805
16805
  const layer = e.target;
16806
16806
  const feature = layer.feature;
16807
- const def = __spreadValues$w({
16807
+ const def = __spreadValues$y({
16808
16808
  target: this,
16809
16809
  layer,
16810
16810
  feature
@@ -16837,7 +16837,7 @@ var NgwLeaflet = (function () {
16837
16837
  }
16838
16838
  if (this.options.onSelect) {
16839
16839
  const features = def.feature ? [def.feature] : [];
16840
- this.options.onSelect(__spreadValues$w({
16840
+ this.options.onSelect(__spreadValues$y({
16841
16841
  type,
16842
16842
  layer: this,
16843
16843
  features
@@ -16929,20 +16929,20 @@ var NgwLeaflet = (function () {
16929
16929
  return [promise, abortFunc];
16930
16930
  }
16931
16931
 
16932
- var __defProp$S = Object.defineProperty;
16933
- var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16934
- var __publicField$E = (obj, key, value) => __defNormalProp$S(obj, typeof key !== "symbol" ? key + "" : key, value);
16932
+ var __defProp$P = Object.defineProperty;
16933
+ var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16934
+ var __publicField$A = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
16935
16935
  class Queue {
16936
16936
  /**
16937
16937
  * @param {PromiseQueueOptions} options - Configuration options for the queue.
16938
16938
  */
16939
16939
  constructor({ concurrency = 1, delay = 0 } = {}) {
16940
- __publicField$E(this, "queue", []);
16941
- __publicField$E(this, "concurrency");
16942
- __publicField$E(this, "activeCount", 0);
16943
- __publicField$E(this, "timeoutId");
16944
- __publicField$E(this, "delay");
16945
- __publicField$E(this, "toAbort", []);
16940
+ __publicField$A(this, "queue", []);
16941
+ __publicField$A(this, "concurrency");
16942
+ __publicField$A(this, "activeCount", 0);
16943
+ __publicField$A(this, "timeoutId");
16944
+ __publicField$A(this, "delay");
16945
+ __publicField$A(this, "toAbort", []);
16946
16946
  this.concurrency = concurrency;
16947
16947
  this.delay = delay;
16948
16948
  }
@@ -17018,13 +17018,13 @@ var NgwLeaflet = (function () {
17018
17018
 
17019
17019
  const imageQueue = new Queue({ concurrency: 6, delay: 200 });
17020
17020
 
17021
- var __defProp$R = Object.defineProperty;
17022
- var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17023
- var __publicField$D = (obj, key, value) => __defNormalProp$R(obj, key + "" , value);
17021
+ var __defProp$O = Object.defineProperty;
17022
+ var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17023
+ var __publicField$z = (obj, key, value) => __defNormalProp$O(obj, key + "" , value);
17024
17024
  class ImageOverlay extends leafletSrcExports.ImageOverlay {
17025
17025
  constructor(imageUrl, bounds, options) {
17026
17026
  super(imageUrl, bounds, options);
17027
- __publicField$D(this, "_aborter");
17027
+ __publicField$z(this, "_aborter");
17028
17028
  }
17029
17029
  cancelLoad() {
17030
17030
  if (this._aborter) {
@@ -17053,13 +17053,13 @@ var NgwLeaflet = (function () {
17053
17053
  }
17054
17054
  }
17055
17055
 
17056
- var __defProp$Q = Object.defineProperty;
17057
- var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17058
- var __publicField$C = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
17056
+ var __defProp$N = Object.defineProperty;
17057
+ var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17058
+ var __publicField$y = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
17059
17059
  class ImageLayer extends leafletSrcExports.Layer {
17060
17060
  constructor(url, options) {
17061
17061
  super(options);
17062
- __publicField$C(this, "defaultWmsParams", {
17062
+ __publicField$y(this, "defaultWmsParams", {
17063
17063
  service: "WMS",
17064
17064
  request: "GetMap",
17065
17065
  version: "1.1.1",
@@ -17068,7 +17068,7 @@ var NgwLeaflet = (function () {
17068
17068
  format: "image/jpeg",
17069
17069
  transparent: false
17070
17070
  });
17071
- __publicField$C(this, "options", {
17071
+ __publicField$y(this, "options", {
17072
17072
  crs: null,
17073
17073
  uppercase: false,
17074
17074
  attribution: "",
@@ -17081,11 +17081,11 @@ var NgwLeaflet = (function () {
17081
17081
  viewPortBuffer: 0,
17082
17082
  setViewDelay: 100
17083
17083
  });
17084
- __publicField$C(this, "wmsParams");
17085
- __publicField$C(this, "_url");
17086
- __publicField$C(this, "_currentUrl");
17087
- __publicField$C(this, "_currentOverlay");
17088
- __publicField$C(this, "_loadedOverlay");
17084
+ __publicField$y(this, "wmsParams");
17085
+ __publicField$y(this, "_url");
17086
+ __publicField$y(this, "_currentUrl");
17087
+ __publicField$y(this, "_currentOverlay");
17088
+ __publicField$y(this, "_loadedOverlay");
17089
17089
  this._url = url;
17090
17090
  const params = {};
17091
17091
  const opts = {};
@@ -17245,34 +17245,34 @@ var NgwLeaflet = (function () {
17245
17245
  }
17246
17246
  }
17247
17247
 
17248
- var __defProp$P = Object.defineProperty;
17249
- var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
17250
- var __hasOwnProp$w = Object.prototype.hasOwnProperty;
17251
- var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
17252
- var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17253
- var __spreadValues$v = (a, b) => {
17248
+ var __defProp$M = Object.defineProperty;
17249
+ var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
17250
+ var __hasOwnProp$y = Object.prototype.hasOwnProperty;
17251
+ var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
17252
+ var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17253
+ var __spreadValues$x = (a, b) => {
17254
17254
  for (var prop in b || (b = {}))
17255
- if (__hasOwnProp$w.call(b, prop))
17256
- __defNormalProp$P(a, prop, b[prop]);
17257
- if (__getOwnPropSymbols$w)
17258
- for (var prop of __getOwnPropSymbols$w(b)) {
17259
- if (__propIsEnum$w.call(b, prop))
17260
- __defNormalProp$P(a, prop, b[prop]);
17255
+ if (__hasOwnProp$y.call(b, prop))
17256
+ __defNormalProp$M(a, prop, b[prop]);
17257
+ if (__getOwnPropSymbols$y)
17258
+ for (var prop of __getOwnPropSymbols$y(b)) {
17259
+ if (__propIsEnum$y.call(b, prop))
17260
+ __defNormalProp$M(a, prop, b[prop]);
17261
17261
  }
17262
17262
  return a;
17263
17263
  };
17264
- var __publicField$B = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
17264
+ var __publicField$x = (obj, key, value) => __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
17265
17265
  class ImageAdapter extends BaseAdapter {
17266
17266
  constructor() {
17267
17267
  super(...arguments);
17268
- __publicField$B(this, "layer");
17268
+ __publicField$x(this, "layer");
17269
17269
  }
17270
17270
  addLayer(options) {
17271
17271
  const url = options && options.url;
17272
17272
  if (url) {
17273
- options = __spreadValues$v({ transparent: true }, options);
17273
+ options = __spreadValues$x({ transparent: true }, options);
17274
17274
  const updateWmsParamsFromOpt = options.updateWmsParams;
17275
- this.layer = new ImageLayer(url, __spreadValues$v(__spreadValues$v(__spreadValues$v({
17275
+ this.layer = new ImageLayer(url, __spreadValues$x(__spreadValues$x(__spreadValues$x({
17276
17276
  pane: this.pane,
17277
17277
  headers: options.headers,
17278
17278
  setViewDelay: options.setViewDelay
@@ -17288,7 +17288,7 @@ var NgwLeaflet = (function () {
17288
17288
  }
17289
17289
  }
17290
17290
  }
17291
- __publicField$B(ImageAdapter, "queue", imageQueue);
17291
+ __publicField$x(ImageAdapter, "queue", imageQueue);
17292
17292
 
17293
17293
  function makeRemote(Base) {
17294
17294
  return class RemoteTileLayer extends Base {
@@ -17350,33 +17350,33 @@ var NgwLeaflet = (function () {
17350
17350
  }
17351
17351
  const TileLayer = makeRemote(TileLayerBase);
17352
17352
 
17353
- var __defProp$O = Object.defineProperty;
17353
+ var __defProp$L = Object.defineProperty;
17354
17354
  var __defProps$j = Object.defineProperties;
17355
17355
  var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
17356
- var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
17357
- var __hasOwnProp$v = Object.prototype.hasOwnProperty;
17358
- var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
17359
- var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17360
- var __spreadValues$u = (a, b) => {
17356
+ var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
17357
+ var __hasOwnProp$x = Object.prototype.hasOwnProperty;
17358
+ var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
17359
+ var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17360
+ var __spreadValues$w = (a, b) => {
17361
17361
  for (var prop in b || (b = {}))
17362
- if (__hasOwnProp$v.call(b, prop))
17363
- __defNormalProp$O(a, prop, b[prop]);
17364
- if (__getOwnPropSymbols$v)
17365
- for (var prop of __getOwnPropSymbols$v(b)) {
17366
- if (__propIsEnum$v.call(b, prop))
17367
- __defNormalProp$O(a, prop, b[prop]);
17362
+ if (__hasOwnProp$x.call(b, prop))
17363
+ __defNormalProp$L(a, prop, b[prop]);
17364
+ if (__getOwnPropSymbols$x)
17365
+ for (var prop of __getOwnPropSymbols$x(b)) {
17366
+ if (__propIsEnum$x.call(b, prop))
17367
+ __defNormalProp$L(a, prop, b[prop]);
17368
17368
  }
17369
17369
  return a;
17370
17370
  };
17371
17371
  var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
17372
- var __objRest$3 = (source, exclude) => {
17372
+ var __objRest$4 = (source, exclude) => {
17373
17373
  var target = {};
17374
17374
  for (var prop in source)
17375
- if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
17375
+ if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
17376
17376
  target[prop] = source[prop];
17377
- if (source != null && __getOwnPropSymbols$v)
17378
- for (var prop of __getOwnPropSymbols$v(source)) {
17379
- if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
17377
+ if (source != null && __getOwnPropSymbols$x)
17378
+ for (var prop of __getOwnPropSymbols$x(source)) {
17379
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
17380
17380
  target[prop] = source[prop];
17381
17381
  }
17382
17382
  return target;
@@ -17385,9 +17385,9 @@ var NgwLeaflet = (function () {
17385
17385
  addLayer(options) {
17386
17386
  this.options = Object.assign(this.options, options);
17387
17387
  if (options) {
17388
- const _a = options, { url } = _a, opt = __objRest$3(_a, ["url"]);
17388
+ const _a = options, { url } = _a, opt = __objRest$4(_a, ["url"]);
17389
17389
  if (url) {
17390
- const tileLayerOptions = __spreadValues$u({
17390
+ const tileLayerOptions = __spreadValues$w({
17391
17391
  pane: this.pane,
17392
17392
  attribution: opt.attribution,
17393
17393
  minZoom: opt.minZoom,
@@ -17398,7 +17398,7 @@ var NgwLeaflet = (function () {
17398
17398
  }
17399
17399
  let layer;
17400
17400
  if (opt.headers || opt.withCredentials) {
17401
- layer = new TileLayer(url, __spreadProps$j(__spreadValues$u({}, tileLayerOptions), {
17401
+ layer = new TileLayer(url, __spreadProps$j(__spreadValues$w({}, tileLayerOptions), {
17402
17402
  headers: opt.headers,
17403
17403
  withCredentials: opt.withCredentials,
17404
17404
  setViewDelay: opt.setViewDelay
@@ -17422,21 +17422,21 @@ var NgwLeaflet = (function () {
17422
17422
  }
17423
17423
  }
17424
17424
 
17425
- var __defProp$N = Object.defineProperty;
17425
+ var __defProp$K = Object.defineProperty;
17426
17426
  var __defProps$i = Object.defineProperties;
17427
17427
  var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
17428
- var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
17429
- var __hasOwnProp$u = Object.prototype.hasOwnProperty;
17430
- var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
17431
- var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17432
- var __spreadValues$t = (a, b) => {
17428
+ var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
17429
+ var __hasOwnProp$w = Object.prototype.hasOwnProperty;
17430
+ var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
17431
+ var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17432
+ var __spreadValues$v = (a, b) => {
17433
17433
  for (var prop in b || (b = {}))
17434
- if (__hasOwnProp$u.call(b, prop))
17435
- __defNormalProp$N(a, prop, b[prop]);
17436
- if (__getOwnPropSymbols$u)
17437
- for (var prop of __getOwnPropSymbols$u(b)) {
17438
- if (__propIsEnum$u.call(b, prop))
17439
- __defNormalProp$N(a, prop, b[prop]);
17434
+ if (__hasOwnProp$w.call(b, prop))
17435
+ __defNormalProp$K(a, prop, b[prop]);
17436
+ if (__getOwnPropSymbols$w)
17437
+ for (var prop of __getOwnPropSymbols$w(b)) {
17438
+ if (__propIsEnum$w.call(b, prop))
17439
+ __defNormalProp$K(a, prop, b[prop]);
17440
17440
  }
17441
17441
  return a;
17442
17442
  };
@@ -17444,7 +17444,7 @@ var NgwLeaflet = (function () {
17444
17444
  class OsmAdapter extends TileAdapter {
17445
17445
  addLayer(options) {
17446
17446
  const url = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
17447
- return super.addLayer(__spreadProps$i(__spreadValues$t({
17447
+ return super.addLayer(__spreadProps$i(__spreadValues$v({
17448
17448
  name: "OpenStreetMap",
17449
17449
  attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
17450
17450
  }, options), {
@@ -17460,33 +17460,33 @@ var NgwLeaflet = (function () {
17460
17460
  }
17461
17461
  const WmsLayer = makeRemote(WmsLayerBase);
17462
17462
 
17463
- var __defProp$M = Object.defineProperty;
17463
+ var __defProp$J = Object.defineProperty;
17464
17464
  var __defProps$h = Object.defineProperties;
17465
17465
  var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
17466
- var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
17467
- var __hasOwnProp$t = Object.prototype.hasOwnProperty;
17468
- var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
17469
- var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17470
- var __spreadValues$s = (a, b) => {
17471
- for (var prop in b || (b = {}))
17472
- if (__hasOwnProp$t.call(b, prop))
17473
- __defNormalProp$M(a, prop, b[prop]);
17474
- if (__getOwnPropSymbols$t)
17475
- for (var prop of __getOwnPropSymbols$t(b)) {
17476
- if (__propIsEnum$t.call(b, prop))
17477
- __defNormalProp$M(a, prop, b[prop]);
17466
+ var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
17467
+ var __hasOwnProp$v = Object.prototype.hasOwnProperty;
17468
+ var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
17469
+ var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17470
+ var __spreadValues$u = (a, b) => {
17471
+ for (var prop in b || (b = {}))
17472
+ if (__hasOwnProp$v.call(b, prop))
17473
+ __defNormalProp$J(a, prop, b[prop]);
17474
+ if (__getOwnPropSymbols$v)
17475
+ for (var prop of __getOwnPropSymbols$v(b)) {
17476
+ if (__propIsEnum$v.call(b, prop))
17477
+ __defNormalProp$J(a, prop, b[prop]);
17478
17478
  }
17479
17479
  return a;
17480
17480
  };
17481
17481
  var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
17482
- var __objRest$2 = (source, exclude) => {
17482
+ var __objRest$3 = (source, exclude) => {
17483
17483
  var target = {};
17484
17484
  for (var prop in source)
17485
- if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
17485
+ if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
17486
17486
  target[prop] = source[prop];
17487
- if (source != null && __getOwnPropSymbols$t)
17488
- for (var prop of __getOwnPropSymbols$t(source)) {
17489
- if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
17487
+ if (source != null && __getOwnPropSymbols$v)
17488
+ for (var prop of __getOwnPropSymbols$v(source)) {
17489
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
17490
17490
  target[prop] = source[prop];
17491
17491
  }
17492
17492
  return target;
@@ -17494,9 +17494,9 @@ var NgwLeaflet = (function () {
17494
17494
  class WmsAdapter extends BaseAdapter {
17495
17495
  addLayer(options) {
17496
17496
  Object.assign(this.options, options);
17497
- const _a = options, { url } = _a, opt = __objRest$2(_a, ["url"]);
17497
+ const _a = options, { url } = _a, opt = __objRest$3(_a, ["url"]);
17498
17498
  if (url) {
17499
- const layerOptions = __spreadValues$s({
17499
+ const layerOptions = __spreadValues$u({
17500
17500
  pane: this.pane,
17501
17501
  attribution: opt.attribution,
17502
17502
  minZoom: opt.minZoom,
@@ -17507,7 +17507,7 @@ var NgwLeaflet = (function () {
17507
17507
  }, options.nativeOptions);
17508
17508
  let layer;
17509
17509
  if (opt.headers || opt.withCredentials) {
17510
- layer = new WmsLayer(url, __spreadProps$h(__spreadValues$s({}, layerOptions), {
17510
+ layer = new WmsLayer(url, __spreadProps$h(__spreadValues$u({}, layerOptions), {
17511
17511
  headers: opt.headers,
17512
17512
  withCredentials: opt.withCredentials
17513
17513
  }));
@@ -17527,33 +17527,33 @@ var NgwLeaflet = (function () {
17527
17527
  ];
17528
17528
  }
17529
17529
 
17530
- var __defProp$L = Object.defineProperty;
17531
- var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
17532
- var __hasOwnProp$s = Object.prototype.hasOwnProperty;
17533
- var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
17534
- var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17535
- var __spreadValues$r = (a, b) => {
17530
+ var __defProp$I = Object.defineProperty;
17531
+ var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
17532
+ var __hasOwnProp$u = Object.prototype.hasOwnProperty;
17533
+ var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
17534
+ var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17535
+ var __spreadValues$t = (a, b) => {
17536
17536
  for (var prop in b || (b = {}))
17537
- if (__hasOwnProp$s.call(b, prop))
17538
- __defNormalProp$L(a, prop, b[prop]);
17539
- if (__getOwnPropSymbols$s)
17540
- for (var prop of __getOwnPropSymbols$s(b)) {
17541
- if (__propIsEnum$s.call(b, prop))
17542
- __defNormalProp$L(a, prop, b[prop]);
17537
+ if (__hasOwnProp$u.call(b, prop))
17538
+ __defNormalProp$I(a, prop, b[prop]);
17539
+ if (__getOwnPropSymbols$u)
17540
+ for (var prop of __getOwnPropSymbols$u(b)) {
17541
+ if (__propIsEnum$u.call(b, prop))
17542
+ __defNormalProp$I(a, prop, b[prop]);
17543
17543
  }
17544
17544
  return a;
17545
17545
  };
17546
- var __publicField$A = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
17546
+ var __publicField$w = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
17547
17547
  const _LeafletMapAdapter = class _LeafletMapAdapter {
17548
17548
  constructor() {
17549
- __publicField$A(this, "options", { target: "map" });
17550
- __publicField$A(this, "layerAdapters", _LeafletMapAdapter.layerAdapters);
17551
- __publicField$A(this, "controlAdapters", _LeafletMapAdapter.controlAdapters);
17552
- __publicField$A(this, "emitter", new EventEmitter());
17553
- __publicField$A(this, "map");
17554
- __publicField$A(this, "_resizeObserver");
17555
- __publicField$A(this, "_unselectCb", []);
17556
- __publicField$A(this, "_universalEvents", [
17549
+ __publicField$w(this, "options", { target: "map" });
17550
+ __publicField$w(this, "layerAdapters", _LeafletMapAdapter.layerAdapters);
17551
+ __publicField$w(this, "controlAdapters", _LeafletMapAdapter.controlAdapters);
17552
+ __publicField$w(this, "emitter", new EventEmitter());
17553
+ __publicField$w(this, "map");
17554
+ __publicField$w(this, "_resizeObserver");
17555
+ __publicField$w(this, "_unselectCb", []);
17556
+ __publicField$w(this, "_universalEvents", [
17557
17557
  "move",
17558
17558
  "zoom",
17559
17559
  "zoomend",
@@ -17561,14 +17561,14 @@ var NgwLeaflet = (function () {
17561
17561
  "moveend",
17562
17562
  "movestart"
17563
17563
  ]);
17564
- __publicField$A(this, "_positionEvents", [
17564
+ __publicField$w(this, "_positionEvents", [
17565
17565
  "mousemove",
17566
17566
  "mouseout",
17567
17567
  "mouseover"
17568
17568
  ]);
17569
17569
  }
17570
17570
  create(options) {
17571
- this.options = __spreadValues$r({}, options);
17571
+ this.options = __spreadValues$t({}, options);
17572
17572
  if (this.options.target) {
17573
17573
  const {
17574
17574
  zoom,
@@ -17578,7 +17578,7 @@ var NgwLeaflet = (function () {
17578
17578
  maxBounds: mb,
17579
17579
  mapAdapterOptions
17580
17580
  } = this.options;
17581
- this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$r({
17581
+ this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$t({
17582
17582
  attributionControl: false,
17583
17583
  zoomControl: false,
17584
17584
  maxBounds: mb ? arrayToBoundsExpression(mb) : void 0,
@@ -17861,7 +17861,7 @@ var NgwLeaflet = (function () {
17861
17861
  }
17862
17862
  }
17863
17863
  };
17864
- __publicField$A(_LeafletMapAdapter, "layerAdapters", {
17864
+ __publicField$w(_LeafletMapAdapter, "layerAdapters", {
17865
17865
  GEOJSON: GeoJsonAdapter,
17866
17866
  IMAGE: ImageAdapter,
17867
17867
  TILE: TileAdapter,
@@ -17869,315 +17869,13 @@ var NgwLeaflet = (function () {
17869
17869
  // // MVT: MvtAdapter,
17870
17870
  OSM: OsmAdapter
17871
17871
  });
17872
- __publicField$A(_LeafletMapAdapter, "controlAdapters", {
17872
+ __publicField$w(_LeafletMapAdapter, "controlAdapters", {
17873
17873
  ZOOM: leafletSrcExports.Control.Zoom,
17874
17874
  ATTRIBUTION: AttributionControl
17875
17875
  });
17876
- __publicField$A(_LeafletMapAdapter, "Map", leafletSrcExports.Map);
17876
+ __publicField$w(_LeafletMapAdapter, "Map", leafletSrcExports.Map);
17877
17877
  let LeafletMapAdapter = _LeafletMapAdapter;
17878
17878
 
17879
- var __defProp$K = Object.defineProperty;
17880
- var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17881
- var __publicField$z = (obj, key, value) => __defNormalProp$K(obj, key + "" , value);
17882
- class CancelError extends Error {
17883
- constructor() {
17884
- super();
17885
- __publicField$z(this, "name", "CancelError");
17886
- Object.setPrototypeOf(this, CancelError.prototype);
17887
- }
17888
- }
17889
-
17890
- var __defProp$J = Object.defineProperty;
17891
- var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17892
- var __publicField$y = (obj, key, value) => __defNormalProp$J(obj, key + "" , value);
17893
- class PromiseControl {
17894
- constructor(options = {}) {
17895
- this.options = options;
17896
- __publicField$y(this, "_promises", /* @__PURE__ */ new Map());
17897
- }
17898
- get isLoaded() {
17899
- return this._promises.size > 0;
17900
- }
17901
- remove(promise) {
17902
- if (this._promises.has(promise)) {
17903
- this._promises.delete(promise);
17904
- this._onStop();
17905
- }
17906
- }
17907
- get(promise) {
17908
- return this._promises.get(promise);
17909
- }
17910
- add(promise, name) {
17911
- const key = name ? name : promise;
17912
- const exist = this._promises.get(key);
17913
- if (this.options.onStart && !this.isLoaded) {
17914
- this.options.onStart();
17915
- }
17916
- if (exist) {
17917
- return exist;
17918
- }
17919
- this._promises.set(key, promise);
17920
- promise.finally(() => {
17921
- this.remove(key);
17922
- });
17923
- return promise;
17924
- }
17925
- abort() {
17926
- if (this.isLoaded) {
17927
- this._promises.forEach((x) => {
17928
- if (x.cancel) {
17929
- x.cancel();
17930
- }
17931
- });
17932
- this._promises.clear();
17933
- this._onStop();
17934
- }
17935
- }
17936
- waitFunc(func, name = "") {
17937
- name = name || func.name;
17938
- const exist = this.get(name);
17939
- if (exist) {
17940
- return exist;
17941
- }
17942
- return this.add(func(), name);
17943
- }
17944
- WaitForMe(name = "") {
17945
- const get = this.get.bind(this);
17946
- const add = this.add.bind(this);
17947
- return function(target, key, descriptor) {
17948
- const originalMethod = descriptor.value;
17949
- name = name || key;
17950
- descriptor.value = function(...args) {
17951
- const exist = get(name);
17952
- if (exist) {
17953
- return exist;
17954
- }
17955
- const result = add(originalMethod.apply(this, args), name);
17956
- return result;
17957
- };
17958
- return descriptor;
17959
- };
17960
- }
17961
- /** @deprecated use {@link PromiseControl.WaitForMe } instead */
17962
- GetOrCreateDecorator(name = "") {
17963
- return this.WaitForMe(name);
17964
- }
17965
- _onStop() {
17966
- if (this.options.onStop && !this.isLoaded) {
17967
- this.options.onStop();
17968
- }
17969
- }
17970
- }
17971
-
17972
- var __defProp$I = Object.defineProperty;
17973
- var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17974
- var __publicField$x = (obj, key, value) => __defNormalProp$I(obj, key + "" , value);
17975
- class TimeoutError extends Error {
17976
- constructor() {
17977
- super();
17978
- __publicField$x(this, "name", "TimeoutError");
17979
- Object.setPrototypeOf(this, TimeoutError.prototype);
17980
- }
17981
- }
17982
-
17983
- var __defProp$H = Object.defineProperty;
17984
- var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17985
- var __publicField$w = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
17986
- var _a;
17987
- const handleCallback = (resolve, reject, callback, r) => {
17988
- try {
17989
- resolve(callback(r));
17990
- } catch (e) {
17991
- reject(e);
17992
- }
17993
- };
17994
- let ID$3 = 0;
17995
- _a = Symbol.toStringTag;
17996
- const _CancelablePromise = class _CancelablePromise {
17997
- constructor(executor, timeout) {
17998
- // @ts-ignore
17999
- __publicField$w(this, _a);
18000
- __publicField$w(this, "id", ID$3++);
18001
- __publicField$w(this, "_isCanceled", false);
18002
- __publicField$w(this, "_isPending", true);
18003
- __publicField$w(this, "_promise");
18004
- __publicField$w(this, "_cancelPromise");
18005
- __publicField$w(this, "_cancelHandlers", []);
18006
- __publicField$w(this, "_setCanceledCallback");
18007
- __publicField$w(this, "_parentPromise");
18008
- __publicField$w(this, "_children", []);
18009
- this._cancelPromise = new Promise((resolve_, reject_) => {
18010
- this._setCanceledCallback = (er) => resolve_(er || new CancelError());
18011
- });
18012
- const promises = [
18013
- this._cancelPromise,
18014
- new Promise((resolve, reject) => {
18015
- const onResolve = (value) => {
18016
- if (value instanceof _CancelablePromise) {
18017
- this.attach(value);
18018
- } else {
18019
- this._isPending = false;
18020
- }
18021
- resolve(value);
18022
- };
18023
- const onReject = (error) => {
18024
- this._isPending = false;
18025
- reject(error);
18026
- };
18027
- const onCancel = (handler) => {
18028
- if (!this._isPending) {
18029
- throw new Error(
18030
- "The `onCancel` handler was attached after the promise settled."
18031
- );
18032
- }
18033
- this._cancelHandlers.push(handler);
18034
- };
18035
- return executor(onResolve, onReject, onCancel);
18036
- })
18037
- ];
18038
- if (timeout) {
18039
- promises.push(
18040
- new Promise((resolve, reject) => {
18041
- setTimeout(() => {
18042
- if (this._isPending) {
18043
- try {
18044
- this.cancel();
18045
- } finally {
18046
- reject(new TimeoutError());
18047
- }
18048
- }
18049
- }, timeout);
18050
- })
18051
- );
18052
- }
18053
- this._promise = Promise.race(promises);
18054
- }
18055
- static createControl(opt) {
18056
- return new PromiseControl(opt);
18057
- }
18058
- static resolve(value) {
18059
- return new _CancelablePromise((resolve) => resolve(value));
18060
- }
18061
- static reject(value) {
18062
- return new _CancelablePromise((resolve, reject) => reject(value));
18063
- }
18064
- static all(values) {
18065
- return new _CancelablePromise((resolve, reject) => {
18066
- Promise.all(values).then(resolve).catch(reject);
18067
- }).catch((er) => {
18068
- if (er instanceof this.CancelError) {
18069
- for (const v of values) {
18070
- const v_ = v;
18071
- if ("cancel" in v_) {
18072
- v_.cancel();
18073
- }
18074
- }
18075
- }
18076
- throw er;
18077
- });
18078
- }
18079
- attach(p) {
18080
- if (this._isCanceled) {
18081
- p.cancel();
18082
- } else {
18083
- this._children.push(p);
18084
- }
18085
- }
18086
- then(onfulfilled, onrejected) {
18087
- const p = new _CancelablePromise((resolve, reject) => {
18088
- if (this._promise) {
18089
- const reject_ = (r) => {
18090
- if (onrejected) {
18091
- handleCallback(resolve, reject, onrejected, r);
18092
- } else {
18093
- reject(r);
18094
- }
18095
- };
18096
- this._promise.then((r) => {
18097
- if (this._isCanceled) {
18098
- reject_(r);
18099
- } else {
18100
- if (onfulfilled) {
18101
- handleCallback(resolve, reject, onfulfilled, r);
18102
- } else {
18103
- resolve(r);
18104
- }
18105
- }
18106
- }, reject_);
18107
- }
18108
- });
18109
- p._parentPromise = this;
18110
- this._children.push(p);
18111
- return p;
18112
- }
18113
- catch(onrejected) {
18114
- if (this._isCanceled && onrejected) {
18115
- onrejected(new CancelError());
18116
- }
18117
- return this.then(void 0, onrejected);
18118
- }
18119
- finally(onfinally) {
18120
- if (this._promise) {
18121
- return this._promise.finally(onfinally);
18122
- }
18123
- if (this._isCanceled) {
18124
- return Promise.reject(new CancelError());
18125
- }
18126
- return Promise.reject(onfinally);
18127
- }
18128
- cancel() {
18129
- if (this._isCanceled || !this._isPending) {
18130
- return this;
18131
- }
18132
- this._isCanceled = true;
18133
- const parent = this._getTopParent();
18134
- if (parent) {
18135
- parent.cancel();
18136
- }
18137
- if (this._children) {
18138
- this._children.forEach((x) => x.cancel());
18139
- }
18140
- if (this._isPending) {
18141
- if (this._cancelHandlers.length) {
18142
- try {
18143
- for (const handler of this._cancelHandlers) {
18144
- handler();
18145
- }
18146
- } catch (error) {
18147
- }
18148
- }
18149
- if (this._setCanceledCallback) {
18150
- this._setCanceledCallback();
18151
- }
18152
- }
18153
- this._destroy();
18154
- return this;
18155
- }
18156
- _getTopParent() {
18157
- let parent = this._parentPromise;
18158
- let hasParent = !!parent;
18159
- while (hasParent) {
18160
- if (parent && parent._parentPromise) {
18161
- parent = parent._parentPromise;
18162
- hasParent = !!parent;
18163
- } else {
18164
- hasParent = false;
18165
- }
18166
- }
18167
- return parent;
18168
- }
18169
- _destroy() {
18170
- this._setCanceledCallback = void 0;
18171
- this._cancelPromise = void 0;
18172
- this._promise = void 0;
18173
- }
18174
- };
18175
- __publicField$w(_CancelablePromise, "CancelError", CancelError);
18176
- __publicField$w(_CancelablePromise, "TimeoutError", TimeoutError);
18177
- __publicField$w(_CancelablePromise, "PromiseControl", PromiseControl);
18178
- let CancelablePromise = _CancelablePromise;
18179
- Object.setPrototypeOf(CancelablePromise.prototype, Promise.prototype);
18180
-
18181
17879
  const svgPath = {
18182
17880
  brill: '<path d="m6 0-5 6 5 6 5-6z"/>',
18183
17881
  circle: '<circle cx="6" cy="6" r="6"/>',
@@ -18250,9 +17948,9 @@ var NgwLeaflet = (function () {
18250
17948
  };
18251
17949
  }
18252
17950
 
18253
- var __defProp$G = Object.defineProperty;
18254
- var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18255
- var __publicField$v = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
17951
+ var __defProp$H = Object.defineProperty;
17952
+ var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17953
+ var __publicField$v = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
18256
17954
  const _Cache = class _Cache {
18257
17955
  constructor(options = {}) {
18258
17956
  __publicField$v(this, "cache", []);
@@ -18288,8 +17986,7 @@ var NgwLeaflet = (function () {
18288
17986
  * // somewhere else in the code
18289
17987
  * const item = await cache.addFull('foo', getItemFunc).then((resp) => {
18290
17988
  * console.log(resp); // 'New item'
18291
- * })
18292
- *
17989
+ * });
18293
17990
  * ```
18294
17991
  */
18295
17992
  addFull(key, valueToSet, props) {
@@ -18304,13 +18001,11 @@ var NgwLeaflet = (function () {
18304
18001
  } else {
18305
18002
  value = valueToSet;
18306
18003
  }
18307
- const props_ = props && JSON.parse(JSON.stringify(objectRemoveEmpty(props)));
18004
+ const nonEmptyProps = props && JSON.parse(JSON.stringify(objectRemoveEmpty(props)));
18308
18005
  const cacheItem = {
18309
18006
  key,
18310
18007
  value,
18311
- props: props_,
18312
- // TODO: remove backward compatibility use only props
18313
- options: props_
18008
+ props: nonEmptyProps
18314
18009
  };
18315
18010
  if (onlyFull && !full(value)) {
18316
18011
  return value;
@@ -18319,7 +18014,6 @@ var NgwLeaflet = (function () {
18319
18014
  if (value instanceof Promise) {
18320
18015
  value.catch((er) => {
18321
18016
  this.delete(key, props);
18322
- throw er;
18323
18017
  });
18324
18018
  if (onlyFull) {
18325
18019
  value.then((x) => {
@@ -18338,9 +18032,7 @@ var NgwLeaflet = (function () {
18338
18032
  }
18339
18033
  match(key, props) {
18340
18034
  const cacheRecord = this._find(key, props);
18341
- if (cacheRecord) {
18342
- return cacheRecord.value;
18343
- }
18035
+ return cacheRecord == null ? void 0 : cacheRecord.value;
18344
18036
  }
18345
18037
  matchAll(key, props) {
18346
18038
  if (key) {
@@ -18349,37 +18041,30 @@ var NgwLeaflet = (function () {
18349
18041
  return this.cache.map((x) => x.value);
18350
18042
  }
18351
18043
  delete(keyOrItem, props) {
18352
- let exist = [];
18353
- if (typeof keyOrItem === "string") {
18354
- exist = this.cache.filter((x) => this._filter(x, keyOrItem, props));
18355
- } else {
18356
- exist.push(keyOrItem);
18357
- }
18358
- for (const e of exist) {
18359
- const index = this.cache.indexOf(e);
18360
- this.cache.splice(index, 1);
18044
+ const itemsToDelete = typeof keyOrItem === "string" ? this.cache.filter((x) => this._filter(x, keyOrItem, props)) : [keyOrItem];
18045
+ for (const item of itemsToDelete) {
18046
+ const index = this.cache.indexOf(item);
18047
+ if (index !== -1) {
18048
+ this.cache.splice(index, 1);
18049
+ }
18361
18050
  }
18362
18051
  }
18363
18052
  _find(key, props) {
18364
18053
  return this.cache.find((x) => this._filter(x, key, props));
18365
18054
  }
18366
18055
  _filter(item, key, props) {
18367
- if (item.key === key) {
18368
- if (props) {
18369
- const itemProps = item.props || item.options;
18370
- return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
18371
- }
18372
- return true;
18373
- }
18374
- return false;
18056
+ if (item.key !== key) return false;
18057
+ if (!props) return true;
18058
+ const itemProps = item.props;
18059
+ return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
18375
18060
  }
18376
18061
  };
18377
18062
  __publicField$v(_Cache, "instance", {});
18378
18063
  let Cache = _Cache;
18379
18064
 
18380
- var __defProp$F = Object.defineProperty;
18381
- var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18382
- var __publicField$u = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18065
+ var __defProp$G = Object.defineProperty;
18066
+ var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18067
+ var __publicField$u = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
18383
18068
  class NgwError extends Error {
18384
18069
  constructor(er) {
18385
18070
  super();
@@ -18396,9 +18081,9 @@ var NgwLeaflet = (function () {
18396
18081
  }
18397
18082
  }
18398
18083
 
18399
- var __defProp$E = Object.defineProperty;
18400
- var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18401
- var __publicField$t = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18084
+ var __defProp$F = Object.defineProperty;
18085
+ var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18086
+ var __publicField$t = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18402
18087
  class ResourceNotFoundError extends NgwError {
18403
18088
  constructor(obj) {
18404
18089
  super(obj);
@@ -18437,27 +18122,24 @@ var NgwLeaflet = (function () {
18437
18122
  return query;
18438
18123
  }
18439
18124
 
18440
- var __defProp$D = Object.defineProperty;
18441
- var __defProps$g = Object.defineProperties;
18442
- var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
18443
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
18444
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
18445
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
18446
- var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18447
- var __spreadValues$q = (a, b) => {
18125
+ var __defProp$E = Object.defineProperty;
18126
+ var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
18127
+ var __hasOwnProp$t = Object.prototype.hasOwnProperty;
18128
+ var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
18129
+ var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18130
+ var __spreadValues$s = (a, b) => {
18448
18131
  for (var prop in b || (b = {}))
18449
- if (__hasOwnProp$r.call(b, prop))
18450
- __defNormalProp$D(a, prop, b[prop]);
18451
- if (__getOwnPropSymbols$r)
18452
- for (var prop of __getOwnPropSymbols$r(b)) {
18453
- if (__propIsEnum$r.call(b, prop))
18454
- __defNormalProp$D(a, prop, b[prop]);
18132
+ if (__hasOwnProp$t.call(b, prop))
18133
+ __defNormalProp$E(a, prop, b[prop]);
18134
+ if (__getOwnPropSymbols$t)
18135
+ for (var prop of __getOwnPropSymbols$t(b)) {
18136
+ if (__propIsEnum$t.call(b, prop))
18137
+ __defNormalProp$E(a, prop, b[prop]);
18455
18138
  }
18456
18139
  return a;
18457
18140
  };
18458
- var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
18459
- var __publicField$s = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18460
- var __async$k = (__this, __arguments, generator) => {
18141
+ var __publicField$s = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18142
+ var __async$r = (__this, __arguments, generator) => {
18461
18143
  return new Promise((resolve, reject) => {
18462
18144
  var fulfilled = (value) => {
18463
18145
  try {
@@ -18498,39 +18180,27 @@ var NgwLeaflet = (function () {
18498
18180
  * Fetching resource would be cached to speed up next call
18499
18181
  */
18500
18182
  getOne(resource, requestOptions) {
18501
- const cache = this.cache;
18502
- const forCache = {};
18503
- const opt = __spreadProps$g(__spreadValues$q({}, requestOptions), { cache: false });
18504
- if (typeof resource === "string") {
18505
- forCache.keyname = resource;
18506
- } else if (typeof resource === "number") {
18507
- forCache.id = resource;
18508
- } else if (isObject(resource)) {
18183
+ const opt = __spreadValues$s({}, requestOptions);
18184
+ if (typeof resource === "string") ; else if (typeof resource === "number") ; else if (isObject(resource)) {
18509
18185
  if (resource.id !== void 0) {
18510
- forCache.id = resource.id;
18186
+ resource.id;
18511
18187
  } else {
18512
18188
  if (resource.keyname) {
18513
- forCache.keyname = resource.keyname;
18189
+ resource.keyname;
18514
18190
  }
18515
18191
  if (resource.display_name) {
18516
- forCache.display_name = resource.display_name;
18192
+ resource.display_name;
18517
18193
  }
18518
18194
  }
18519
18195
  }
18520
- const makeRequest = () => {
18521
- if (typeof resource === "string") {
18522
- return this._fetchResourceBy({ keyname: resource }, opt);
18523
- } else if (typeof resource === "number") {
18524
- return this._fetchResourceById(resource, opt);
18525
- } else if (isObject(resource)) {
18526
- return this._fetchResourceBy(resource, opt);
18527
- }
18528
- return CancelablePromise.resolve(void 0);
18529
- };
18530
- if (requestOptions == null ? void 0 : requestOptions.cache) {
18531
- return cache.addFull("resource", makeRequest, forCache);
18196
+ if (typeof resource === "string") {
18197
+ return this._fetchResourceBy({ keyname: resource }, opt);
18198
+ } else if (typeof resource === "number") {
18199
+ return this._fetchResourceById(resource, opt);
18200
+ } else if (isObject(resource)) {
18201
+ return this._fetchResourceBy(resource, opt);
18532
18202
  }
18533
- return makeRequest();
18203
+ return Promise.resolve(void 0);
18534
18204
  }
18535
18205
  getOneOrFail(resource, requestOptions) {
18536
18206
  return this.getOne(resource, requestOptions).then((res) => {
@@ -18552,7 +18222,7 @@ var NgwLeaflet = (function () {
18552
18222
  */
18553
18223
  getId(resource, requestOptions) {
18554
18224
  if (typeof resource === "number") {
18555
- return CancelablePromise.resolve(resource);
18225
+ return Promise.resolve(resource);
18556
18226
  } else if (typeof resource === "string" || isObject(resource)) {
18557
18227
  return this.getOne(resource, requestOptions).then((res) => {
18558
18228
  if (res) {
@@ -18560,7 +18230,7 @@ var NgwLeaflet = (function () {
18560
18230
  }
18561
18231
  });
18562
18232
  }
18563
- return CancelablePromise.resolve(void 0);
18233
+ return Promise.resolve(void 0);
18564
18234
  }
18565
18235
  /**
18566
18236
  * A fast way to retrieve resource ID for any resource definition.
@@ -18587,12 +18257,12 @@ var NgwLeaflet = (function () {
18587
18257
  } else {
18588
18258
  Object.assign(query, resourceToQuery(resource));
18589
18259
  }
18590
- return this.connector.get("resource.search", requestOptions, __spreadValues$q({
18260
+ return this.connector.get("resource.search", requestOptions, __spreadValues$s({
18591
18261
  serialization: "full"
18592
18262
  }, query)).then((resources) => {
18593
- if (resources) {
18263
+ if ((requestOptions == null ? void 0 : requestOptions.cache) && resources) {
18594
18264
  for (const x of resources) {
18595
- this.cache.add("resource.item", CancelablePromise.resolve(x), {
18265
+ this.cache.add("resource.item", Promise.resolve(x), {
18596
18266
  id: x.resource.id
18597
18267
  });
18598
18268
  }
@@ -18608,7 +18278,7 @@ var NgwLeaflet = (function () {
18608
18278
  if (child) {
18609
18279
  return this.getOne(child.resource.parent.id, requestOptions);
18610
18280
  }
18611
- return CancelablePromise.resolve(void 0);
18281
+ return Promise.resolve(void 0);
18612
18282
  });
18613
18283
  }
18614
18284
  getChildrenOf(resource, requestOptions) {
@@ -18638,18 +18308,16 @@ var NgwLeaflet = (function () {
18638
18308
  });
18639
18309
  }
18640
18310
  _getChildrenOf(parent, requestOptions, _items = []) {
18641
- return this.connector.get(
18642
- "resource.collection",
18643
- __spreadValues$q({ cache: true }, requestOptions),
18644
- {
18645
- parent
18646
- }
18647
- ).then((items) => {
18311
+ return this.connector.get("resource.collection", requestOptions, {
18312
+ parent
18313
+ }).then((items) => {
18648
18314
  const recursivePromises = [];
18649
18315
  for (const item of items) {
18650
- this.cache.add("resource.item", CancelablePromise.resolve(item), {
18651
- id: item.resource.id
18652
- });
18316
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
18317
+ this.cache.add("resource.item", Promise.resolve(item), {
18318
+ id: item.resource.id
18319
+ });
18320
+ }
18653
18321
  _items.push(item);
18654
18322
  if ((requestOptions == null ? void 0 : requestOptions.recursive) && item.resource.children) {
18655
18323
  recursivePromises.push(
@@ -18658,7 +18326,7 @@ var NgwLeaflet = (function () {
18658
18326
  }
18659
18327
  }
18660
18328
  if (recursivePromises.length) {
18661
- return CancelablePromise.all(recursivePromises).then(() => {
18329
+ return Promise.all(recursivePromises).then(() => {
18662
18330
  return _items;
18663
18331
  });
18664
18332
  }
@@ -18666,11 +18334,12 @@ var NgwLeaflet = (function () {
18666
18334
  });
18667
18335
  }
18668
18336
  _cleanResourceItemCache(id) {
18669
- return __async$k(this, null, function* () {
18337
+ return __async$r(this, null, function* () {
18338
+ var _a;
18670
18339
  const all = this.cache.all();
18671
18340
  const toDelete = [];
18672
18341
  for (const c of all) {
18673
- const cid = c.options && c.options.id;
18342
+ const cid = (_a = c.props) == null ? void 0 : _a.id;
18674
18343
  if (["resource.item", "resource"].includes(c.key) && cid !== void 0) {
18675
18344
  if (typeof cid === "number") {
18676
18345
  if (cid === id) {
@@ -18690,18 +18359,7 @@ var NgwLeaflet = (function () {
18690
18359
  });
18691
18360
  }
18692
18361
  _fetchResourceById(id, requestOptions) {
18693
- const promise = () => this.connector.get("resource.item", requestOptions, { id });
18694
- if (requestOptions == null ? void 0 : requestOptions.cache) {
18695
- return this.cache.add("resource.item", promise, {
18696
- id
18697
- }).catch((er) => {
18698
- if (!(er instanceof ResourceNotFoundError)) {
18699
- throw er;
18700
- }
18701
- return void 0;
18702
- });
18703
- }
18704
- return promise();
18362
+ return this.connector.get("resource.item", requestOptions, { id });
18705
18363
  }
18706
18364
  _fetchResourceBy(resource, requestOptions) {
18707
18365
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -18709,7 +18367,7 @@ var NgwLeaflet = (function () {
18709
18367
  });
18710
18368
  }
18711
18369
  _resourceCacheFilter(resource) {
18712
- return CancelablePromise.all(this.cache.matchAll("resource.item")).then(
18370
+ return Promise.all(this.cache.matchAll("resource.item")).then(
18713
18371
  (resources) => {
18714
18372
  const items = [];
18715
18373
  resources.filter((x) => {
@@ -18753,9 +18411,16 @@ var NgwLeaflet = (function () {
18753
18411
  }
18754
18412
  }
18755
18413
 
18756
- var __defProp$C = Object.defineProperty;
18757
- var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18758
- var __publicField$r = (obj, key, value) => __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
18414
+ class AbortError extends Error {
18415
+ constructor(message = "AbortError") {
18416
+ super(message);
18417
+ this.name = "AbortError";
18418
+ }
18419
+ }
18420
+
18421
+ var __defProp$D = Object.defineProperty;
18422
+ var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18423
+ var __publicField$r = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18759
18424
  class InsufficientPermissionsError extends NgwError {
18760
18425
  constructor(obj) {
18761
18426
  super(obj);
@@ -18778,58 +18443,90 @@ var NgwLeaflet = (function () {
18778
18443
  });
18779
18444
  }
18780
18445
 
18446
+ var __defProp$C = Object.defineProperty;
18447
+ var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
18448
+ var __hasOwnProp$s = Object.prototype.hasOwnProperty;
18449
+ var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
18450
+ var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18451
+ var __spreadValues$r = (a, b) => {
18452
+ for (var prop in b || (b = {}))
18453
+ if (__hasOwnProp$s.call(b, prop))
18454
+ __defNormalProp$C(a, prop, b[prop]);
18455
+ if (__getOwnPropSymbols$s)
18456
+ for (var prop of __getOwnPropSymbols$s(b)) {
18457
+ if (__propIsEnum$s.call(b, prop))
18458
+ __defNormalProp$C(a, prop, b[prop]);
18459
+ }
18460
+ return a;
18461
+ };
18462
+ var __async$q = (__this, __arguments, generator) => {
18463
+ return new Promise((resolve, reject) => {
18464
+ var fulfilled = (value) => {
18465
+ try {
18466
+ step(generator.next(value));
18467
+ } catch (e) {
18468
+ reject(e);
18469
+ }
18470
+ };
18471
+ var rejected = (value) => {
18472
+ try {
18473
+ step(generator.throw(value));
18474
+ } catch (e) {
18475
+ reject(e);
18476
+ }
18477
+ };
18478
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18479
+ step((generator = generator.apply(__this, __arguments)).next());
18480
+ });
18481
+ };
18781
18482
  function apiRequest(opt) {
18782
- const params = opt.params;
18783
- return new CancelablePromise((resolve, reject) => {
18784
- return opt.connector.connect().then((apiItems) => {
18785
- let apiItem = apiItems && apiItems[opt.name];
18786
- if (apiItem) {
18787
- apiItem = [...apiItem];
18788
- let url = apiItem.shift();
18789
- if (apiItem.length) {
18790
- const replaceParams = {};
18791
- for (let fry = 0; fry < apiItem.length; fry++) {
18792
- const arg = apiItem[fry];
18793
- replaceParams[fry] = "{" + arg + "}";
18794
- if (params[arg] === void 0) {
18795
- throw new Error(
18796
- "`" + arg + "` url api argument is not specified"
18797
- );
18798
- }
18799
- }
18800
- if (url) {
18801
- url = template(url, replaceParams);
18483
+ return __async$q(this, null, function* () {
18484
+ const { params, name, connector, requestOptions } = opt;
18485
+ const apiItems = yield connector.connect();
18486
+ let apiItem = apiItems && apiItems[name];
18487
+ if (apiItem) {
18488
+ apiItem = [...apiItem];
18489
+ let url = apiItem.shift();
18490
+ if (apiItem.length) {
18491
+ const replaceParams = {};
18492
+ for (let fry = 0; fry < apiItem.length; fry++) {
18493
+ const arg = apiItem[fry];
18494
+ replaceParams[fry] = `{${arg}}`;
18495
+ if (params[arg] === void 0) {
18496
+ throw new Error(`\`${arg}\` URL API argument is not specified`);
18802
18497
  }
18803
18498
  }
18804
- if (params) {
18805
- const paramArray = [];
18806
- const paramList = params.paramList;
18807
- if (Array.isArray(paramList)) {
18808
- delete params.paramList;
18809
- paramList.forEach((x) => {
18810
- paramArray.push(`${x[0]}=${x[1]}`);
18811
- });
18812
- }
18813
- for (const p in params) {
18814
- if (apiItem.indexOf(p) === -1) {
18815
- paramArray.push(`${p}=${params[p]}`);
18816
- }
18817
- }
18818
- if (paramArray.length) {
18819
- url = url + "?" + paramArray.join("&");
18499
+ if (url) {
18500
+ url = template(url, replaceParams);
18501
+ }
18502
+ }
18503
+ if (params) {
18504
+ const paramArray = [];
18505
+ const paramList = params.paramList;
18506
+ if (Array.isArray(paramList)) {
18507
+ paramList.forEach(([key, value]) => {
18508
+ paramArray.push(`${key}=${value}`);
18509
+ });
18510
+ }
18511
+ for (const p in params) {
18512
+ if (apiItem.indexOf(p) === -1) {
18513
+ paramArray.push(`${p}=${params[p]}`);
18820
18514
  }
18821
18515
  }
18822
- if (url) {
18823
- resolve(opt.connector.makeQuery(url, params, opt.requestOptions));
18824
- } else {
18825
- reject(new Error("request url is not set"));
18516
+ if (paramArray.length) {
18517
+ url = `${url}?${paramArray.join("&")}`;
18826
18518
  }
18519
+ }
18520
+ if (url) {
18521
+ return connector.makeQuery(url, params, __spreadValues$r({
18522
+ cacheName: name
18523
+ }, requestOptions));
18827
18524
  } else {
18828
- resolve(void 0);
18525
+ throw new Error("Request URL is not set");
18829
18526
  }
18830
- }).catch((er) => {
18831
- reject(er);
18832
- });
18527
+ } else {
18528
+ return void 0;
18529
+ }
18833
18530
  });
18834
18531
  }
18835
18532
 
@@ -18929,23 +18626,59 @@ var NgwLeaflet = (function () {
18929
18626
  }
18930
18627
 
18931
18628
  var __defProp$A = Object.defineProperty;
18932
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
18933
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
18934
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
18629
+ var __defProps$g = Object.defineProperties;
18630
+ var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
18631
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
18632
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
18633
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
18935
18634
  var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18936
- var __spreadValues$p = (a, b) => {
18635
+ var __spreadValues$q = (a, b) => {
18937
18636
  for (var prop in b || (b = {}))
18938
- if (__hasOwnProp$q.call(b, prop))
18637
+ if (__hasOwnProp$r.call(b, prop))
18939
18638
  __defNormalProp$A(a, prop, b[prop]);
18940
- if (__getOwnPropSymbols$q)
18941
- for (var prop of __getOwnPropSymbols$q(b)) {
18942
- if (__propIsEnum$q.call(b, prop))
18639
+ if (__getOwnPropSymbols$r)
18640
+ for (var prop of __getOwnPropSymbols$r(b)) {
18641
+ if (__propIsEnum$r.call(b, prop))
18943
18642
  __defNormalProp$A(a, prop, b[prop]);
18944
18643
  }
18945
18644
  return a;
18946
18645
  };
18646
+ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
18647
+ var __objRest$2 = (source, exclude) => {
18648
+ var target = {};
18649
+ for (var prop in source)
18650
+ if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
18651
+ target[prop] = source[prop];
18652
+ if (source != null && __getOwnPropSymbols$r)
18653
+ for (var prop of __getOwnPropSymbols$r(source)) {
18654
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
18655
+ target[prop] = source[prop];
18656
+ }
18657
+ return target;
18658
+ };
18947
18659
  var __publicField$p = (obj, key, value) => __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
18660
+ var __async$p = (__this, __arguments, generator) => {
18661
+ return new Promise((resolve, reject) => {
18662
+ var fulfilled = (value) => {
18663
+ try {
18664
+ step(generator.next(value));
18665
+ } catch (e) {
18666
+ reject(e);
18667
+ }
18668
+ };
18669
+ var rejected = (value) => {
18670
+ try {
18671
+ step(generator.throw(value));
18672
+ } catch (e) {
18673
+ reject(e);
18674
+ }
18675
+ };
18676
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18677
+ step((generator = generator.apply(__this, __arguments)).next());
18678
+ });
18679
+ };
18948
18680
  let ID$2 = 0;
18681
+ let REQUEST_ID = 0;
18949
18682
  class NgwConnector {
18950
18683
  constructor(options) {
18951
18684
  this.options = options;
@@ -18956,7 +18689,7 @@ var NgwLeaflet = (function () {
18956
18689
  __publicField$p(this, "cache");
18957
18690
  __publicField$p(this, "withCredentials");
18958
18691
  __publicField$p(this, "routeStr", "/api/component/pyramid/route");
18959
- __publicField$p(this, "activeRequests", []);
18692
+ __publicField$p(this, "activeRequests", {});
18960
18693
  __publicField$p(this, "requestTransform");
18961
18694
  const exist = findConnector(options);
18962
18695
  this.cache = new Cache({ namespace: options.cacheId });
@@ -19017,29 +18750,27 @@ var NgwLeaflet = (function () {
19017
18750
  * ```
19018
18751
  */
19019
18752
  connect() {
19020
- const auth = this.options.auth;
19021
- const makeConnect = () => new CancelablePromise((resolve, reject) => {
19022
- const makeQuery = () => {
19023
- return this.makeQuery(this.routeStr, {}, {}).then((route) => {
19024
- resolve(route);
19025
- }).catch((er) => {
19026
- reject(er);
19027
- });
19028
- };
18753
+ return __async$p(this, null, function* () {
18754
+ const auth = this.options.auth;
19029
18755
  if (auth) {
19030
18756
  const { login, password } = auth;
19031
18757
  if (login && password) {
19032
- return this._login({ login, password }).then(() => {
19033
- return makeQuery();
19034
- }).catch((er) => reject(er));
18758
+ yield this._login({ login, password });
19035
18759
  }
19036
18760
  }
19037
- return makeQuery();
19038
- });
19039
- return this.cache.add("route", makeConnect, {
19040
- id: this.id,
19041
- auth,
19042
- baseUrl: this.options.baseUrl
18761
+ return yield this.makeQuery(
18762
+ this.routeStr,
18763
+ {},
18764
+ {
18765
+ cacheName: "route",
18766
+ cache: true,
18767
+ cacheProps: {
18768
+ id: this.id,
18769
+ auth,
18770
+ baseUrl: this.options.baseUrl
18771
+ }
18772
+ }
18773
+ );
19043
18774
  });
19044
18775
  }
19045
18776
  /**
@@ -19063,20 +18794,22 @@ var NgwLeaflet = (function () {
19063
18794
  this.emitter.emit("logout");
19064
18795
  }
19065
18796
  getUserInfo(credentials, options) {
19066
- if (this.user && this.user.id) {
19067
- return CancelablePromise.resolve(this.user);
19068
- }
19069
- if (credentials) {
19070
- this.options.auth = credentials;
19071
- }
19072
- const options_ = __spreadValues$p({
19073
- headers: this.getAuthorizationHeaders(credentials)
19074
- }, options);
19075
- return this.makeQuery(
19076
- "/api/component/auth/current_user",
19077
- {},
19078
- options_
19079
- );
18797
+ return __async$p(this, null, function* () {
18798
+ if (this.user && this.user.id) {
18799
+ return this.user;
18800
+ }
18801
+ if (credentials) {
18802
+ this.options.auth = credentials;
18803
+ }
18804
+ const options_ = __spreadValues$q({
18805
+ headers: this.getAuthorizationHeaders(credentials)
18806
+ }, options);
18807
+ return this.makeQuery(
18808
+ "/api/component/auth/current_user",
18809
+ {},
18810
+ options_
18811
+ );
18812
+ });
19080
18813
  }
19081
18814
  /**
19082
18815
  * Obtaining the required Headers for authentication of requests in the NGW.
@@ -19085,7 +18818,7 @@ var NgwLeaflet = (function () {
19085
18818
  const client = this.makeClientId(credentials);
19086
18819
  if (client) {
19087
18820
  return {
19088
- Authorization: "Basic " + client
18821
+ Authorization: `Basic ${client}`
19089
18822
  };
19090
18823
  }
19091
18824
  }
@@ -19093,21 +18826,22 @@ var NgwLeaflet = (function () {
19093
18826
  credentials = credentials || this.options.auth;
19094
18827
  if (credentials) {
19095
18828
  const { login, password } = credentials;
19096
- const str = unescape(encodeURIComponent(`${login}:${password}`));
18829
+ const str = `${login}:${password}`;
18830
+ const encodedStr = encodeURIComponent(str);
19097
18831
  {
19098
- return window.btoa(str);
18832
+ return window.btoa(encodedStr);
19099
18833
  }
19100
18834
  }
19101
18835
  }
19102
18836
  /** Stop all api requests */
19103
18837
  abort() {
19104
- for (const req of this.activeRequests) {
19105
- req.cancel();
18838
+ for (const abortController of Object.values(this.activeRequests)) {
18839
+ abortController.abort();
19106
18840
  }
19107
- this.activeRequests = [];
18841
+ this.activeRequests = {};
19108
18842
  }
19109
18843
  getActiveApiRequests() {
19110
- return [...this.activeRequests];
18844
+ return __spreadValues$q({}, this.activeRequests);
19111
18845
  }
19112
18846
  /**
19113
18847
  * Send request to NGW api router.
@@ -19139,26 +18873,10 @@ var NgwLeaflet = (function () {
19139
18873
  * ```
19140
18874
  */
19141
18875
  apiRequest(name, params_ = {}, requestOptions = {}) {
19142
- var _a, _b;
19143
- requestOptions = __spreadValues$p({
19144
- withCredentials: this.withCredentials
19145
- }, requestOptions);
19146
- const { method, headers, withCredentials, responseType } = requestOptions;
19147
- params_ = (_a = requestOptions.params) != null ? _a : params_;
19148
- const params = objectRemoveEmpty(params_);
19149
- const makeApiRequest = () => apiRequest({ name, params, requestOptions, connector: this });
19150
- if (requestOptions.cache && method === "GET") {
19151
- return this.cache.add(name, makeApiRequest, __spreadValues$p({
19152
- params
19153
- }, objectRemoveEmpty({
19154
- headers,
19155
- withCredentials,
19156
- responseType,
19157
- baseUrl: this.options.baseUrl,
19158
- userId: (_b = this.user) == null ? void 0 : _b.id
19159
- })));
19160
- }
19161
- return makeApiRequest();
18876
+ var _a;
18877
+ params_ = (_a = requestOptions.params) != null ? _a : params_;
18878
+ const params = objectRemoveEmpty(params_);
18879
+ return apiRequest({ name, params, requestOptions, connector: this });
19162
18880
  }
19163
18881
  /**
19164
18882
  * Shortcut method for send POST request to NGW.
@@ -19248,17 +18966,68 @@ var NgwLeaflet = (function () {
19248
18966
  * @param params - Query params
19249
18967
  * @param options - Request options
19250
18968
  */
19251
- makeQuery(url, params, options = {}) {
19252
- url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
19253
- if (url) {
18969
+ makeQuery(_0, _1) {
18970
+ return __async$p(this, arguments, function* (url, params, options = {}) {
18971
+ var _b;
18972
+ url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
18973
+ if (!url) {
18974
+ throw new Error("Empty `url` not allowed");
18975
+ }
19254
18976
  if (params) {
19255
- url = template(url, params);
18977
+ const _a = params, restParams = __objRest$2(_a, ["paramList"]);
18978
+ url = template(url, restParams);
19256
18979
  }
19257
18980
  url = encodeURI(fixUrlStr(url));
19258
- return this._loadData(url, options);
19259
- } else {
19260
- throw new Error("Empty `url` not allowed");
19261
- }
18981
+ options = __spreadValues$q({ withCredentials: this.withCredentials }, options);
18982
+ const {
18983
+ cache,
18984
+ signal: externalSignal,
18985
+ method = "GET",
18986
+ headers,
18987
+ cacheName,
18988
+ cacheProps,
18989
+ responseType,
18990
+ withCredentials
18991
+ } = options;
18992
+ const internalAbortController = new AbortController();
18993
+ const internalSignal = internalAbortController.signal;
18994
+ if (externalSignal) {
18995
+ if (externalSignal.aborted) {
18996
+ throw new AbortError();
18997
+ }
18998
+ externalSignal.addEventListener("abort", () => {
18999
+ internalAbortController.abort();
19000
+ });
19001
+ }
19002
+ options.signal = internalSignal;
19003
+ const createPromise = () => __async$p(this, null, function* () {
19004
+ const id = REQUEST_ID++;
19005
+ this.activeRequests[id] = internalAbortController;
19006
+ try {
19007
+ return this._loadData(url, options);
19008
+ } finally {
19009
+ this._cleanActiveRequest(id);
19010
+ }
19011
+ });
19012
+ if (cache && method === "GET") {
19013
+ const cacheOptions = cacheProps ? cacheProps : __spreadProps$g(__spreadValues$q({}, objectRemoveEmpty({
19014
+ headers,
19015
+ withCredentials,
19016
+ responseType,
19017
+ baseUrl: this.options.baseUrl,
19018
+ userId: (_b = this.user) == null ? void 0 : _b.id
19019
+ })), {
19020
+ params
19021
+ });
19022
+ return this.cache.add(
19023
+ cacheName || url,
19024
+ createPromise,
19025
+ cacheOptions,
19026
+ false
19027
+ );
19028
+ }
19029
+ return createPromise();
19030
+ });
19262
19031
  }
19263
19032
  // -------------------------------------------------------------------------
19264
19033
  // Resource Methods
@@ -19340,26 +19109,29 @@ var NgwLeaflet = (function () {
19340
19109
  */
19341
19110
  _loadData(url, options) {
19342
19111
  options.responseType = options.responseType || "json";
19343
- if (options.signal && options.signal.aborted) {
19344
- return CancelablePromise.reject(new CancelablePromise.CancelError());
19345
- }
19346
- const request = new CancelablePromise((resolve, reject, onCancel) => {
19112
+ return new Promise((resolve, reject) => {
19113
+ var _a;
19347
19114
  if (this.user) {
19348
19115
  options = options || {};
19349
- options.headers = __spreadValues$p(__spreadValues$p({}, this.getAuthorizationHeaders()), options.headers);
19116
+ options.headers = __spreadValues$q(__spreadValues$q({}, this.getAuthorizationHeaders()), options.headers);
19350
19117
  }
19351
19118
  if (this.requestTransform) {
19352
19119
  const [transUrl, transOptions] = this.requestTransform(url, options);
19353
19120
  url = transUrl;
19354
19121
  options = transOptions;
19355
19122
  }
19356
- loadData(url, resolve, options, reject, onCancel);
19357
- }).then((resp) => {
19358
- this._cleanActiveRequests(request);
19359
- return resp;
19123
+ let runOnAbort = void 0;
19124
+ loadData(url, resolve, options, reject, (handler) => {
19125
+ runOnAbort = handler;
19126
+ });
19127
+ (_a = options.signal) == null ? void 0 : _a.addEventListener("abort", () => {
19128
+ if (runOnAbort !== void 0) {
19129
+ runOnAbort();
19130
+ }
19131
+ reject(new AbortError());
19132
+ });
19360
19133
  }).catch((httpError) => {
19361
- this._cleanActiveRequests(request);
19362
- if (httpError instanceof CancelablePromise.CancelError) ; else {
19134
+ if (httpError.name !== "AbortError") {
19363
19135
  {
19364
19136
  console.warn("DEV WARN", httpError);
19365
19137
  }
@@ -19368,31 +19140,24 @@ var NgwLeaflet = (function () {
19368
19140
  throw er;
19369
19141
  }
19370
19142
  }
19143
+ throw httpError;
19371
19144
  });
19372
- if (options.signal && typeof options.signal.addEventListener === "function") {
19373
- options.signal.addEventListener("abort", () => {
19374
- request.cancel();
19375
- this._cleanActiveRequests(request);
19376
- });
19377
- }
19378
- this.activeRequests.push(request);
19379
- return request;
19380
19145
  }
19381
19146
  _login(credentials, options) {
19382
- return this.getUserInfo(credentials, options).then((data) => {
19383
- this.user = data;
19384
- this.emitter.emit("login", data);
19385
- return data;
19386
- }).catch((er) => {
19387
- this.emitter.emit("login:error", er);
19388
- throw er;
19147
+ return __async$p(this, null, function* () {
19148
+ try {
19149
+ const data = yield this.getUserInfo(credentials, options);
19150
+ this.user = data;
19151
+ this.emitter.emit("login", data);
19152
+ return data;
19153
+ } catch (er) {
19154
+ this.emitter.emit("login:error", er);
19155
+ throw er;
19156
+ }
19389
19157
  });
19390
19158
  }
19391
- _cleanActiveRequests(request) {
19392
- const activeRequestIndex = this.activeRequests.indexOf(request);
19393
- if (activeRequestIndex !== -1) {
19394
- this.activeRequests.splice(activeRequestIndex, 1);
19395
- }
19159
+ _cleanActiveRequest(requestId) {
19160
+ delete this.activeRequests[requestId];
19396
19161
  }
19397
19162
  _handleHttpError(er) {
19398
19163
  if (er) {
@@ -19415,22 +19180,42 @@ var NgwLeaflet = (function () {
19415
19180
  var __defProp$z = Object.defineProperty;
19416
19181
  var __defProps$f = Object.defineProperties;
19417
19182
  var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
19418
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
19419
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
19420
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
19183
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
19184
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
19185
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
19421
19186
  var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19422
- var __spreadValues$o = (a, b) => {
19187
+ var __spreadValues$p = (a, b) => {
19423
19188
  for (var prop in b || (b = {}))
19424
- if (__hasOwnProp$p.call(b, prop))
19189
+ if (__hasOwnProp$q.call(b, prop))
19425
19190
  __defNormalProp$z(a, prop, b[prop]);
19426
- if (__getOwnPropSymbols$p)
19427
- for (var prop of __getOwnPropSymbols$p(b)) {
19428
- if (__propIsEnum$p.call(b, prop))
19191
+ if (__getOwnPropSymbols$q)
19192
+ for (var prop of __getOwnPropSymbols$q(b)) {
19193
+ if (__propIsEnum$q.call(b, prop))
19429
19194
  __defNormalProp$z(a, prop, b[prop]);
19430
19195
  }
19431
19196
  return a;
19432
19197
  };
19433
19198
  var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
19199
+ var __async$o = (__this, __arguments, generator) => {
19200
+ return new Promise((resolve, reject) => {
19201
+ var fulfilled = (value) => {
19202
+ try {
19203
+ step(generator.next(value));
19204
+ } catch (e) {
19205
+ reject(e);
19206
+ }
19207
+ };
19208
+ var rejected = (value) => {
19209
+ try {
19210
+ step(generator.throw(value));
19211
+ } catch (e) {
19212
+ reject(e);
19213
+ }
19214
+ };
19215
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
19216
+ step((generator = generator.apply(__this, __arguments)).next());
19217
+ });
19218
+ };
19434
19219
  const FEATURE_REQUEST_PARAMS = {
19435
19220
  srs: 4326,
19436
19221
  geom_format: "geojson"
@@ -19471,10 +19256,9 @@ var NgwLeaflet = (function () {
19471
19256
  }
19472
19257
  }
19473
19258
  function createFeatureFieldFilterQueries(opt) {
19474
- const queries = getQueries(
19475
- opt
19476
- );
19477
- return CancelablePromise.all(queries).then((itemsParts) => {
19259
+ return __async$o(this, null, function* () {
19260
+ const queries = getQueries(opt);
19261
+ const itemsParts = yield Promise.all(queries);
19478
19262
  const ids = [];
19479
19263
  const items = [];
19480
19264
  for (const part of itemsParts) {
@@ -19516,13 +19300,13 @@ var NgwLeaflet = (function () {
19516
19300
  for (const f of filters_) {
19517
19301
  if (isPropertyFilter(f)) {
19518
19302
  _queries.push(
19519
- fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$o({}, opt), {
19303
+ fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$p({}, opt), {
19520
19304
  paramList: [..._parentAllParams, ...paramList, createParam(f)]
19521
19305
  }))
19522
19306
  );
19523
19307
  } else {
19524
19308
  getQueries(
19525
- __spreadProps$f(__spreadValues$o({}, opt), {
19309
+ __spreadProps$f(__spreadValues$p({}, opt), {
19526
19310
  filters: f
19527
19311
  }),
19528
19312
  _queries,
@@ -19543,7 +19327,7 @@ var NgwLeaflet = (function () {
19543
19327
  if (propertiesFilterList.length) {
19544
19328
  for (const x of propertiesFilterList) {
19545
19329
  getQueries(
19546
- __spreadProps$f(__spreadValues$o({}, opt), {
19330
+ __spreadProps$f(__spreadValues$p({}, opt), {
19547
19331
  filters: x
19548
19332
  }),
19549
19333
  _queries,
@@ -19552,7 +19336,7 @@ var NgwLeaflet = (function () {
19552
19336
  }
19553
19337
  } else {
19554
19338
  _queries.push(
19555
- fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$o({}, opt), {
19339
+ fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$p({}, opt), {
19556
19340
  paramList: [..._parentAllParams, ...paramList, ...filters2]
19557
19341
  }))
19558
19342
  );
@@ -19568,7 +19352,7 @@ var NgwLeaflet = (function () {
19568
19352
  return `POLYGON((${polygon.join(", ")}))`;
19569
19353
  }
19570
19354
  function fetchNgwLayerItemsRequest(options) {
19571
- const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
19355
+ const params = __spreadValues$p({}, FEATURE_REQUEST_PARAMS);
19572
19356
  const {
19573
19357
  limit,
19574
19358
  cache,
@@ -19607,7 +19391,7 @@ var NgwLeaflet = (function () {
19607
19391
  if (paramList) {
19608
19392
  params.paramList = paramList;
19609
19393
  }
19610
- const reqParams = __spreadValues$o({
19394
+ const reqParams = __spreadValues$p({
19611
19395
  id: resourceId
19612
19396
  }, params);
19613
19397
  return connector.get(
@@ -19620,52 +19404,90 @@ var NgwLeaflet = (function () {
19620
19404
  var __defProp$y = Object.defineProperty;
19621
19405
  var __defProps$e = Object.defineProperties;
19622
19406
  var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
19623
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
19624
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
19625
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
19407
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
19408
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
19409
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
19626
19410
  var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19627
- var __spreadValues$n = (a, b) => {
19411
+ var __spreadValues$o = (a, b) => {
19628
19412
  for (var prop in b || (b = {}))
19629
- if (__hasOwnProp$o.call(b, prop))
19413
+ if (__hasOwnProp$p.call(b, prop))
19630
19414
  __defNormalProp$y(a, prop, b[prop]);
19631
- if (__getOwnPropSymbols$o)
19632
- for (var prop of __getOwnPropSymbols$o(b)) {
19633
- if (__propIsEnum$o.call(b, prop))
19415
+ if (__getOwnPropSymbols$p)
19416
+ for (var prop of __getOwnPropSymbols$p(b)) {
19417
+ if (__propIsEnum$p.call(b, prop))
19634
19418
  __defNormalProp$y(a, prop, b[prop]);
19635
19419
  }
19636
19420
  return a;
19637
19421
  };
19638
19422
  var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
19423
+ var __async$n = (__this, __arguments, generator) => {
19424
+ return new Promise((resolve, reject) => {
19425
+ var fulfilled = (value) => {
19426
+ try {
19427
+ step(generator.next(value));
19428
+ } catch (e) {
19429
+ reject(e);
19430
+ }
19431
+ };
19432
+ var rejected = (value) => {
19433
+ try {
19434
+ step(generator.throw(value));
19435
+ } catch (e) {
19436
+ reject(e);
19437
+ }
19438
+ };
19439
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
19440
+ step((generator = generator.apply(__this, __arguments)).next());
19441
+ });
19442
+ };
19639
19443
  function fetchNgwLayerItem(options) {
19640
- const params = __spreadValues$n({}, FEATURE_REQUEST_PARAMS);
19641
- updateItemRequestParam(params, options);
19642
- const queryParams = __spreadValues$n({
19643
- id: options.resourceId,
19644
- fid: options.featureId
19645
- }, params);
19646
- const cache = options.cache || true;
19647
- return options.connector.get("feature_layer.feature.item", { cache }, queryParams).then((resp) => {
19648
- return __spreadProps$e(__spreadValues$n({}, resp), {
19649
- toGeojson: () => {
19650
- if (resp.geom) {
19651
- return CancelablePromise.resolve(createGeoJsonFeature(resp));
19652
- } else {
19653
- return fetchNgwLayerItem(__spreadProps$e(__spreadValues$n({}, options), {
19654
- geom: true,
19655
- fields: null,
19656
- extensions: null
19657
- })).then((onlyGeomItem) => {
19658
- const geom = onlyGeomItem.geom;
19659
- return createGeoJsonFeature(__spreadProps$e(__spreadValues$n({}, resp), { geom }));
19660
- });
19661
- }
19444
+ return __async$n(this, null, function* () {
19445
+ const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
19446
+ updateItemRequestParam(params, options);
19447
+ const queryParams = __spreadValues$o({
19448
+ id: options.resourceId,
19449
+ fid: options.featureId
19450
+ }, params);
19451
+ const resp = yield options.connector.get(
19452
+ "feature_layer.feature.item",
19453
+ options,
19454
+ queryParams
19455
+ );
19456
+ const toGeojson = () => __async$n(this, null, function* () {
19457
+ if (resp.geom) {
19458
+ return createGeoJsonFeature(resp);
19459
+ } else {
19460
+ const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$e(__spreadValues$o({}, options), {
19461
+ geom: true,
19462
+ fields: null,
19463
+ extensions: null
19464
+ }));
19465
+ const geom = onlyGeomItem.geom;
19466
+ return createGeoJsonFeature(__spreadProps$e(__spreadValues$o({}, resp), { geom }));
19662
19467
  }
19663
19468
  });
19469
+ return __spreadProps$e(__spreadValues$o({}, resp), {
19470
+ toGeojson
19471
+ });
19664
19472
  });
19665
19473
  }
19666
19474
 
19667
19475
  var __defProp$x = Object.defineProperty;
19476
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
19477
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
19478
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
19668
19479
  var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19480
+ var __spreadValues$n = (a, b) => {
19481
+ for (var prop in b || (b = {}))
19482
+ if (__hasOwnProp$o.call(b, prop))
19483
+ __defNormalProp$x(a, prop, b[prop]);
19484
+ if (__getOwnPropSymbols$o)
19485
+ for (var prop of __getOwnPropSymbols$o(b)) {
19486
+ if (__propIsEnum$o.call(b, prop))
19487
+ __defNormalProp$x(a, prop, b[prop]);
19488
+ }
19489
+ return a;
19490
+ };
19669
19491
  var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
19670
19492
  class BookmarkItem {
19671
19493
  constructor(options) {
@@ -19683,11 +19505,11 @@ var NgwLeaflet = (function () {
19683
19505
  this.name = String(item.id);
19684
19506
  }
19685
19507
  }
19686
- extent() {
19508
+ extent(opt) {
19687
19509
  if (this._extent) {
19688
- return CancelablePromise.resolve(this._extent);
19510
+ return Promise.resolve(this._extent);
19689
19511
  }
19690
- return this.options.connector.get("feature_layer.feature.item_extent", null, {
19512
+ return this.options.connector.get("feature_layer.feature.item_extent", opt, {
19691
19513
  id: this.resourceId,
19692
19514
  fid: this.item.id
19693
19515
  }).then((resp) => {
@@ -19697,18 +19519,18 @@ var NgwLeaflet = (function () {
19697
19519
  return lonLat;
19698
19520
  });
19699
19521
  }
19700
- geoJson() {
19522
+ geoJson(opt) {
19701
19523
  if (this.item.geom) {
19702
- return CancelablePromise.resolve(createGeoJsonFeature(this.item));
19524
+ return Promise.resolve(createGeoJsonFeature(this.item));
19703
19525
  } else {
19704
- return fetchNgwLayerItem({
19526
+ return fetchNgwLayerItem(__spreadValues$n({
19705
19527
  resourceId: this.resourceId,
19706
19528
  featureId: this.item.id,
19707
19529
  connector: this.options.connector,
19708
19530
  geom: true,
19709
19531
  fields: null,
19710
19532
  extensions: null
19711
- }).then((onlyGeomItem) => {
19533
+ }, opt)).then((onlyGeomItem) => {
19712
19534
  const geom = onlyGeomItem.geom;
19713
19535
  this.item.geom = geom;
19714
19536
  return createGeoJsonFeature(this.item);
@@ -20338,9 +20160,10 @@ var NgwLeaflet = (function () {
20338
20160
  function fetchNgwLayerExtent({
20339
20161
  resourceId,
20340
20162
  connector,
20341
- cache = true
20163
+ cache = true,
20164
+ signal
20342
20165
  }) {
20343
- return connector.get("layer.extent", { cache }, { id: resourceId }).then((resp) => {
20166
+ return connector.get("layer.extent", { cache, signal }, { id: resourceId }).then((resp) => {
20344
20167
  if (resp) {
20345
20168
  const { maxLat, maxLon, minLat, minLon } = resp.extent;
20346
20169
  const extentArray = [minLon, minLat, maxLon, maxLat];
@@ -20352,11 +20175,12 @@ var NgwLeaflet = (function () {
20352
20175
  resourceId,
20353
20176
  featureId,
20354
20177
  connector,
20355
- cache = true
20178
+ cache = true,
20179
+ signal
20356
20180
  }) {
20357
20181
  return connector.get(
20358
20182
  "feature_layer.feature.item_extent",
20359
- { cache },
20183
+ { cache, signal },
20360
20184
  { id: resourceId, fid: featureId }
20361
20185
  ).then((resp) => {
20362
20186
  if (resp) {
@@ -20367,7 +20191,10 @@ var NgwLeaflet = (function () {
20367
20191
  });
20368
20192
  }
20369
20193
  function fetchNgwExtent(options) {
20370
- return options.connector.getResource(options.resourceId).then((resource) => {
20194
+ return options.connector.getResource(options.resourceId, {
20195
+ signal: options.signal,
20196
+ cache: options.cache
20197
+ }).then((resource) => {
20371
20198
  if (resource) {
20372
20199
  return fetchNgwResourceExtent(resource, options.connector, options);
20373
20200
  }
@@ -20375,11 +20202,11 @@ var NgwLeaflet = (function () {
20375
20202
  }
20376
20203
  function fetchNgwResourceExtent(item, connector, options) {
20377
20204
  if (item.webmap) {
20378
- return CancelablePromise.resolve(getNgwWebmapExtent(item.webmap));
20205
+ return Promise.resolve(getNgwWebmapExtent(item.webmap));
20379
20206
  } else {
20380
20207
  const resource = item.resource;
20381
20208
  if (resource.cls && resource.cls.indexOf("style") !== -1) {
20382
- return connector.getResource(resource.parent.id).then((res) => {
20209
+ return connector.getResource(resource.parent.id, options).then((res) => {
20383
20210
  if (res) {
20384
20211
  return fetchNgwLayerExtent(__spreadProps$d(__spreadValues$j({}, options), {
20385
20212
  resourceId: res.resource.id,
@@ -20399,7 +20226,7 @@ var NgwLeaflet = (function () {
20399
20226
  var __defProp$q = Object.defineProperty;
20400
20227
  var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20401
20228
  var __publicField$i = (obj, key, value) => __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
20402
- var __async$j = (__this, __arguments, generator) => {
20229
+ var __async$m = (__this, __arguments, generator) => {
20403
20230
  return new Promise((resolve, reject) => {
20404
20231
  var fulfilled = (value) => {
20405
20232
  try {
@@ -20427,12 +20254,12 @@ var NgwLeaflet = (function () {
20427
20254
  }
20428
20255
  /** @deprecated use {@link NgwResource.getBounds} instead */
20429
20256
  getExtent() {
20430
- return __async$j(this, null, function* () {
20257
+ return __async$m(this, null, function* () {
20431
20258
  return this.getBounds();
20432
20259
  });
20433
20260
  }
20434
20261
  getBounds(options) {
20435
- return __async$j(this, null, function* () {
20262
+ return __async$m(this, null, function* () {
20436
20263
  if (this._extent) {
20437
20264
  return this._extent;
20438
20265
  }
@@ -20448,7 +20275,7 @@ var NgwLeaflet = (function () {
20448
20275
  }
20449
20276
  }
20450
20277
 
20451
- var __async$i = (__this, __arguments, generator) => {
20278
+ var __async$l = (__this, __arguments, generator) => {
20452
20279
  return new Promise((resolve, reject) => {
20453
20280
  var fulfilled = (value) => {
20454
20281
  try {
@@ -20469,7 +20296,7 @@ var NgwLeaflet = (function () {
20469
20296
  });
20470
20297
  };
20471
20298
  function resourceIdFromLayerOptions(options, connector) {
20472
- return __async$i(this, null, function* () {
20299
+ return __async$l(this, null, function* () {
20473
20300
  const resource = options.resource;
20474
20301
  const item = resource;
20475
20302
  let { keyname, resourceId } = options;
@@ -20571,7 +20398,7 @@ var NgwLeaflet = (function () {
20571
20398
  return target;
20572
20399
  };
20573
20400
  var __publicField$h = (obj, key, value) => __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
20574
- var __async$h = (__this, __arguments, generator) => {
20401
+ var __async$k = (__this, __arguments, generator) => {
20575
20402
  return new Promise((resolve, reject) => {
20576
20403
  var fulfilled = (value) => {
20577
20404
  try {
@@ -20623,7 +20450,7 @@ var NgwLeaflet = (function () {
20623
20450
  }
20624
20451
  }
20625
20452
  addLayer(options) {
20626
- return __async$h(this, null, function* () {
20453
+ return __async$k(this, null, function* () {
20627
20454
  if (!this.qms && options.qmsId) {
20628
20455
  try {
20629
20456
  this.qms = yield loadJson(
@@ -20731,7 +20558,7 @@ var NgwLeaflet = (function () {
20731
20558
  };
20732
20559
  var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
20733
20560
  var __superGet$2 = (cls, obj, key) => __reflectGet$2(__getProtoOf$2(cls), key, obj);
20734
- var __async$g = (__this, __arguments, generator) => {
20561
+ var __async$j = (__this, __arguments, generator) => {
20735
20562
  return new Promise((resolve, reject) => {
20736
20563
  var fulfilled = (value) => {
20737
20564
  try {
@@ -20752,7 +20579,7 @@ var NgwLeaflet = (function () {
20752
20579
  });
20753
20580
  };
20754
20581
  function createBasemapLayerAdapter(_0) {
20755
- return __async$g(this, arguments, function* ({
20582
+ return __async$j(this, arguments, function* ({
20756
20583
  webMap,
20757
20584
  item
20758
20585
  }) {
@@ -20773,7 +20600,7 @@ var NgwLeaflet = (function () {
20773
20600
  if (TileAdapter) {
20774
20601
  class BasemapTileAdapter extends TileAdapter {
20775
20602
  addLayer(opt) {
20776
- return __async$g(this, null, function* () {
20603
+ return __async$j(this, null, function* () {
20777
20604
  return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$c(__spreadValues$g({}, opt), { url }));
20778
20605
  });
20779
20606
  }
@@ -20813,11 +20640,12 @@ var NgwLeaflet = (function () {
20813
20640
  function fetchNgwLayerCount({
20814
20641
  connector,
20815
20642
  resourceId,
20816
- cache = true
20643
+ cache = true,
20644
+ signal
20817
20645
  }) {
20818
20646
  return connector.get(
20819
20647
  "feature_layer.feature.count",
20820
- { cache },
20648
+ { cache, signal },
20821
20649
  {
20822
20650
  id: resourceId
20823
20651
  }
@@ -20871,13 +20699,34 @@ var NgwLeaflet = (function () {
20871
20699
  return a;
20872
20700
  };
20873
20701
  var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
20702
+ var __async$i = (__this, __arguments, generator) => {
20703
+ return new Promise((resolve, reject) => {
20704
+ var fulfilled = (value) => {
20705
+ try {
20706
+ step(generator.next(value));
20707
+ } catch (e) {
20708
+ reject(e);
20709
+ }
20710
+ };
20711
+ var rejected = (value) => {
20712
+ try {
20713
+ step(generator.throw(value));
20714
+ } catch (e) {
20715
+ reject(e);
20716
+ }
20717
+ };
20718
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
20719
+ step((generator = generator.apply(__this, __arguments)).next());
20720
+ });
20721
+ };
20874
20722
  function fetchNgwLayerItems(options) {
20875
- const filters = options.filters;
20876
- if (filters) {
20877
- return createFeatureFieldFilterQueries(__spreadProps$b(__spreadValues$f({}, options), {
20878
- filters
20879
- })).then((data) => {
20880
- var _a;
20723
+ return __async$i(this, null, function* () {
20724
+ var _a;
20725
+ const filters = options.filters;
20726
+ if (filters) {
20727
+ let data = yield createFeatureFieldFilterQueries(__spreadProps$b(__spreadValues$f({}, options), {
20728
+ filters
20729
+ }));
20881
20730
  const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a : isFilterWithAnyCase(filters);
20882
20731
  if (clientFilterValidate) {
20883
20732
  data = data.filter((y) => {
@@ -20889,10 +20738,10 @@ var NgwLeaflet = (function () {
20889
20738
  });
20890
20739
  }
20891
20740
  return data;
20892
- });
20893
- } else {
20894
- return fetchNgwLayerItemsRequest(options);
20895
- }
20741
+ } else {
20742
+ return fetchNgwLayerItemsRequest(options);
20743
+ }
20744
+ });
20896
20745
  }
20897
20746
  function isFilterWithAnyCase(filters) {
20898
20747
  if (filters[0] === "any") {
@@ -20910,8 +20759,29 @@ var NgwLeaflet = (function () {
20910
20759
  return false;
20911
20760
  }
20912
20761
 
20762
+ var __async$h = (__this, __arguments, generator) => {
20763
+ return new Promise((resolve, reject) => {
20764
+ var fulfilled = (value) => {
20765
+ try {
20766
+ step(generator.next(value));
20767
+ } catch (e) {
20768
+ reject(e);
20769
+ }
20770
+ };
20771
+ var rejected = (value) => {
20772
+ try {
20773
+ step(generator.throw(value));
20774
+ } catch (e) {
20775
+ reject(e);
20776
+ }
20777
+ };
20778
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
20779
+ step((generator = generator.apply(__this, __arguments)).next());
20780
+ });
20781
+ };
20913
20782
  function fetchNgwLayerFeatures(options) {
20914
- return fetchNgwLayerItems(options).then((x) => {
20783
+ return __async$h(this, null, function* () {
20784
+ const x = yield fetchNgwLayerItems(options);
20915
20785
  const features = [];
20916
20786
  x.forEach((y) => {
20917
20787
  features.push(createGeoJsonFeature(y));
@@ -20971,7 +20841,7 @@ var NgwLeaflet = (function () {
20971
20841
  var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
20972
20842
  var __publicField$f = (obj, key, value) => __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
20973
20843
  var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
20974
- var __async$f = (__this, __arguments, generator) => {
20844
+ var __async$g = (__this, __arguments, generator) => {
20975
20845
  return new Promise((resolve, reject) => {
20976
20846
  var fulfilled = (value) => {
20977
20847
  try {
@@ -20992,7 +20862,7 @@ var NgwLeaflet = (function () {
20992
20862
  });
20993
20863
  };
20994
20864
  function createGeoJsonAdapter(props) {
20995
- return __async$f(this, null, function* () {
20865
+ return __async$g(this, null, function* () {
20996
20866
  var _a, _b;
20997
20867
  const {
20998
20868
  item,
@@ -21008,29 +20878,35 @@ var NgwLeaflet = (function () {
21008
20878
  const _loadedIds = [];
21009
20879
  let _fullDataLoad = false;
21010
20880
  let _lastFilterArgs;
21011
- let _dataPromise;
20881
+ let internalAbortController;
21012
20882
  const resourceId = yield resourceIdFromLayerOptions(options, connector);
21013
20883
  if ((_b = (_a = options.adapterOptions) == null ? void 0 : _a.popupOptions) == null ? void 0 : _b.fromProperties) {
21014
20884
  options.adapterOptions.popupOptions.createPopupContent = ({ feature }) => {
21015
20885
  return feature && createPopupContent(feature, item);
21016
20886
  };
21017
20887
  }
21018
- const getData = (filters, filterOpt) => __async$f(this, null, function* () {
20888
+ const getData = (filters, filterOpt) => __async$g(this, null, function* () {
21019
20889
  abort();
20890
+ internalAbortController = new AbortController();
20891
+ const internalSignal = internalAbortController.signal;
20892
+ if (filterOpt == null ? void 0 : filterOpt.signal) {
20893
+ filterOpt.signal.addEventListener("abort", internalAbortController.abort);
20894
+ }
20895
+ filterOpt = filterOpt || {};
20896
+ filterOpt.signal = internalSignal;
21020
20897
  _lastFilterArgs = { filters, options: filterOpt };
21021
- _dataPromise = fetchNgwLayerFeatureCollection(__spreadValues$e({
20898
+ return fetchNgwLayerFeatureCollection(__spreadValues$e({
21022
20899
  resourceId,
21023
20900
  filters,
21024
20901
  connector,
21025
20902
  cache: true
21026
20903
  }, filterOpt));
21027
- return yield _dataPromise;
21028
20904
  });
21029
20905
  let removed = false;
21030
20906
  const abort = () => {
21031
- if (_dataPromise) {
21032
- _dataPromise.cancel();
21033
- _dataPromise = void 0;
20907
+ if (internalAbortController) {
20908
+ internalAbortController.abort();
20909
+ internalAbortController = void 0;
21034
20910
  }
21035
20911
  };
21036
20912
  class NgwGeoJsonAdapter extends GeoJsonAdapter {
@@ -21043,7 +20919,7 @@ var NgwLeaflet = (function () {
21043
20919
  __publicField$f(this, "__disableMapMoveListener");
21044
20920
  }
21045
20921
  addLayer(opt) {
21046
- return __async$f(this, null, function* () {
20922
+ return __async$g(this, null, function* () {
21047
20923
  let needUpdate = !opt.data;
21048
20924
  const waitFullLoad = opt.waitFullLoad !== void 0 ? opt.waitFullLoad : true;
21049
20925
  if (options.id !== void 0) {
@@ -21088,7 +20964,7 @@ var NgwLeaflet = (function () {
21088
20964
  return this.getBounds();
21089
20965
  }
21090
20966
  getBounds() {
21091
- return __async$f(this, null, function* () {
20967
+ return __async$g(this, null, function* () {
21092
20968
  const hasData = this.getLayers && this.getLayers().length;
21093
20969
  const strategy = this.options.strategy;
21094
20970
  if ((strategy == null ? void 0 : strategy.startsWith("BBOX")) || hasData) {
@@ -21114,7 +20990,7 @@ var NgwLeaflet = (function () {
21114
20990
  return fetchNgwLayerCount({ connector, resourceId, cache: true });
21115
20991
  }
21116
20992
  updateLayer(filterArgs) {
21117
- return __async$f(this, null, function* () {
20993
+ return __async$g(this, null, function* () {
21118
20994
  var _a2;
21119
20995
  filterArgs = filterArgs || _lastFilterArgs || {};
21120
20996
  if ((_a2 = this.options.strategy) == null ? void 0 : _a2.startsWith("BBOX")) {
@@ -21180,7 +21056,7 @@ var NgwLeaflet = (function () {
21180
21056
  });
21181
21057
  }
21182
21058
  propertiesFilter(filters, opt) {
21183
- return __async$f(this, null, function* () {
21059
+ return __async$g(this, null, function* () {
21184
21060
  abort();
21185
21061
  if (this.filter && _fullDataLoad) {
21186
21062
  this.filter((e) => {
@@ -21254,7 +21130,7 @@ var NgwLeaflet = (function () {
21254
21130
  });
21255
21131
  }
21256
21132
 
21257
- var __async$e = (__this, __arguments, generator) => {
21133
+ var __async$f = (__this, __arguments, generator) => {
21258
21134
  return new Promise((resolve, reject) => {
21259
21135
  var fulfilled = (value) => {
21260
21136
  try {
@@ -21275,7 +21151,7 @@ var NgwLeaflet = (function () {
21275
21151
  });
21276
21152
  };
21277
21153
  function createWebMapAdapter(_0) {
21278
- return __async$e(this, arguments, function* ({
21154
+ return __async$f(this, arguments, function* ({
21279
21155
  layerOptions: options,
21280
21156
  webMap,
21281
21157
  connector
@@ -21403,7 +21279,7 @@ var NgwLeaflet = (function () {
21403
21279
  };
21404
21280
  var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
21405
21281
  var __publicField$e = (obj, key, value) => __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
21406
- var __async$d = (__this, __arguments, generator) => {
21282
+ var __async$e = (__this, __arguments, generator) => {
21407
21283
  return new Promise((resolve, reject) => {
21408
21284
  var fulfilled = (value) => {
21409
21285
  try {
@@ -21424,7 +21300,7 @@ var NgwLeaflet = (function () {
21424
21300
  });
21425
21301
  };
21426
21302
  function createRasterAdapter(_0) {
21427
- return __async$d(this, arguments, function* ({
21303
+ return __async$e(this, arguments, function* ({
21428
21304
  layerOptions,
21429
21305
  webMap,
21430
21306
  connector,
@@ -21480,7 +21356,7 @@ var NgwLeaflet = (function () {
21480
21356
  return super.addLayer(__spreadValues$d(__spreadValues$d({}, this.options), addOptions));
21481
21357
  }
21482
21358
  getLegend(options) {
21483
- return __async$d(this, null, function* () {
21359
+ return __async$e(this, null, function* () {
21484
21360
  const ngwLegend = yield connector.get("render.legend_symbols", __spreadValues$d({
21485
21361
  params: { id: resourceId },
21486
21362
  cache: true
@@ -21500,7 +21376,7 @@ var NgwLeaflet = (function () {
21500
21376
  });
21501
21377
  }
21502
21378
  getIdentificationIds() {
21503
- return __async$d(this, null, function* () {
21379
+ return __async$e(this, null, function* () {
21504
21380
  if (this.item) {
21505
21381
  if (adapter === "MVT") {
21506
21382
  return [this.item.resource.id];
@@ -21541,7 +21417,7 @@ var NgwLeaflet = (function () {
21541
21417
  return a;
21542
21418
  };
21543
21419
  var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
21544
- var __async$c = (__this, __arguments, generator) => {
21420
+ var __async$d = (__this, __arguments, generator) => {
21545
21421
  return new Promise((resolve, reject) => {
21546
21422
  var fulfilled = (value) => {
21547
21423
  try {
@@ -21577,7 +21453,7 @@ var NgwLeaflet = (function () {
21577
21453
  "tmsclient_layer"
21578
21454
  ];
21579
21455
  function createAdapterFromFirstStyle(_0) {
21580
- return __async$c(this, arguments, function* ({
21456
+ return __async$d(this, arguments, function* ({
21581
21457
  layerOptions,
21582
21458
  webMap,
21583
21459
  connector,
@@ -21596,7 +21472,7 @@ var NgwLeaflet = (function () {
21596
21472
  });
21597
21473
  }
21598
21474
  function createAsyncAdapter(options, webMap, connector) {
21599
- return __async$c(this, null, function* () {
21475
+ return __async$d(this, null, function* () {
21600
21476
  let adapter;
21601
21477
  let item;
21602
21478
  const adapterType = options.adapter;
@@ -21799,7 +21675,7 @@ var NgwLeaflet = (function () {
21799
21675
  };
21800
21676
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
21801
21677
  var __publicField$d = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
21802
- var __async$b = (__this, __arguments, generator) => {
21678
+ var __async$c = (__this, __arguments, generator) => {
21803
21679
  return new Promise((resolve, reject) => {
21804
21680
  var fulfilled = (value) => {
21805
21681
  try {
@@ -21849,7 +21725,7 @@ var NgwLeaflet = (function () {
21849
21725
  }
21850
21726
  }
21851
21727
  static create(webMap, item, options, connector, parent) {
21852
- return __async$b(this, null, function* () {
21728
+ return __async$c(this, null, function* () {
21853
21729
  const ngwWebmapItem = new _NgwWebmapItem(
21854
21730
  webMap,
21855
21731
  item,
@@ -21878,15 +21754,14 @@ var NgwLeaflet = (function () {
21878
21754
  return this.layer;
21879
21755
  }
21880
21756
  getLegend(options) {
21881
- return __async$b(this, null, function* () {
21757
+ return __async$c(this, null, function* () {
21882
21758
  var _a;
21883
21759
  const id = (_a = this.layer) == null ? void 0 : _a.id;
21884
21760
  if (id !== void 0) {
21885
21761
  const connector = this.connector;
21886
21762
  if (connector) {
21887
21763
  const ngwLegend = yield connector.get("render.legend_symbols", __spreadValues$a({
21888
- params: { id: this.item.resourceId },
21889
- cache: true
21764
+ params: { id: this.item.resourceId }
21890
21765
  }, options));
21891
21766
  const legend = {
21892
21767
  layerId: id,
@@ -22074,7 +21949,7 @@ var NgwLeaflet = (function () {
22074
21949
  return a;
22075
21950
  };
22076
21951
  var __publicField$c = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
22077
- var __async$a = (__this, __arguments, generator) => {
21952
+ var __async$b = (__this, __arguments, generator) => {
22078
21953
  return new Promise((resolve, reject) => {
22079
21954
  var fulfilled = (value) => {
22080
21955
  try {
@@ -22095,7 +21970,7 @@ var NgwLeaflet = (function () {
22095
21970
  });
22096
21971
  };
22097
21972
  function createOnFirstShowAdapter(_0) {
22098
- return __async$a(this, arguments, function* ({
21973
+ return __async$b(this, arguments, function* ({
22099
21974
  webMap,
22100
21975
  adapterOptions = {},
22101
21976
  onLayerAdded,
@@ -22121,7 +21996,7 @@ var NgwLeaflet = (function () {
22121
21996
  return this._removed;
22122
21997
  }
22123
21998
  showLayer() {
22124
- return __async$a(this, null, function* () {
21999
+ return __async$b(this, null, function* () {
22125
22000
  this.options.visibility = true;
22126
22001
  if (this.layer.length) {
22127
22002
  for (const x of this.layer) {
@@ -22133,7 +22008,7 @@ var NgwLeaflet = (function () {
22133
22008
  });
22134
22009
  }
22135
22010
  hideLayer() {
22136
- return __async$a(this, null, function* () {
22011
+ return __async$b(this, null, function* () {
22137
22012
  this.options.visibility = false;
22138
22013
  if (this.layer) {
22139
22014
  for (const x of this.layer) {
@@ -22143,7 +22018,7 @@ var NgwLeaflet = (function () {
22143
22018
  });
22144
22019
  }
22145
22020
  loadLayer() {
22146
- return __async$a(this, null, function* () {
22021
+ return __async$b(this, null, function* () {
22147
22022
  if (!this.layer.length && !this._creatingInProgress) {
22148
22023
  this._creatingInProgress = true;
22149
22024
  const Adapter = yield createAdapter(this);
@@ -22177,7 +22052,7 @@ var NgwLeaflet = (function () {
22177
22052
  });
22178
22053
  }
22179
22054
 
22180
- var __async$9 = (__this, __arguments, generator) => {
22055
+ var __async$a = (__this, __arguments, generator) => {
22181
22056
  return new Promise((resolve, reject) => {
22182
22057
  var fulfilled = (value) => {
22183
22058
  try {
@@ -22198,7 +22073,7 @@ var NgwLeaflet = (function () {
22198
22073
  });
22199
22074
  };
22200
22075
  function createOnFirstShowNgwAdapter(_0) {
22201
- return __async$9(this, arguments, function* ({
22076
+ return __async$a(this, arguments, function* ({
22202
22077
  webMap,
22203
22078
  connector,
22204
22079
  item,
@@ -22254,7 +22129,7 @@ var NgwLeaflet = (function () {
22254
22129
  };
22255
22130
  var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
22256
22131
  var __publicField$b = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
22257
- var __async$8 = (__this, __arguments, generator) => {
22132
+ var __async$9 = (__this, __arguments, generator) => {
22258
22133
  return new Promise((resolve, reject) => {
22259
22134
  var fulfilled = (value) => {
22260
22135
  try {
@@ -22305,7 +22180,7 @@ var NgwLeaflet = (function () {
22305
22180
  }
22306
22181
  }
22307
22182
  addLayer(options) {
22308
- return __async$8(this, null, function* () {
22183
+ return __async$9(this, null, function* () {
22309
22184
  var _a, _b;
22310
22185
  this.options = __spreadValues$8(__spreadValues$8({}, this.options), options);
22311
22186
  this.layer = yield this._getWebMapLayerItem();
@@ -22338,21 +22213,21 @@ var NgwLeaflet = (function () {
22338
22213
  delete this._webmapLayersIds;
22339
22214
  }
22340
22215
  showLayer() {
22341
- return __async$8(this, null, function* () {
22216
+ return __async$9(this, null, function* () {
22342
22217
  if (this.layer && this.layer.properties) {
22343
22218
  return this.layer.properties.property("visibility").set(true);
22344
22219
  }
22345
22220
  });
22346
22221
  }
22347
22222
  hideLayer() {
22348
- return __async$8(this, null, function* () {
22223
+ return __async$9(this, null, function* () {
22349
22224
  if (this.layer && this.layer.properties) {
22350
22225
  return this.layer.properties.property("visibility").set(false);
22351
22226
  }
22352
22227
  });
22353
22228
  }
22354
22229
  setOpacity(val) {
22355
- return __async$8(this, null, function* () {
22230
+ return __async$9(this, null, function* () {
22356
22231
  if (this.layer && this.layer.properties) {
22357
22232
  return this.layer.properties.property("opacity").set(val);
22358
22233
  }
@@ -22377,22 +22252,22 @@ var NgwLeaflet = (function () {
22377
22252
  return webmap.bookmark_resource.id;
22378
22253
  }
22379
22254
  }
22380
- fetchBookmarks() {
22255
+ fetchBookmarks(options) {
22381
22256
  const bookmarkResId = this.getBookmarksResourceId();
22382
22257
  const connector = this.options.connector;
22383
22258
  if (bookmarkResId) {
22384
- return connector.getResourceOrFail(bookmarkResId).then((item) => {
22259
+ return connector.getResourceOrFail(bookmarkResId, options).then((item) => {
22385
22260
  var _a;
22386
22261
  const labelField = (_a = item.feature_layer) == null ? void 0 : _a.fields.find(
22387
22262
  (x) => x.label_field
22388
22263
  );
22389
22264
  const keyname = labelField && labelField.keyname;
22390
- return fetchNgwLayerItems({
22265
+ return fetchNgwLayerItems(__spreadValues$8({
22391
22266
  connector,
22392
22267
  resourceId: bookmarkResId,
22393
22268
  geom: false,
22394
22269
  fields: keyname ? [keyname] : void 0
22395
- }).then((items) => {
22270
+ }, options)).then((items) => {
22396
22271
  const bookmarks = [];
22397
22272
  for (const i of items) {
22398
22273
  const bookmark = new BookmarkItem({
@@ -22411,24 +22286,24 @@ var NgwLeaflet = (function () {
22411
22286
  "Webmap was not loaded correctly, it is impossible to extract bookmarks"
22412
22287
  );
22413
22288
  }
22414
- getLegend() {
22415
- return __async$8(this, null, function* () {
22289
+ getLegend(options) {
22290
+ return __async$9(this, null, function* () {
22416
22291
  const legends = [];
22417
22292
  let deps = this.getDependLayers();
22418
22293
  deps = deps.sort((a, b) => b.id - a.id);
22419
22294
  for (const d of deps) {
22420
- const layerLegend = yield d.getLegend();
22295
+ const layerLegend = yield d.getLegend(options);
22421
22296
  legends.push(...layerLegend);
22422
22297
  }
22423
22298
  return legends;
22424
22299
  });
22425
22300
  }
22426
- getIdentificationIds() {
22427
- return __async$8(this, null, function* () {
22301
+ getIdentificationIds(options) {
22302
+ return __async$9(this, null, function* () {
22428
22303
  const visibleLayers = [];
22429
22304
  let ids = this._webmapLayersIds;
22430
22305
  if (!ids) {
22431
- ids = yield this._getWebMapIds();
22306
+ ids = yield this._getWebMapIds(options);
22432
22307
  this._webmapLayersIds = ids;
22433
22308
  }
22434
22309
  if (ids && ids.length) {
@@ -22450,7 +22325,7 @@ var NgwLeaflet = (function () {
22450
22325
  });
22451
22326
  }
22452
22327
  _getWebMapLayerItem() {
22453
- return __async$8(this, null, function* () {
22328
+ return __async$9(this, null, function* () {
22454
22329
  if (!this.resourceId) {
22455
22330
  return void 0;
22456
22331
  }
@@ -22480,7 +22355,7 @@ var NgwLeaflet = (function () {
22480
22355
  });
22481
22356
  }
22482
22357
  getWebMapConfig(id) {
22483
- return __async$8(this, null, function* () {
22358
+ return __async$9(this, null, function* () {
22484
22359
  const data = yield this.options.connector.getResource(id);
22485
22360
  if (data) {
22486
22361
  this.response = data;
@@ -22574,8 +22449,8 @@ var NgwLeaflet = (function () {
22574
22449
  }
22575
22450
  return item;
22576
22451
  }
22577
- _getWebMapIds() {
22578
- return __async$8(this, null, function* () {
22452
+ _getWebMapIds(options) {
22453
+ return __async$9(this, null, function* () {
22579
22454
  const webMapItem = this.layer;
22580
22455
  if (webMapItem && webMapItem.item.item_type === "root") {
22581
22456
  const layers = webMapItem.tree.getDescendants();
@@ -22584,7 +22459,7 @@ var NgwLeaflet = (function () {
22584
22459
  const item = x.item;
22585
22460
  if (item.item_type === "layer") {
22586
22461
  const id = item.layer_style_id;
22587
- const promise = this.options.connector.getResource(id).then((y) => {
22462
+ const promise = this.options.connector.getResource(id, options).then((y) => {
22588
22463
  if (y) {
22589
22464
  const parentId = Number(y.resource.parent.id);
22590
22465
  item.parentId = parentId;
@@ -22618,7 +22493,7 @@ var NgwLeaflet = (function () {
22618
22493
  return a;
22619
22494
  };
22620
22495
  var __publicField$a = (obj, key, value) => __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
22621
- var __async$7 = (__this, __arguments, generator) => {
22496
+ var __async$8 = (__this, __arguments, generator) => {
22622
22497
  return new Promise((resolve, reject) => {
22623
22498
  var fulfilled = (value) => {
22624
22499
  try {
@@ -22663,7 +22538,7 @@ var NgwLeaflet = (function () {
22663
22538
  classAdapters[cls] = adapter;
22664
22539
  }
22665
22540
  onLoadSync(webMap) {
22666
- return __async$7(this, null, function* () {
22541
+ return __async$8(this, null, function* () {
22667
22542
  if (this.options.resourceId && this.url) {
22668
22543
  const resourceIds = [this.options.resourceId];
22669
22544
  if (resourceIds.length) {
@@ -22746,7 +22621,7 @@ var NgwLeaflet = (function () {
22746
22621
  }
22747
22622
  identify(options = {}) {
22748
22623
  if (this._item) {
22749
- return CancelablePromise.resolve(this._item);
22624
+ return Promise.resolve(this._item);
22750
22625
  }
22751
22626
  return fetchNgwLayerItem(__spreadValues$6({
22752
22627
  connector: this.connector,
@@ -22761,30 +22636,30 @@ var NgwLeaflet = (function () {
22761
22636
  return resp;
22762
22637
  });
22763
22638
  }
22764
- resource() {
22639
+ resource(opt) {
22765
22640
  if (this._resource) {
22766
- return CancelablePromise.resolve(this._resource.feature_layer);
22641
+ return Promise.resolve(this._resource.feature_layer);
22767
22642
  }
22768
- return this.connector.getResource(this.layerId).then((resp) => {
22643
+ return this.connector.getResource(this.layerId, opt).then((resp) => {
22769
22644
  this._resource = resp;
22770
22645
  return this._resource.feature_layer;
22771
22646
  });
22772
22647
  }
22773
- getBounds() {
22648
+ getBounds(opt) {
22774
22649
  if (this._extent) {
22775
- return CancelablePromise.resolve(this._extent);
22650
+ return Promise.resolve(this._extent);
22776
22651
  }
22777
- return fetchNgwLayerItemExtent({
22652
+ return fetchNgwLayerItemExtent(__spreadValues$6({
22778
22653
  connector: this.connector,
22779
22654
  featureId: this.id,
22780
22655
  resourceId: this.layerId
22781
- });
22656
+ }, opt));
22782
22657
  }
22783
- geojson() {
22658
+ geojson(options) {
22784
22659
  if (this._geojson) {
22785
- return CancelablePromise.resolve(this._geojson);
22660
+ return Promise.resolve(this._geojson);
22786
22661
  }
22787
- return this.identify().then((resp) => {
22662
+ return this.identify(options).then((resp) => {
22788
22663
  return resp.toGeojson().then((geojson) => {
22789
22664
  this._geojson = geojson;
22790
22665
  return geojson;
@@ -22793,8 +22668,29 @@ var NgwLeaflet = (function () {
22793
22668
  }
22794
22669
  }
22795
22670
 
22671
+ var __async$7 = (__this, __arguments, generator) => {
22672
+ return new Promise((resolve, reject) => {
22673
+ var fulfilled = (value) => {
22674
+ try {
22675
+ step(generator.next(value));
22676
+ } catch (e) {
22677
+ reject(e);
22678
+ }
22679
+ };
22680
+ var rejected = (value) => {
22681
+ try {
22682
+ step(generator.throw(value));
22683
+ } catch (e) {
22684
+ reject(e);
22685
+ }
22686
+ };
22687
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
22688
+ step((generator = generator.apply(__this, __arguments)).next());
22689
+ });
22690
+ };
22796
22691
  function fetchNgwLayerFeature(options) {
22797
- return fetchNgwLayerItem(options).then((item) => {
22692
+ return __async$7(this, null, function* () {
22693
+ const item = yield fetchNgwLayerItem(options);
22798
22694
  return createGeoJsonFeature(item);
22799
22695
  });
22800
22696
  }
@@ -22879,7 +22775,7 @@ var NgwLeaflet = (function () {
22879
22775
  const withGeom = item.features.find((x) => x.geom);
22880
22776
  if (withGeom && withGeom.geom) {
22881
22777
  const geom = withGeom.geom;
22882
- return CancelablePromise.resolve(
22778
+ return Promise.resolve(
22883
22779
  createGeoJsonFeature(__spreadProps$5(__spreadValues$5({}, withGeom), {
22884
22780
  geom
22885
22781
  }))
@@ -22892,7 +22788,7 @@ var NgwLeaflet = (function () {
22892
22788
  if (params && params.length) {
22893
22789
  return fetchNgwLayerFeature(__spreadValues$5(__spreadProps$5(__spreadValues$5({}, requestOptions), { connector }), params[0]));
22894
22790
  }
22895
- return CancelablePromise.resolve(void 0);
22791
+ return Promise.resolve(void 0);
22896
22792
  }
22897
22793
  function fetchIdentifyItem(options) {
22898
22794
  const { connector, identify } = options;
@@ -22902,7 +22798,7 @@ var NgwLeaflet = (function () {
22902
22798
  connector
22903
22799
  }, options.requestOptions), params[0]));
22904
22800
  }
22905
- return CancelablePromise.resolve(void 0);
22801
+ return Promise.resolve(void 0);
22906
22802
  }
22907
22803
  function featureLayerIdentify(options) {
22908
22804
  const { geom, signal, cache, layers } = options;
@@ -22946,9 +22842,9 @@ var NgwLeaflet = (function () {
22946
22842
  function sendIdentifyRequest(ev, options) {
22947
22843
  deprecatedMapClick(ev);
22948
22844
  const [lng, lat] = ev.lngLat;
22949
- const { geom, radius, signal, cache } = options;
22845
+ const { geom, radius } = options;
22950
22846
  const geom_ = geom != null ? geom : getCirclePolygonCoordinates(lng, lat, radius);
22951
- return featureLayerIdentify(__spreadProps$5(__spreadValues$5({}, options), { geom: geom_, signal, cache }));
22847
+ return featureLayerIdentify(__spreadProps$5(__spreadValues$5({}, options), { geom: geom_ }));
22952
22848
  }
22953
22849
  function createIdentifyItem(opt) {
22954
22850
  return new IdentifyItem(opt);
@@ -23294,7 +23190,7 @@ var NgwLeaflet = (function () {
23294
23190
  __publicField$3(this, "_mapState", []);
23295
23191
  __publicField$3(this, "_extent");
23296
23192
  __publicField$3(this, "_eventsStatus", {});
23297
- __publicField$3(this, "_coordFromMapClickPromise");
23193
+ __publicField$3(this, "_coordFromMapClickAbort");
23298
23194
  __publicField$3(this, "_mapEvents", {});
23299
23195
  this.mapAdapter = mapOptions.mapAdapter;
23300
23196
  this._starterKits = mapOptions.starterKits || [];
@@ -23609,36 +23505,34 @@ var NgwLeaflet = (function () {
23609
23505
  return { stop };
23610
23506
  }
23611
23507
  stopGetCoordFromMapClick() {
23612
- if (this._coordFromMapClickPromise) {
23613
- this._coordFromMapClickPromise.cancel();
23508
+ if (this._coordFromMapClickAbort) {
23509
+ this._coordFromMapClickAbort();
23510
+ this._coordFromMapClickAbort = void 0;
23614
23511
  }
23615
23512
  }
23616
23513
  getCoordFromMapClick() {
23617
- if (!this._coordFromMapClickPromise) {
23618
- this._coordFromMapClickPromise = new CancelablePromise(
23619
- (resolve, reject, onCancel) => {
23620
- const cursor = this.getCursor() || "grab";
23621
- this._removeEventListeners({ include: ["click"] });
23622
- this.setCursor("crosshair");
23623
- const onCancel_ = () => {
23624
- this.setCursor(cursor);
23625
- this._addEventsListeners({ include: ["click"] });
23626
- this.mapAdapter.emitter.off("click", onMapClick);
23627
- this._coordFromMapClickPromise = void 0;
23628
- };
23629
- const onMapClick = (e) => {
23630
- onCancel_();
23631
- deprecatedMapClick(e);
23632
- resolve(e.lngLat);
23633
- };
23634
- this.mapAdapter.emitter.once("click", onMapClick);
23635
- onCancel(onCancel_);
23636
- }
23637
- );
23514
+ if (!this._coordFromMapClickAbort) {
23515
+ return new Promise((resolve, reject) => {
23516
+ const cursor = this.getCursor() || "grab";
23517
+ this._removeEventListeners({ include: ["click"] });
23518
+ this.setCursor("crosshair");
23519
+ const onCancel_ = () => {
23520
+ this.setCursor(cursor);
23521
+ this._addEventsListeners({ include: ["click"] });
23522
+ this.mapAdapter.emitter.off("click", onMapClick);
23523
+ this._coordFromMapClickAbort = void 0;
23524
+ };
23525
+ const onMapClick = (e) => {
23526
+ onCancel_();
23527
+ deprecatedMapClick(e);
23528
+ resolve(e.lngLat);
23529
+ };
23530
+ this.mapAdapter.emitter.once("click", onMapClick);
23531
+ this._coordFromMapClickAbort = onCancel_;
23532
+ });
23638
23533
  } else {
23639
23534
  return this.getCoordFromMapClick();
23640
23535
  }
23641
- return this._coordFromMapClickPromise;
23642
23536
  }
23643
23537
  _emitStatusEvent(eventName, data) {
23644
23538
  const _eventName = eventName;
@@ -25427,26 +25321,35 @@ var NgwLeaflet = (function () {
25427
25321
  }, options));
25428
25322
  }
25429
25323
  fetchIdentifyItem(identify, requestOptions) {
25324
+ const abortController = new AbortController();
25325
+ const abortSignal = abortController.signal;
25326
+ if (requestOptions == null ? void 0 : requestOptions.signal) {
25327
+ requestOptions.signal.addEventListener("abort", abortController.abort);
25328
+ }
25329
+ requestOptions = requestOptions || {};
25330
+ requestOptions.signal = abortSignal;
25430
25331
  const promise = fetchIdentifyItem({
25431
25332
  identify,
25432
25333
  connector: this.connector,
25433
25334
  requestOptions
25434
25335
  // multiple,
25435
25336
  });
25436
- this._addPromise("identify", promise);
25337
+ this._addPromise("identify", promise, abortController);
25437
25338
  return promise;
25438
25339
  }
25439
25340
  fetchIdentifyGeoJson(identify, multiple = false) {
25341
+ const abortController = new AbortController();
25440
25342
  const promise = fetchIdentifyGeoJson({
25441
25343
  identify,
25442
25344
  connector: this.connector,
25443
- multiple
25345
+ multiple,
25346
+ requestOptions: { signal: abortController.signal }
25444
25347
  });
25445
25348
  if (promise && "then" in promise) {
25446
- this._addPromise("identify", promise);
25349
+ this._addPromise("identify", promise, abortController);
25447
25350
  return promise;
25448
25351
  } else {
25449
- return CancelablePromise.resolve(promise);
25352
+ return Promise.resolve(promise);
25450
25353
  }
25451
25354
  }
25452
25355
  /**
@@ -25620,7 +25523,7 @@ var NgwLeaflet = (function () {
25620
25523
  args.forEach((name) => {
25621
25524
  const group = this._promises[name];
25622
25525
  if (group) {
25623
- group.forEach((x) => x.cancel());
25526
+ group.forEach((x) => x[1].abort());
25624
25527
  this._promises[name] = [];
25625
25528
  }
25626
25529
  });
@@ -25687,11 +25590,13 @@ var NgwLeaflet = (function () {
25687
25590
  }, highlightDuration);
25688
25591
  }
25689
25592
  }
25593
+ const abortController = new AbortController();
25690
25594
  const selectPromise = sendIdentifyRequest(ev, {
25691
25595
  layers: ids,
25692
25596
  connector: this.connector,
25693
25597
  radius,
25694
- geom
25598
+ geom,
25599
+ signal: abortController.signal
25695
25600
  }).then((resp) => {
25696
25601
  const identify = __spreadProps$1(__spreadValues$1({}, resp), {
25697
25602
  resources: ids,
@@ -25702,22 +25607,22 @@ var NgwLeaflet = (function () {
25702
25607
  this._emitStatusEvent("ngw:select", identifyEvent);
25703
25608
  return identifyEvent;
25704
25609
  });
25705
- this._addPromise("select", selectPromise);
25610
+ this._addPromise("select", selectPromise, abortController);
25706
25611
  return selectPromise;
25707
25612
  });
25708
25613
  }
25709
- _addPromise(groupName, promise) {
25614
+ _addPromise(groupName, promise, abortController) {
25710
25615
  const group = this._promises[groupName];
25711
- if (group && group.indexOf(promise) === -1) {
25616
+ if (group && group.findIndex((g) => g[0] === promise) === -1) {
25712
25617
  const removeFromGroup = () => {
25713
- const index = group.indexOf(promise);
25618
+ const index = group.findIndex((g) => g[0] === promise);
25714
25619
  if (index !== -1) {
25715
25620
  group.splice(index, 1);
25716
25621
  }
25717
25622
  };
25718
25623
  promise.then(removeFromGroup);
25719
25624
  promise.catch(removeFromGroup);
25720
- group.push(promise);
25625
+ group.push([promise, abortController]);
25721
25626
  }
25722
25627
  }
25723
25628
  _isFitFromResource() {