@nextgis/ngw-leaflet 2.4.1 → 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 2.4.1; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 3.0.0-alpha.0; author: NextGIS */
2
2
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -14933,7 +14933,7 @@ var NgwLeaflet = (function () {
14933
14933
  }
14934
14934
 
14935
14935
  function round(val, toFixed) {
14936
- const n = toFixed ? Number("1e+" + toFixed) : 1;
14936
+ const n = 1;
14937
14937
  return Math.round((val + Number.EPSILON) * n) / n;
14938
14938
  }
14939
14939
 
@@ -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$j = Object.defineProperties;
16162
16162
  var __getOwnPropDescs$j = 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$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(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, typeof key !== "symbol" ? key + "" : 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$j(__spreadValues$x({
16273
+ const divIcon = new leafletSrcExports.DivIcon(__spreadProps$j(__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$i = Object.defineProperties;
16323
16323
  var __getOwnPropDescs$i = 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$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(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$i(__spreadValues$w({}, options.nativeOptions), {
16388
+ this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$i(__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$i(__spreadValues$w({}, PAINT), { type: "path" }));
16738
+ return this._paint.preparePaint(__spreadProps$i(__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
@@ -16922,20 +16922,20 @@ var NgwLeaflet = (function () {
16922
16922
  return [promise, abortFunc];
16923
16923
  }
16924
16924
 
16925
- var __defProp$S = Object.defineProperty;
16926
- var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16927
- var __publicField$E = (obj, key, value) => __defNormalProp$S(obj, typeof key !== "symbol" ? key + "" : key, value);
16925
+ var __defProp$P = Object.defineProperty;
16926
+ var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16927
+ var __publicField$A = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
16928
16928
  class Queue {
16929
16929
  /**
16930
16930
  * @param {PromiseQueueOptions} options - Configuration options for the queue.
16931
16931
  */
16932
16932
  constructor({ concurrency = 1, delay = 0 } = {}) {
16933
- __publicField$E(this, "queue", []);
16934
- __publicField$E(this, "concurrency");
16935
- __publicField$E(this, "activeCount", 0);
16936
- __publicField$E(this, "timeoutId");
16937
- __publicField$E(this, "delay");
16938
- __publicField$E(this, "toAbort", []);
16933
+ __publicField$A(this, "queue", []);
16934
+ __publicField$A(this, "concurrency");
16935
+ __publicField$A(this, "activeCount", 0);
16936
+ __publicField$A(this, "timeoutId");
16937
+ __publicField$A(this, "delay");
16938
+ __publicField$A(this, "toAbort", []);
16939
16939
  this.concurrency = concurrency;
16940
16940
  this.delay = delay;
16941
16941
  }
@@ -17011,13 +17011,13 @@ var NgwLeaflet = (function () {
17011
17011
 
17012
17012
  const imageQueue = new Queue({ concurrency: 6, delay: 200 });
17013
17013
 
17014
- var __defProp$R = Object.defineProperty;
17015
- var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17016
- var __publicField$D = (obj, key, value) => __defNormalProp$R(obj, typeof key !== "symbol" ? key + "" : key, value);
17014
+ var __defProp$O = Object.defineProperty;
17015
+ var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17016
+ var __publicField$z = (obj, key, value) => __defNormalProp$O(obj, key + "" , value);
17017
17017
  class ImageOverlay extends leafletSrcExports.ImageOverlay {
17018
17018
  constructor(imageUrl, bounds, options) {
17019
17019
  super(imageUrl, bounds, options);
17020
- __publicField$D(this, "_aborter");
17020
+ __publicField$z(this, "_aborter");
17021
17021
  }
17022
17022
  cancelLoad() {
17023
17023
  if (this._aborter) {
@@ -17042,13 +17042,13 @@ var NgwLeaflet = (function () {
17042
17042
  }
17043
17043
  }
17044
17044
 
17045
- var __defProp$Q = Object.defineProperty;
17046
- var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17047
- var __publicField$C = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
17045
+ var __defProp$N = Object.defineProperty;
17046
+ var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17047
+ var __publicField$y = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
17048
17048
  class ImageLayer extends leafletSrcExports.Layer {
17049
17049
  constructor(url, options) {
17050
17050
  super(options);
17051
- __publicField$C(this, "defaultWmsParams", {
17051
+ __publicField$y(this, "defaultWmsParams", {
17052
17052
  service: "WMS",
17053
17053
  request: "GetMap",
17054
17054
  version: "1.1.1",
@@ -17057,7 +17057,7 @@ var NgwLeaflet = (function () {
17057
17057
  format: "image/jpeg",
17058
17058
  transparent: false
17059
17059
  });
17060
- __publicField$C(this, "options", {
17060
+ __publicField$y(this, "options", {
17061
17061
  crs: null,
17062
17062
  uppercase: false,
17063
17063
  attribution: "",
@@ -17069,11 +17069,11 @@ var NgwLeaflet = (function () {
17069
17069
  viewPortBuffer: 0,
17070
17070
  setViewDelay: 100
17071
17071
  });
17072
- __publicField$C(this, "wmsParams");
17073
- __publicField$C(this, "_url");
17074
- __publicField$C(this, "_currentUrl");
17075
- __publicField$C(this, "_currentOverlay");
17076
- __publicField$C(this, "_loadedOverlay");
17072
+ __publicField$y(this, "wmsParams");
17073
+ __publicField$y(this, "_url");
17074
+ __publicField$y(this, "_currentUrl");
17075
+ __publicField$y(this, "_currentOverlay");
17076
+ __publicField$y(this, "_loadedOverlay");
17077
17077
  this._url = url;
17078
17078
  const params = {};
17079
17079
  const opts = {};
@@ -17232,34 +17232,34 @@ var NgwLeaflet = (function () {
17232
17232
  }
17233
17233
  }
17234
17234
 
17235
- var __defProp$P = Object.defineProperty;
17236
- var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
17237
- var __hasOwnProp$w = Object.prototype.hasOwnProperty;
17238
- var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
17239
- var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17240
- var __spreadValues$v = (a, b) => {
17235
+ var __defProp$M = Object.defineProperty;
17236
+ var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
17237
+ var __hasOwnProp$y = Object.prototype.hasOwnProperty;
17238
+ var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
17239
+ var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17240
+ var __spreadValues$x = (a, b) => {
17241
17241
  for (var prop in b || (b = {}))
17242
- if (__hasOwnProp$w.call(b, prop))
17243
- __defNormalProp$P(a, prop, b[prop]);
17244
- if (__getOwnPropSymbols$w)
17245
- for (var prop of __getOwnPropSymbols$w(b)) {
17246
- if (__propIsEnum$w.call(b, prop))
17247
- __defNormalProp$P(a, prop, b[prop]);
17242
+ if (__hasOwnProp$y.call(b, prop))
17243
+ __defNormalProp$M(a, prop, b[prop]);
17244
+ if (__getOwnPropSymbols$y)
17245
+ for (var prop of __getOwnPropSymbols$y(b)) {
17246
+ if (__propIsEnum$y.call(b, prop))
17247
+ __defNormalProp$M(a, prop, b[prop]);
17248
17248
  }
17249
17249
  return a;
17250
17250
  };
17251
- var __publicField$B = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
17251
+ var __publicField$x = (obj, key, value) => __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
17252
17252
  class ImageAdapter extends BaseAdapter {
17253
17253
  constructor() {
17254
17254
  super(...arguments);
17255
- __publicField$B(this, "layer");
17255
+ __publicField$x(this, "layer");
17256
17256
  }
17257
17257
  addLayer(options) {
17258
17258
  const url = options && options.url;
17259
17259
  if (url) {
17260
- options = __spreadValues$v({ transparent: true }, options);
17260
+ options = __spreadValues$x({ transparent: true }, options);
17261
17261
  const updateWmsParamsFromOpt = options.updateWmsParams;
17262
- this.layer = new ImageLayer(url, __spreadValues$v(__spreadValues$v(__spreadValues$v({
17262
+ this.layer = new ImageLayer(url, __spreadValues$x(__spreadValues$x(__spreadValues$x({
17263
17263
  pane: this.pane,
17264
17264
  headers: options.headers,
17265
17265
  setViewDelay: options.setViewDelay
@@ -17275,7 +17275,7 @@ var NgwLeaflet = (function () {
17275
17275
  }
17276
17276
  }
17277
17277
  }
17278
- __publicField$B(ImageAdapter, "queue", imageQueue);
17278
+ __publicField$x(ImageAdapter, "queue", imageQueue);
17279
17279
 
17280
17280
  function makeRemote(Base) {
17281
17281
  return class RemoteTileLayer extends Base {
@@ -17337,33 +17337,33 @@ var NgwLeaflet = (function () {
17337
17337
  }
17338
17338
  const TileLayer = makeRemote(TileLayerBase);
17339
17339
 
17340
- var __defProp$O = Object.defineProperty;
17340
+ var __defProp$L = Object.defineProperty;
17341
17341
  var __defProps$h = Object.defineProperties;
17342
17342
  var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
17343
- var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
17344
- var __hasOwnProp$v = Object.prototype.hasOwnProperty;
17345
- var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
17346
- var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17347
- var __spreadValues$u = (a, b) => {
17343
+ var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
17344
+ var __hasOwnProp$x = Object.prototype.hasOwnProperty;
17345
+ var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
17346
+ var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17347
+ var __spreadValues$w = (a, b) => {
17348
17348
  for (var prop in b || (b = {}))
17349
- if (__hasOwnProp$v.call(b, prop))
17350
- __defNormalProp$O(a, prop, b[prop]);
17351
- if (__getOwnPropSymbols$v)
17352
- for (var prop of __getOwnPropSymbols$v(b)) {
17353
- if (__propIsEnum$v.call(b, prop))
17354
- __defNormalProp$O(a, prop, b[prop]);
17349
+ if (__hasOwnProp$x.call(b, prop))
17350
+ __defNormalProp$L(a, prop, b[prop]);
17351
+ if (__getOwnPropSymbols$x)
17352
+ for (var prop of __getOwnPropSymbols$x(b)) {
17353
+ if (__propIsEnum$x.call(b, prop))
17354
+ __defNormalProp$L(a, prop, b[prop]);
17355
17355
  }
17356
17356
  return a;
17357
17357
  };
17358
17358
  var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
17359
- var __objRest$3 = (source, exclude) => {
17359
+ var __objRest$4 = (source, exclude) => {
17360
17360
  var target = {};
17361
17361
  for (var prop in source)
17362
- if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
17362
+ if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
17363
17363
  target[prop] = source[prop];
17364
- if (source != null && __getOwnPropSymbols$v)
17365
- for (var prop of __getOwnPropSymbols$v(source)) {
17366
- if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
17364
+ if (source != null && __getOwnPropSymbols$x)
17365
+ for (var prop of __getOwnPropSymbols$x(source)) {
17366
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
17367
17367
  target[prop] = source[prop];
17368
17368
  }
17369
17369
  return target;
@@ -17372,9 +17372,9 @@ var NgwLeaflet = (function () {
17372
17372
  addLayer(options) {
17373
17373
  this.options = Object.assign(this.options, options);
17374
17374
  if (options) {
17375
- const _a = options, { url } = _a, opt = __objRest$3(_a, ["url"]);
17375
+ const _a = options, { url } = _a, opt = __objRest$4(_a, ["url"]);
17376
17376
  if (url) {
17377
- const tileLayerOptions = __spreadValues$u({
17377
+ const tileLayerOptions = __spreadValues$w({
17378
17378
  pane: this.pane,
17379
17379
  attribution: opt.attribution,
17380
17380
  minZoom: opt.minZoom,
@@ -17385,7 +17385,7 @@ var NgwLeaflet = (function () {
17385
17385
  }
17386
17386
  let layer;
17387
17387
  if (opt.headers) {
17388
- layer = new TileLayer(url, __spreadProps$h(__spreadValues$u({}, tileLayerOptions), {
17388
+ layer = new TileLayer(url, __spreadProps$h(__spreadValues$w({}, tileLayerOptions), {
17389
17389
  headers: opt.headers,
17390
17390
  setViewDelay: opt.setViewDelay
17391
17391
  }));
@@ -17408,21 +17408,21 @@ var NgwLeaflet = (function () {
17408
17408
  }
17409
17409
  }
17410
17410
 
17411
- var __defProp$N = Object.defineProperty;
17411
+ var __defProp$K = Object.defineProperty;
17412
17412
  var __defProps$g = Object.defineProperties;
17413
17413
  var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
17414
- var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
17415
- var __hasOwnProp$u = Object.prototype.hasOwnProperty;
17416
- var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
17417
- var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17418
- var __spreadValues$t = (a, b) => {
17414
+ var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
17415
+ var __hasOwnProp$w = Object.prototype.hasOwnProperty;
17416
+ var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
17417
+ var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17418
+ var __spreadValues$v = (a, b) => {
17419
17419
  for (var prop in b || (b = {}))
17420
- if (__hasOwnProp$u.call(b, prop))
17421
- __defNormalProp$N(a, prop, b[prop]);
17422
- if (__getOwnPropSymbols$u)
17423
- for (var prop of __getOwnPropSymbols$u(b)) {
17424
- if (__propIsEnum$u.call(b, prop))
17425
- __defNormalProp$N(a, prop, b[prop]);
17420
+ if (__hasOwnProp$w.call(b, prop))
17421
+ __defNormalProp$K(a, prop, b[prop]);
17422
+ if (__getOwnPropSymbols$w)
17423
+ for (var prop of __getOwnPropSymbols$w(b)) {
17424
+ if (__propIsEnum$w.call(b, prop))
17425
+ __defNormalProp$K(a, prop, b[prop]);
17426
17426
  }
17427
17427
  return a;
17428
17428
  };
@@ -17430,7 +17430,7 @@ var NgwLeaflet = (function () {
17430
17430
  class OsmAdapter extends TileAdapter {
17431
17431
  addLayer(options) {
17432
17432
  const url = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
17433
- return super.addLayer(__spreadProps$g(__spreadValues$t({
17433
+ return super.addLayer(__spreadProps$g(__spreadValues$v({
17434
17434
  name: "OpenStreetMap",
17435
17435
  attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
17436
17436
  }, options), {
@@ -17446,33 +17446,33 @@ var NgwLeaflet = (function () {
17446
17446
  }
17447
17447
  const WmsLayer = makeRemote(WmsLayerBase);
17448
17448
 
17449
- var __defProp$M = Object.defineProperty;
17449
+ var __defProp$J = Object.defineProperty;
17450
17450
  var __defProps$f = Object.defineProperties;
17451
17451
  var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
17452
- var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
17453
- var __hasOwnProp$t = Object.prototype.hasOwnProperty;
17454
- var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
17455
- var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17456
- var __spreadValues$s = (a, b) => {
17457
- for (var prop in b || (b = {}))
17458
- if (__hasOwnProp$t.call(b, prop))
17459
- __defNormalProp$M(a, prop, b[prop]);
17460
- if (__getOwnPropSymbols$t)
17461
- for (var prop of __getOwnPropSymbols$t(b)) {
17462
- if (__propIsEnum$t.call(b, prop))
17463
- __defNormalProp$M(a, prop, b[prop]);
17452
+ var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
17453
+ var __hasOwnProp$v = Object.prototype.hasOwnProperty;
17454
+ var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
17455
+ var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17456
+ var __spreadValues$u = (a, b) => {
17457
+ for (var prop in b || (b = {}))
17458
+ if (__hasOwnProp$v.call(b, prop))
17459
+ __defNormalProp$J(a, prop, b[prop]);
17460
+ if (__getOwnPropSymbols$v)
17461
+ for (var prop of __getOwnPropSymbols$v(b)) {
17462
+ if (__propIsEnum$v.call(b, prop))
17463
+ __defNormalProp$J(a, prop, b[prop]);
17464
17464
  }
17465
17465
  return a;
17466
17466
  };
17467
17467
  var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
17468
- var __objRest$2 = (source, exclude) => {
17468
+ var __objRest$3 = (source, exclude) => {
17469
17469
  var target = {};
17470
17470
  for (var prop in source)
17471
- if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
17471
+ if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
17472
17472
  target[prop] = source[prop];
17473
- if (source != null && __getOwnPropSymbols$t)
17474
- for (var prop of __getOwnPropSymbols$t(source)) {
17475
- if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
17473
+ if (source != null && __getOwnPropSymbols$v)
17474
+ for (var prop of __getOwnPropSymbols$v(source)) {
17475
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
17476
17476
  target[prop] = source[prop];
17477
17477
  }
17478
17478
  return target;
@@ -17480,9 +17480,9 @@ var NgwLeaflet = (function () {
17480
17480
  class WmsAdapter extends BaseAdapter {
17481
17481
  addLayer(options) {
17482
17482
  Object.assign(this.options, options);
17483
- const _a = options, { url } = _a, opt = __objRest$2(_a, ["url"]);
17483
+ const _a = options, { url } = _a, opt = __objRest$3(_a, ["url"]);
17484
17484
  if (url) {
17485
- const layerOptions = __spreadValues$s({
17485
+ const layerOptions = __spreadValues$u({
17486
17486
  pane: this.pane,
17487
17487
  attribution: opt.attribution,
17488
17488
  minZoom: opt.minZoom,
@@ -17493,7 +17493,7 @@ var NgwLeaflet = (function () {
17493
17493
  }, options.nativeOptions);
17494
17494
  let layer;
17495
17495
  if (opt.headers) {
17496
- layer = new WmsLayer(url, __spreadProps$f(__spreadValues$s({}, layerOptions), { headers: opt.headers }));
17496
+ layer = new WmsLayer(url, __spreadProps$f(__spreadValues$u({}, layerOptions), { headers: opt.headers }));
17497
17497
  } else {
17498
17498
  layer = new leafletSrcExports.TileLayer.WMS(url, layerOptions);
17499
17499
  }
@@ -17510,33 +17510,33 @@ var NgwLeaflet = (function () {
17510
17510
  ];
17511
17511
  }
17512
17512
 
17513
- var __defProp$L = Object.defineProperty;
17514
- var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
17515
- var __hasOwnProp$s = Object.prototype.hasOwnProperty;
17516
- var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
17517
- var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17518
- var __spreadValues$r = (a, b) => {
17513
+ var __defProp$I = Object.defineProperty;
17514
+ var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
17515
+ var __hasOwnProp$u = Object.prototype.hasOwnProperty;
17516
+ var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
17517
+ var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17518
+ var __spreadValues$t = (a, b) => {
17519
17519
  for (var prop in b || (b = {}))
17520
- if (__hasOwnProp$s.call(b, prop))
17521
- __defNormalProp$L(a, prop, b[prop]);
17522
- if (__getOwnPropSymbols$s)
17523
- for (var prop of __getOwnPropSymbols$s(b)) {
17524
- if (__propIsEnum$s.call(b, prop))
17525
- __defNormalProp$L(a, prop, b[prop]);
17520
+ if (__hasOwnProp$u.call(b, prop))
17521
+ __defNormalProp$I(a, prop, b[prop]);
17522
+ if (__getOwnPropSymbols$u)
17523
+ for (var prop of __getOwnPropSymbols$u(b)) {
17524
+ if (__propIsEnum$u.call(b, prop))
17525
+ __defNormalProp$I(a, prop, b[prop]);
17526
17526
  }
17527
17527
  return a;
17528
17528
  };
17529
- var __publicField$A = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
17529
+ var __publicField$w = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
17530
17530
  const _LeafletMapAdapter = class _LeafletMapAdapter {
17531
17531
  constructor() {
17532
- __publicField$A(this, "options", { target: "map" });
17533
- __publicField$A(this, "layerAdapters", _LeafletMapAdapter.layerAdapters);
17534
- __publicField$A(this, "controlAdapters", _LeafletMapAdapter.controlAdapters);
17535
- __publicField$A(this, "emitter", new EventEmitter());
17536
- __publicField$A(this, "map");
17537
- __publicField$A(this, "_resizeObserver");
17538
- __publicField$A(this, "_unselectCb", []);
17539
- __publicField$A(this, "_universalEvents", [
17532
+ __publicField$w(this, "options", { target: "map" });
17533
+ __publicField$w(this, "layerAdapters", _LeafletMapAdapter.layerAdapters);
17534
+ __publicField$w(this, "controlAdapters", _LeafletMapAdapter.controlAdapters);
17535
+ __publicField$w(this, "emitter", new EventEmitter());
17536
+ __publicField$w(this, "map");
17537
+ __publicField$w(this, "_resizeObserver");
17538
+ __publicField$w(this, "_unselectCb", []);
17539
+ __publicField$w(this, "_universalEvents", [
17540
17540
  "move",
17541
17541
  "zoom",
17542
17542
  "zoomend",
@@ -17544,14 +17544,14 @@ var NgwLeaflet = (function () {
17544
17544
  "moveend",
17545
17545
  "movestart"
17546
17546
  ]);
17547
- __publicField$A(this, "_positionEvents", [
17547
+ __publicField$w(this, "_positionEvents", [
17548
17548
  "mousemove",
17549
17549
  "mouseout",
17550
17550
  "mouseover"
17551
17551
  ]);
17552
17552
  }
17553
17553
  create(options) {
17554
- this.options = __spreadValues$r({}, options);
17554
+ this.options = __spreadValues$t({}, options);
17555
17555
  if (this.options.target) {
17556
17556
  const {
17557
17557
  zoom,
@@ -17561,7 +17561,7 @@ var NgwLeaflet = (function () {
17561
17561
  maxBounds: mb,
17562
17562
  mapAdapterOptions
17563
17563
  } = this.options;
17564
- this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$r({
17564
+ this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$t({
17565
17565
  attributionControl: false,
17566
17566
  zoomControl: false,
17567
17567
  maxBounds: mb ? arrayToBoundsExpression(mb) : void 0,
@@ -17844,7 +17844,7 @@ var NgwLeaflet = (function () {
17844
17844
  }
17845
17845
  }
17846
17846
  };
17847
- __publicField$A(_LeafletMapAdapter, "layerAdapters", {
17847
+ __publicField$w(_LeafletMapAdapter, "layerAdapters", {
17848
17848
  GEOJSON: GeoJsonAdapter,
17849
17849
  IMAGE: ImageAdapter,
17850
17850
  TILE: TileAdapter,
@@ -17852,315 +17852,13 @@ var NgwLeaflet = (function () {
17852
17852
  // // MVT: MvtAdapter,
17853
17853
  OSM: OsmAdapter
17854
17854
  });
17855
- __publicField$A(_LeafletMapAdapter, "controlAdapters", {
17855
+ __publicField$w(_LeafletMapAdapter, "controlAdapters", {
17856
17856
  ZOOM: leafletSrcExports.Control.Zoom,
17857
17857
  ATTRIBUTION: AttributionControl
17858
17858
  });
17859
- __publicField$A(_LeafletMapAdapter, "Map", leafletSrcExports.Map);
17859
+ __publicField$w(_LeafletMapAdapter, "Map", leafletSrcExports.Map);
17860
17860
  let LeafletMapAdapter = _LeafletMapAdapter;
17861
17861
 
17862
- var __defProp$K = Object.defineProperty;
17863
- var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17864
- var __publicField$z = (obj, key, value) => __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
17865
- class CancelError extends Error {
17866
- constructor() {
17867
- super();
17868
- __publicField$z(this, "name", "CancelError");
17869
- Object.setPrototypeOf(this, CancelError.prototype);
17870
- }
17871
- }
17872
-
17873
- var __defProp$J = Object.defineProperty;
17874
- var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17875
- var __publicField$y = (obj, key, value) => __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
17876
- class PromiseControl {
17877
- constructor(options = {}) {
17878
- this.options = options;
17879
- __publicField$y(this, "_promises", /* @__PURE__ */ new Map());
17880
- }
17881
- get isLoaded() {
17882
- return this._promises.size > 0;
17883
- }
17884
- remove(promise) {
17885
- if (this._promises.has(promise)) {
17886
- this._promises.delete(promise);
17887
- this._onStop();
17888
- }
17889
- }
17890
- get(promise) {
17891
- return this._promises.get(promise);
17892
- }
17893
- add(promise, name) {
17894
- const key = name ? name : promise;
17895
- const exist = this._promises.get(key);
17896
- if (this.options.onStart && !this.isLoaded) {
17897
- this.options.onStart();
17898
- }
17899
- if (exist) {
17900
- return exist;
17901
- }
17902
- this._promises.set(key, promise);
17903
- promise.finally(() => {
17904
- this.remove(key);
17905
- });
17906
- return promise;
17907
- }
17908
- abort() {
17909
- if (this.isLoaded) {
17910
- this._promises.forEach((x) => {
17911
- if (x.cancel) {
17912
- x.cancel();
17913
- }
17914
- });
17915
- this._promises.clear();
17916
- this._onStop();
17917
- }
17918
- }
17919
- waitFunc(func, name = "") {
17920
- name = name || func.name;
17921
- const exist = this.get(name);
17922
- if (exist) {
17923
- return exist;
17924
- }
17925
- return this.add(func(), name);
17926
- }
17927
- WaitForMe(name = "") {
17928
- const get = this.get.bind(this);
17929
- const add = this.add.bind(this);
17930
- return function(target, key, descriptor) {
17931
- const originalMethod = descriptor.value;
17932
- name = name || key;
17933
- descriptor.value = function(...args) {
17934
- const exist = get(name);
17935
- if (exist) {
17936
- return exist;
17937
- }
17938
- const result = add(originalMethod.apply(this, args), name);
17939
- return result;
17940
- };
17941
- return descriptor;
17942
- };
17943
- }
17944
- /** @deprecated use {@link PromiseControl.WaitForMe } instead */
17945
- GetOrCreateDecorator(name = "") {
17946
- return this.WaitForMe(name);
17947
- }
17948
- _onStop() {
17949
- if (this.options.onStop && !this.isLoaded) {
17950
- this.options.onStop();
17951
- }
17952
- }
17953
- }
17954
-
17955
- var __defProp$I = Object.defineProperty;
17956
- var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17957
- var __publicField$x = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
17958
- class TimeoutError extends Error {
17959
- constructor() {
17960
- super();
17961
- __publicField$x(this, "name", "TimeoutError");
17962
- Object.setPrototypeOf(this, TimeoutError.prototype);
17963
- }
17964
- }
17965
-
17966
- var __defProp$H = Object.defineProperty;
17967
- var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17968
- var __publicField$w = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
17969
- var _a;
17970
- const handleCallback = (resolve, reject, callback, r) => {
17971
- try {
17972
- resolve(callback(r));
17973
- } catch (e) {
17974
- reject(e);
17975
- }
17976
- };
17977
- let ID$3 = 0;
17978
- _a = Symbol.toStringTag;
17979
- const _CancelablePromise = class _CancelablePromise {
17980
- constructor(executor, timeout) {
17981
- // @ts-ignore
17982
- __publicField$w(this, _a);
17983
- __publicField$w(this, "id", ID$3++);
17984
- __publicField$w(this, "_isCanceled", false);
17985
- __publicField$w(this, "_isPending", true);
17986
- __publicField$w(this, "_promise");
17987
- __publicField$w(this, "_cancelPromise");
17988
- __publicField$w(this, "_cancelHandlers", []);
17989
- __publicField$w(this, "_setCanceledCallback");
17990
- __publicField$w(this, "_parentPromise");
17991
- __publicField$w(this, "_children", []);
17992
- this._cancelPromise = new Promise((resolve_, reject_) => {
17993
- this._setCanceledCallback = (er) => resolve_(er || new CancelError());
17994
- });
17995
- const promises = [
17996
- this._cancelPromise,
17997
- new Promise((resolve, reject) => {
17998
- const onResolve = (value) => {
17999
- if (value instanceof _CancelablePromise) {
18000
- this.attach(value);
18001
- } else {
18002
- this._isPending = false;
18003
- }
18004
- resolve(value);
18005
- };
18006
- const onReject = (error) => {
18007
- this._isPending = false;
18008
- reject(error);
18009
- };
18010
- const onCancel = (handler) => {
18011
- if (!this._isPending) {
18012
- throw new Error(
18013
- "The `onCancel` handler was attached after the promise settled."
18014
- );
18015
- }
18016
- this._cancelHandlers.push(handler);
18017
- };
18018
- return executor(onResolve, onReject, onCancel);
18019
- })
18020
- ];
18021
- if (timeout) {
18022
- promises.push(
18023
- new Promise((resolve, reject) => {
18024
- setTimeout(() => {
18025
- if (this._isPending) {
18026
- try {
18027
- this.cancel();
18028
- } finally {
18029
- reject(new TimeoutError());
18030
- }
18031
- }
18032
- }, timeout);
18033
- })
18034
- );
18035
- }
18036
- this._promise = Promise.race(promises);
18037
- }
18038
- static createControl(opt) {
18039
- return new PromiseControl(opt);
18040
- }
18041
- static resolve(value) {
18042
- return new _CancelablePromise((resolve) => resolve(value));
18043
- }
18044
- static reject(value) {
18045
- return new _CancelablePromise((resolve, reject) => reject(value));
18046
- }
18047
- static all(values) {
18048
- return new _CancelablePromise((resolve, reject) => {
18049
- Promise.all(values).then(resolve).catch(reject);
18050
- }).catch((er) => {
18051
- if (er instanceof this.CancelError) {
18052
- for (const v of values) {
18053
- const v_ = v;
18054
- if ("cancel" in v_) {
18055
- v_.cancel();
18056
- }
18057
- }
18058
- }
18059
- throw er;
18060
- });
18061
- }
18062
- attach(p) {
18063
- if (this._isCanceled) {
18064
- p.cancel();
18065
- } else {
18066
- this._children.push(p);
18067
- }
18068
- }
18069
- then(onfulfilled, onrejected) {
18070
- const p = new _CancelablePromise((resolve, reject) => {
18071
- if (this._promise) {
18072
- const reject_ = (r) => {
18073
- if (onrejected) {
18074
- handleCallback(resolve, reject, onrejected, r);
18075
- } else {
18076
- reject(r);
18077
- }
18078
- };
18079
- this._promise.then((r) => {
18080
- if (this._isCanceled) {
18081
- reject_(r);
18082
- } else {
18083
- if (onfulfilled) {
18084
- handleCallback(resolve, reject, onfulfilled, r);
18085
- } else {
18086
- resolve(r);
18087
- }
18088
- }
18089
- }, reject_);
18090
- }
18091
- });
18092
- p._parentPromise = this;
18093
- this._children.push(p);
18094
- return p;
18095
- }
18096
- catch(onrejected) {
18097
- if (this._isCanceled && onrejected) {
18098
- onrejected(new CancelError());
18099
- }
18100
- return this.then(void 0, onrejected);
18101
- }
18102
- finally(onfinally) {
18103
- if (this._promise) {
18104
- return this._promise.finally(onfinally);
18105
- }
18106
- if (this._isCanceled) {
18107
- return Promise.reject(new CancelError());
18108
- }
18109
- return Promise.reject(onfinally);
18110
- }
18111
- cancel() {
18112
- if (this._isCanceled || !this._isPending) {
18113
- return this;
18114
- }
18115
- this._isCanceled = true;
18116
- const parent = this._getTopParent();
18117
- if (parent) {
18118
- parent.cancel();
18119
- }
18120
- if (this._children) {
18121
- this._children.forEach((x) => x.cancel());
18122
- }
18123
- if (this._isPending) {
18124
- if (this._cancelHandlers.length) {
18125
- try {
18126
- for (const handler of this._cancelHandlers) {
18127
- handler();
18128
- }
18129
- } catch (error) {
18130
- }
18131
- }
18132
- if (this._setCanceledCallback) {
18133
- this._setCanceledCallback();
18134
- }
18135
- }
18136
- this._destroy();
18137
- return this;
18138
- }
18139
- _getTopParent() {
18140
- let parent = this._parentPromise;
18141
- let hasParent = !!parent;
18142
- while (hasParent) {
18143
- if (parent && parent._parentPromise) {
18144
- parent = parent._parentPromise;
18145
- hasParent = !!parent;
18146
- } else {
18147
- hasParent = false;
18148
- }
18149
- }
18150
- return parent;
18151
- }
18152
- _destroy() {
18153
- this._setCanceledCallback = void 0;
18154
- this._cancelPromise = void 0;
18155
- this._promise = void 0;
18156
- }
18157
- };
18158
- __publicField$w(_CancelablePromise, "CancelError", CancelError);
18159
- __publicField$w(_CancelablePromise, "TimeoutError", TimeoutError);
18160
- __publicField$w(_CancelablePromise, "PromiseControl", PromiseControl);
18161
- let CancelablePromise = _CancelablePromise;
18162
- Object.setPrototypeOf(CancelablePromise.prototype, Promise.prototype);
18163
-
18164
17862
  const svgPath = {
18165
17863
  brill: '<path d="m6 0-5 6 5 6 5-6z"/>',
18166
17864
  circle: '<circle cx="6" cy="6" r="6"/>',
@@ -18233,9 +17931,9 @@ var NgwLeaflet = (function () {
18233
17931
  };
18234
17932
  }
18235
17933
 
18236
- var __defProp$G = Object.defineProperty;
18237
- var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18238
- var __publicField$v = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
17934
+ var __defProp$H = Object.defineProperty;
17935
+ var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17936
+ var __publicField$v = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
18239
17937
  const _Cache = class _Cache {
18240
17938
  constructor(options = {}) {
18241
17939
  __publicField$v(this, "cache", []);
@@ -18271,8 +17969,7 @@ var NgwLeaflet = (function () {
18271
17969
  * // somewhere else in the code
18272
17970
  * const item = await cache.addFull('foo', getItemFunc).then((resp) => {
18273
17971
  * console.log(resp); // 'New item'
18274
- * })
18275
- *
17972
+ * });
18276
17973
  * ```
18277
17974
  */
18278
17975
  addFull(key, valueToSet, props) {
@@ -18287,13 +17984,11 @@ var NgwLeaflet = (function () {
18287
17984
  } else {
18288
17985
  value = valueToSet;
18289
17986
  }
18290
- const props_ = props && JSON.parse(JSON.stringify(objectRemoveEmpty(props)));
17987
+ const nonEmptyProps = props && JSON.parse(JSON.stringify(objectRemoveEmpty(props)));
18291
17988
  const cacheItem = {
18292
17989
  key,
18293
17990
  value,
18294
- props: props_,
18295
- // TODO: remove backward compatibility use only props
18296
- options: props_
17991
+ props: nonEmptyProps
18297
17992
  };
18298
17993
  if (onlyFull && !full(value)) {
18299
17994
  return value;
@@ -18302,7 +17997,6 @@ var NgwLeaflet = (function () {
18302
17997
  if (value instanceof Promise) {
18303
17998
  value.catch((er) => {
18304
17999
  this.delete(key, props);
18305
- throw er;
18306
18000
  });
18307
18001
  if (onlyFull) {
18308
18002
  value.then((x) => {
@@ -18321,9 +18015,7 @@ var NgwLeaflet = (function () {
18321
18015
  }
18322
18016
  match(key, props) {
18323
18017
  const cacheRecord = this._find(key, props);
18324
- if (cacheRecord) {
18325
- return cacheRecord.value;
18326
- }
18018
+ return cacheRecord == null ? void 0 : cacheRecord.value;
18327
18019
  }
18328
18020
  matchAll(key, props) {
18329
18021
  if (key) {
@@ -18332,37 +18024,30 @@ var NgwLeaflet = (function () {
18332
18024
  return this.cache.map((x) => x.value);
18333
18025
  }
18334
18026
  delete(keyOrItem, props) {
18335
- let exist = [];
18336
- if (typeof keyOrItem === "string") {
18337
- exist = this.cache.filter((x) => this._filter(x, keyOrItem, props));
18338
- } else {
18339
- exist.push(keyOrItem);
18340
- }
18341
- for (const e of exist) {
18342
- const index = this.cache.indexOf(e);
18343
- this.cache.splice(index, 1);
18027
+ const itemsToDelete = typeof keyOrItem === "string" ? this.cache.filter((x) => this._filter(x, keyOrItem, props)) : [keyOrItem];
18028
+ for (const item of itemsToDelete) {
18029
+ const index = this.cache.indexOf(item);
18030
+ if (index !== -1) {
18031
+ this.cache.splice(index, 1);
18032
+ }
18344
18033
  }
18345
18034
  }
18346
18035
  _find(key, props) {
18347
18036
  return this.cache.find((x) => this._filter(x, key, props));
18348
18037
  }
18349
18038
  _filter(item, key, props) {
18350
- if (item.key === key) {
18351
- if (props) {
18352
- const itemProps = item.props || item.options;
18353
- return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
18354
- }
18355
- return true;
18356
- }
18357
- return false;
18039
+ if (item.key !== key) return false;
18040
+ if (!props) return true;
18041
+ const itemProps = item.props;
18042
+ return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
18358
18043
  }
18359
18044
  };
18360
18045
  __publicField$v(_Cache, "instance", {});
18361
18046
  let Cache = _Cache;
18362
18047
 
18363
- var __defProp$F = Object.defineProperty;
18364
- var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18365
- var __publicField$u = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18048
+ var __defProp$G = Object.defineProperty;
18049
+ var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18050
+ var __publicField$u = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
18366
18051
  class NgwError extends Error {
18367
18052
  constructor(er) {
18368
18053
  super();
@@ -18379,9 +18064,9 @@ var NgwLeaflet = (function () {
18379
18064
  }
18380
18065
  }
18381
18066
 
18382
- var __defProp$E = Object.defineProperty;
18383
- var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18384
- var __publicField$t = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18067
+ var __defProp$F = Object.defineProperty;
18068
+ var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18069
+ var __publicField$t = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18385
18070
  class ResourceNotFoundError extends NgwError {
18386
18071
  constructor(obj) {
18387
18072
  super(obj);
@@ -18420,27 +18105,24 @@ var NgwLeaflet = (function () {
18420
18105
  return query;
18421
18106
  }
18422
18107
 
18423
- var __defProp$D = Object.defineProperty;
18424
- var __defProps$e = Object.defineProperties;
18425
- var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
18426
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
18427
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
18428
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
18429
- var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18430
- var __spreadValues$q = (a, b) => {
18108
+ var __defProp$E = Object.defineProperty;
18109
+ var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
18110
+ var __hasOwnProp$t = Object.prototype.hasOwnProperty;
18111
+ var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
18112
+ var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18113
+ var __spreadValues$s = (a, b) => {
18431
18114
  for (var prop in b || (b = {}))
18432
- if (__hasOwnProp$r.call(b, prop))
18433
- __defNormalProp$D(a, prop, b[prop]);
18434
- if (__getOwnPropSymbols$r)
18435
- for (var prop of __getOwnPropSymbols$r(b)) {
18436
- if (__propIsEnum$r.call(b, prop))
18437
- __defNormalProp$D(a, prop, b[prop]);
18115
+ if (__hasOwnProp$t.call(b, prop))
18116
+ __defNormalProp$E(a, prop, b[prop]);
18117
+ if (__getOwnPropSymbols$t)
18118
+ for (var prop of __getOwnPropSymbols$t(b)) {
18119
+ if (__propIsEnum$t.call(b, prop))
18120
+ __defNormalProp$E(a, prop, b[prop]);
18438
18121
  }
18439
18122
  return a;
18440
18123
  };
18441
- var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
18442
- var __publicField$s = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18443
- var __async$k = (__this, __arguments, generator) => {
18124
+ var __publicField$s = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18125
+ var __async$r = (__this, __arguments, generator) => {
18444
18126
  return new Promise((resolve, reject) => {
18445
18127
  var fulfilled = (value) => {
18446
18128
  try {
@@ -18481,39 +18163,27 @@ var NgwLeaflet = (function () {
18481
18163
  * Fetching resource would be cached to speed up next call
18482
18164
  */
18483
18165
  getOne(resource, requestOptions) {
18484
- const cache = this.cache;
18485
- const forCache = {};
18486
- const opt = __spreadProps$e(__spreadValues$q({}, requestOptions), { cache: false });
18487
- if (typeof resource === "string") {
18488
- forCache.keyname = resource;
18489
- } else if (typeof resource === "number") {
18490
- forCache.id = resource;
18491
- } else if (isObject(resource)) {
18166
+ const opt = __spreadValues$s({}, requestOptions);
18167
+ if (typeof resource === "string") ; else if (typeof resource === "number") ; else if (isObject(resource)) {
18492
18168
  if (resource.id !== void 0) {
18493
- forCache.id = resource.id;
18169
+ resource.id;
18494
18170
  } else {
18495
18171
  if (resource.keyname) {
18496
- forCache.keyname = resource.keyname;
18172
+ resource.keyname;
18497
18173
  }
18498
18174
  if (resource.display_name) {
18499
- forCache.display_name = resource.display_name;
18175
+ resource.display_name;
18500
18176
  }
18501
18177
  }
18502
18178
  }
18503
- const makeRequest = () => {
18504
- if (typeof resource === "string") {
18505
- return this._fetchResourceBy({ keyname: resource }, opt);
18506
- } else if (typeof resource === "number") {
18507
- return this._fetchResourceById(resource, opt);
18508
- } else if (isObject(resource)) {
18509
- return this._fetchResourceBy(resource, opt);
18510
- }
18511
- return CancelablePromise.resolve(void 0);
18512
- };
18513
- if (requestOptions == null ? void 0 : requestOptions.cache) {
18514
- return cache.addFull("resource", makeRequest, forCache);
18179
+ if (typeof resource === "string") {
18180
+ return this._fetchResourceBy({ keyname: resource }, opt);
18181
+ } else if (typeof resource === "number") {
18182
+ return this._fetchResourceById(resource, opt);
18183
+ } else if (isObject(resource)) {
18184
+ return this._fetchResourceBy(resource, opt);
18515
18185
  }
18516
- return makeRequest();
18186
+ return Promise.resolve(void 0);
18517
18187
  }
18518
18188
  getOneOrFail(resource, requestOptions) {
18519
18189
  return this.getOne(resource, requestOptions).then((res) => {
@@ -18535,7 +18205,7 @@ var NgwLeaflet = (function () {
18535
18205
  */
18536
18206
  getId(resource, requestOptions) {
18537
18207
  if (typeof resource === "number") {
18538
- return CancelablePromise.resolve(resource);
18208
+ return Promise.resolve(resource);
18539
18209
  } else if (typeof resource === "string" || isObject(resource)) {
18540
18210
  return this.getOne(resource, requestOptions).then((res) => {
18541
18211
  if (res) {
@@ -18543,7 +18213,7 @@ var NgwLeaflet = (function () {
18543
18213
  }
18544
18214
  });
18545
18215
  }
18546
- return CancelablePromise.resolve(void 0);
18216
+ return Promise.resolve(void 0);
18547
18217
  }
18548
18218
  /**
18549
18219
  * A fast way to retrieve resource ID for any resource definition.
@@ -18570,12 +18240,12 @@ var NgwLeaflet = (function () {
18570
18240
  } else {
18571
18241
  Object.assign(query, resourceToQuery(resource));
18572
18242
  }
18573
- return this.connector.get("resource.search", requestOptions, __spreadValues$q({
18243
+ return this.connector.get("resource.search", requestOptions, __spreadValues$s({
18574
18244
  serialization: "full"
18575
18245
  }, query)).then((resources) => {
18576
- if (resources) {
18246
+ if ((requestOptions == null ? void 0 : requestOptions.cache) && resources) {
18577
18247
  for (const x of resources) {
18578
- this.cache.add("resource.item", CancelablePromise.resolve(x), {
18248
+ this.cache.add("resource.item", Promise.resolve(x), {
18579
18249
  id: x.resource.id
18580
18250
  });
18581
18251
  }
@@ -18591,7 +18261,7 @@ var NgwLeaflet = (function () {
18591
18261
  if (child) {
18592
18262
  return this.getOne(child.resource.parent.id, requestOptions);
18593
18263
  }
18594
- return CancelablePromise.resolve(void 0);
18264
+ return Promise.resolve(void 0);
18595
18265
  });
18596
18266
  }
18597
18267
  getChildrenOf(resource, requestOptions) {
@@ -18621,18 +18291,16 @@ var NgwLeaflet = (function () {
18621
18291
  });
18622
18292
  }
18623
18293
  _getChildrenOf(parent, requestOptions, _items = []) {
18624
- return this.connector.get(
18625
- "resource.collection",
18626
- __spreadValues$q({ cache: true }, requestOptions),
18627
- {
18628
- parent
18629
- }
18630
- ).then((items) => {
18294
+ return this.connector.get("resource.collection", requestOptions, {
18295
+ parent
18296
+ }).then((items) => {
18631
18297
  const recursivePromises = [];
18632
18298
  for (const item of items) {
18633
- this.cache.add("resource.item", CancelablePromise.resolve(item), {
18634
- id: item.resource.id
18635
- });
18299
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
18300
+ this.cache.add("resource.item", Promise.resolve(item), {
18301
+ id: item.resource.id
18302
+ });
18303
+ }
18636
18304
  _items.push(item);
18637
18305
  if ((requestOptions == null ? void 0 : requestOptions.recursive) && item.resource.children) {
18638
18306
  recursivePromises.push(
@@ -18641,7 +18309,7 @@ var NgwLeaflet = (function () {
18641
18309
  }
18642
18310
  }
18643
18311
  if (recursivePromises.length) {
18644
- return CancelablePromise.all(recursivePromises).then(() => {
18312
+ return Promise.all(recursivePromises).then(() => {
18645
18313
  return _items;
18646
18314
  });
18647
18315
  }
@@ -18649,11 +18317,12 @@ var NgwLeaflet = (function () {
18649
18317
  });
18650
18318
  }
18651
18319
  _cleanResourceItemCache(id) {
18652
- return __async$k(this, null, function* () {
18320
+ return __async$r(this, null, function* () {
18321
+ var _a;
18653
18322
  const all = this.cache.all();
18654
18323
  const toDelete = [];
18655
18324
  for (const c of all) {
18656
- const cid = c.options && c.options.id;
18325
+ const cid = (_a = c.props) == null ? void 0 : _a.id;
18657
18326
  if (["resource.item", "resource"].includes(c.key) && cid !== void 0) {
18658
18327
  if (typeof cid === "number") {
18659
18328
  if (cid === id) {
@@ -18673,18 +18342,7 @@ var NgwLeaflet = (function () {
18673
18342
  });
18674
18343
  }
18675
18344
  _fetchResourceById(id, requestOptions) {
18676
- const promise = () => this.connector.get("resource.item", requestOptions, { id });
18677
- if (requestOptions == null ? void 0 : requestOptions.cache) {
18678
- return this.cache.add("resource.item", promise, {
18679
- id
18680
- }).catch((er) => {
18681
- if (!(er instanceof ResourceNotFoundError)) {
18682
- throw er;
18683
- }
18684
- return void 0;
18685
- });
18686
- }
18687
- return promise();
18345
+ return this.connector.get("resource.item", requestOptions, { id });
18688
18346
  }
18689
18347
  _fetchResourceBy(resource, requestOptions) {
18690
18348
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -18692,7 +18350,7 @@ var NgwLeaflet = (function () {
18692
18350
  });
18693
18351
  }
18694
18352
  _resourceCacheFilter(resource) {
18695
- return CancelablePromise.all(this.cache.matchAll("resource.item")).then(
18353
+ return Promise.all(this.cache.matchAll("resource.item")).then(
18696
18354
  (resources) => {
18697
18355
  const items = [];
18698
18356
  resources.filter((x) => {
@@ -18736,9 +18394,16 @@ var NgwLeaflet = (function () {
18736
18394
  }
18737
18395
  }
18738
18396
 
18739
- var __defProp$C = Object.defineProperty;
18740
- var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18741
- var __publicField$r = (obj, key, value) => __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
18397
+ class AbortError extends Error {
18398
+ constructor(message = "AbortError") {
18399
+ super(message);
18400
+ this.name = "AbortError";
18401
+ }
18402
+ }
18403
+
18404
+ var __defProp$D = Object.defineProperty;
18405
+ var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18406
+ var __publicField$r = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18742
18407
  class InsufficientPermissionsError extends NgwError {
18743
18408
  constructor(obj) {
18744
18409
  super(obj);
@@ -18761,64 +18426,96 @@ var NgwLeaflet = (function () {
18761
18426
  });
18762
18427
  }
18763
18428
 
18429
+ var __defProp$C = Object.defineProperty;
18430
+ var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
18431
+ var __hasOwnProp$s = Object.prototype.hasOwnProperty;
18432
+ var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
18433
+ var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18434
+ var __spreadValues$r = (a, b) => {
18435
+ for (var prop in b || (b = {}))
18436
+ if (__hasOwnProp$s.call(b, prop))
18437
+ __defNormalProp$C(a, prop, b[prop]);
18438
+ if (__getOwnPropSymbols$s)
18439
+ for (var prop of __getOwnPropSymbols$s(b)) {
18440
+ if (__propIsEnum$s.call(b, prop))
18441
+ __defNormalProp$C(a, prop, b[prop]);
18442
+ }
18443
+ return a;
18444
+ };
18445
+ var __async$q = (__this, __arguments, generator) => {
18446
+ return new Promise((resolve, reject) => {
18447
+ var fulfilled = (value) => {
18448
+ try {
18449
+ step(generator.next(value));
18450
+ } catch (e) {
18451
+ reject(e);
18452
+ }
18453
+ };
18454
+ var rejected = (value) => {
18455
+ try {
18456
+ step(generator.throw(value));
18457
+ } catch (e) {
18458
+ reject(e);
18459
+ }
18460
+ };
18461
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18462
+ step((generator = generator.apply(__this, __arguments)).next());
18463
+ });
18464
+ };
18764
18465
  function apiRequest(opt) {
18765
- const params = opt.params;
18766
- return new CancelablePromise((resolve, reject) => {
18767
- return opt.connector.connect().then((apiItems) => {
18768
- let apiItem = apiItems && apiItems[opt.name];
18769
- if (apiItem) {
18770
- apiItem = [...apiItem];
18771
- let url = apiItem.shift();
18772
- if (apiItem.length) {
18773
- const replaceParams = {};
18774
- for (let fry = 0; fry < apiItem.length; fry++) {
18775
- const arg = apiItem[fry];
18776
- replaceParams[fry] = "{" + arg + "}";
18777
- if (params[arg] === void 0) {
18778
- throw new Error(
18779
- "`" + arg + "` url api argument is not specified"
18780
- );
18781
- }
18782
- }
18783
- if (url) {
18784
- url = template(url, replaceParams);
18466
+ return __async$q(this, null, function* () {
18467
+ const { params, name, connector, requestOptions } = opt;
18468
+ const apiItems = yield connector.connect();
18469
+ let apiItem = apiItems && apiItems[name];
18470
+ if (apiItem) {
18471
+ apiItem = [...apiItem];
18472
+ let url = apiItem.shift();
18473
+ if (apiItem.length) {
18474
+ const replaceParams = {};
18475
+ for (let fry = 0; fry < apiItem.length; fry++) {
18476
+ const arg = apiItem[fry];
18477
+ replaceParams[fry] = `{${arg}}`;
18478
+ if (params[arg] === void 0) {
18479
+ throw new Error(`\`${arg}\` URL API argument is not specified`);
18785
18480
  }
18786
18481
  }
18787
- if (params) {
18788
- const paramArray = [];
18789
- const paramList = params.paramList;
18790
- if (Array.isArray(paramList)) {
18791
- delete params.paramList;
18792
- paramList.forEach((x) => {
18793
- paramArray.push(`${x[0]}=${x[1]}`);
18794
- });
18795
- }
18796
- for (const p in params) {
18797
- if (apiItem.indexOf(p) === -1) {
18798
- paramArray.push(`${p}=${params[p]}`);
18799
- }
18800
- }
18801
- if (paramArray.length) {
18802
- url = url + "?" + paramArray.join("&");
18482
+ if (url) {
18483
+ url = template(url, replaceParams);
18484
+ }
18485
+ }
18486
+ if (params) {
18487
+ const paramArray = [];
18488
+ const paramList = params.paramList;
18489
+ if (Array.isArray(paramList)) {
18490
+ paramList.forEach(([key, value]) => {
18491
+ paramArray.push(`${key}=${value}`);
18492
+ });
18493
+ }
18494
+ for (const p in params) {
18495
+ if (apiItem.indexOf(p) === -1) {
18496
+ paramArray.push(`${p}=${params[p]}`);
18803
18497
  }
18804
18498
  }
18805
- if (url) {
18806
- resolve(opt.connector.makeQuery(url, params, opt.requestOptions));
18807
- } else {
18808
- reject(new Error("request url is not set"));
18499
+ if (paramArray.length) {
18500
+ url = `${url}?${paramArray.join("&")}`;
18809
18501
  }
18502
+ }
18503
+ if (url) {
18504
+ return connector.makeQuery(url, params, __spreadValues$r({
18505
+ cacheName: name
18506
+ }, requestOptions));
18810
18507
  } else {
18811
- resolve(void 0);
18508
+ throw new Error("Request URL is not set");
18812
18509
  }
18813
- }).catch((er) => {
18814
- reject(er);
18815
- });
18510
+ } else {
18511
+ return void 0;
18512
+ }
18816
18513
  });
18817
18514
  }
18818
18515
 
18819
18516
  var __defProp$B = Object.defineProperty;
18820
18517
  var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18821
- var __publicField$q = (obj, key, value) => __defNormalProp$B(obj, typeof key !== "symbol" ? key + "" : key, value);
18518
+ var __publicField$q = (obj, key, value) => __defNormalProp$B(obj, key + "" , value);
18822
18519
  class NetworkError extends Error {
18823
18520
  constructor(url) {
18824
18521
  super();
@@ -18912,23 +18609,59 @@ var NgwLeaflet = (function () {
18912
18609
  }
18913
18610
 
18914
18611
  var __defProp$A = Object.defineProperty;
18915
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
18916
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
18917
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
18612
+ var __defProps$e = Object.defineProperties;
18613
+ var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
18614
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
18615
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
18616
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
18918
18617
  var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18919
- var __spreadValues$p = (a, b) => {
18618
+ var __spreadValues$q = (a, b) => {
18920
18619
  for (var prop in b || (b = {}))
18921
- if (__hasOwnProp$q.call(b, prop))
18620
+ if (__hasOwnProp$r.call(b, prop))
18922
18621
  __defNormalProp$A(a, prop, b[prop]);
18923
- if (__getOwnPropSymbols$q)
18924
- for (var prop of __getOwnPropSymbols$q(b)) {
18925
- if (__propIsEnum$q.call(b, prop))
18622
+ if (__getOwnPropSymbols$r)
18623
+ for (var prop of __getOwnPropSymbols$r(b)) {
18624
+ if (__propIsEnum$r.call(b, prop))
18926
18625
  __defNormalProp$A(a, prop, b[prop]);
18927
18626
  }
18928
18627
  return a;
18929
18628
  };
18629
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
18630
+ var __objRest$2 = (source, exclude) => {
18631
+ var target = {};
18632
+ for (var prop in source)
18633
+ if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
18634
+ target[prop] = source[prop];
18635
+ if (source != null && __getOwnPropSymbols$r)
18636
+ for (var prop of __getOwnPropSymbols$r(source)) {
18637
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
18638
+ target[prop] = source[prop];
18639
+ }
18640
+ return target;
18641
+ };
18930
18642
  var __publicField$p = (obj, key, value) => __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
18643
+ var __async$p = (__this, __arguments, generator) => {
18644
+ return new Promise((resolve, reject) => {
18645
+ var fulfilled = (value) => {
18646
+ try {
18647
+ step(generator.next(value));
18648
+ } catch (e) {
18649
+ reject(e);
18650
+ }
18651
+ };
18652
+ var rejected = (value) => {
18653
+ try {
18654
+ step(generator.throw(value));
18655
+ } catch (e) {
18656
+ reject(e);
18657
+ }
18658
+ };
18659
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18660
+ step((generator = generator.apply(__this, __arguments)).next());
18661
+ });
18662
+ };
18931
18663
  let ID$2 = 0;
18664
+ let REQUEST_ID = 0;
18932
18665
  class NgwConnector {
18933
18666
  constructor(options) {
18934
18667
  this.options = options;
@@ -18938,7 +18671,7 @@ var NgwLeaflet = (function () {
18938
18671
  __publicField$p(this, "resources");
18939
18672
  __publicField$p(this, "cache");
18940
18673
  __publicField$p(this, "routeStr", "/api/component/pyramid/route");
18941
- __publicField$p(this, "activeRequests", []);
18674
+ __publicField$p(this, "activeRequests", {});
18942
18675
  __publicField$p(this, "requestTransform");
18943
18676
  const exist = findConnector(options);
18944
18677
  this.cache = new Cache({ namespace: options.cacheId });
@@ -18995,29 +18728,27 @@ var NgwLeaflet = (function () {
18995
18728
  * ```
18996
18729
  */
18997
18730
  connect() {
18998
- const auth = this.options.auth;
18999
- const makeConnect = () => new CancelablePromise((resolve, reject) => {
19000
- const makeQuery = () => {
19001
- return this.makeQuery(this.routeStr, {}, {}).then((route) => {
19002
- resolve(route);
19003
- }).catch((er) => {
19004
- reject(er);
19005
- });
19006
- };
18731
+ return __async$p(this, null, function* () {
18732
+ const auth = this.options.auth;
19007
18733
  if (auth) {
19008
18734
  const { login, password } = auth;
19009
18735
  if (login && password) {
19010
- return this._login({ login, password }).then(() => {
19011
- return makeQuery();
19012
- }).catch((er) => reject(er));
18736
+ yield this._login({ login, password });
19013
18737
  }
19014
18738
  }
19015
- return makeQuery();
19016
- });
19017
- return this.cache.add("route", makeConnect, {
19018
- id: this.id,
19019
- auth,
19020
- baseUrl: this.options.baseUrl
18739
+ return yield this.makeQuery(
18740
+ this.routeStr,
18741
+ {},
18742
+ {
18743
+ cacheName: "route",
18744
+ cache: true,
18745
+ cacheProps: {
18746
+ id: this.id,
18747
+ auth,
18748
+ baseUrl: this.options.baseUrl
18749
+ }
18750
+ }
18751
+ );
19021
18752
  });
19022
18753
  }
19023
18754
  /**
@@ -19041,20 +18772,22 @@ var NgwLeaflet = (function () {
19041
18772
  this.emitter.emit("logout");
19042
18773
  }
19043
18774
  getUserInfo(credentials, options) {
19044
- if (this.user && this.user.id) {
19045
- return CancelablePromise.resolve(this.user);
19046
- }
19047
- if (credentials) {
19048
- this.options.auth = credentials;
19049
- }
19050
- const options_ = __spreadValues$p({
19051
- headers: this.getAuthorizationHeaders(credentials)
19052
- }, options);
19053
- return this.makeQuery(
19054
- "/api/component/auth/current_user",
19055
- {},
19056
- options_
19057
- );
18775
+ return __async$p(this, null, function* () {
18776
+ if (this.user && this.user.id) {
18777
+ return this.user;
18778
+ }
18779
+ if (credentials) {
18780
+ this.options.auth = credentials;
18781
+ }
18782
+ const options_ = __spreadValues$q({
18783
+ headers: this.getAuthorizationHeaders(credentials)
18784
+ }, options);
18785
+ return this.makeQuery(
18786
+ "/api/component/auth/current_user",
18787
+ {},
18788
+ options_
18789
+ );
18790
+ });
19058
18791
  }
19059
18792
  /**
19060
18793
  * Obtaining the required Headers for authentication of requests in the NGW.
@@ -19063,7 +18796,7 @@ var NgwLeaflet = (function () {
19063
18796
  const client = this.makeClientId(credentials);
19064
18797
  if (client) {
19065
18798
  return {
19066
- Authorization: "Basic " + client
18799
+ Authorization: `Basic ${client}`
19067
18800
  };
19068
18801
  }
19069
18802
  }
@@ -19071,21 +18804,22 @@ var NgwLeaflet = (function () {
19071
18804
  credentials = credentials || this.options.auth;
19072
18805
  if (credentials) {
19073
18806
  const { login, password } = credentials;
19074
- const str = unescape(encodeURIComponent(`${login}:${password}`));
18807
+ const str = `${login}:${password}`;
18808
+ const encodedStr = encodeURIComponent(str);
19075
18809
  {
19076
- return window.btoa(str);
18810
+ return window.btoa(encodedStr);
19077
18811
  }
19078
18812
  }
19079
18813
  }
19080
18814
  /** Stop all api requests */
19081
18815
  abort() {
19082
- for (const req of this.activeRequests) {
19083
- req.cancel();
18816
+ for (const abortController of Object.values(this.activeRequests)) {
18817
+ abortController.abort();
19084
18818
  }
19085
- this.activeRequests = [];
18819
+ this.activeRequests = {};
19086
18820
  }
19087
18821
  getActiveApiRequests() {
19088
- return [...this.activeRequests];
18822
+ return __spreadValues$q({}, this.activeRequests);
19089
18823
  }
19090
18824
  /**
19091
18825
  * Send request to NGW api router.
@@ -19117,23 +18851,10 @@ var NgwLeaflet = (function () {
19117
18851
  * ```
19118
18852
  */
19119
18853
  apiRequest(name, params_ = {}, requestOptions = {}) {
19120
- var _a, _b;
19121
- const { method, headers, withCredentials, responseType } = requestOptions;
19122
- params_ = (_a = requestOptions.params) != null ? _a : params_;
19123
- const params = objectRemoveEmpty(params_);
19124
- const makeApiRequest = () => apiRequest({ name, params, requestOptions, connector: this });
19125
- if (requestOptions.cache && method === "GET") {
19126
- return this.cache.add(name, makeApiRequest, __spreadValues$p({
19127
- params
19128
- }, objectRemoveEmpty({
19129
- headers,
19130
- withCredentials,
19131
- responseType,
19132
- baseUrl: this.options.baseUrl,
19133
- userId: (_b = this.user) == null ? void 0 : _b.id
19134
- })));
19135
- }
19136
- return makeApiRequest();
18854
+ var _a;
18855
+ params_ = (_a = requestOptions.params) != null ? _a : params_;
18856
+ const params = objectRemoveEmpty(params_);
18857
+ return apiRequest({ name, params, requestOptions, connector: this });
19137
18858
  }
19138
18859
  /**
19139
18860
  * Shortcut method for send POST request to NGW.
@@ -19223,17 +18944,67 @@ var NgwLeaflet = (function () {
19223
18944
  * @param params - Query params
19224
18945
  * @param options - Request options
19225
18946
  */
19226
- makeQuery(url, params, options = {}) {
19227
- url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
19228
- if (url) {
18947
+ makeQuery(_0, _1) {
18948
+ return __async$p(this, arguments, function* (url, params, options = {}) {
18949
+ var _b;
18950
+ url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
18951
+ if (!url) {
18952
+ throw new Error("Empty `url` not allowed");
18953
+ }
19229
18954
  if (params) {
19230
- url = template(url, params);
18955
+ const _a = params, restParams = __objRest$2(_a, ["paramList"]);
18956
+ url = template(url, restParams);
19231
18957
  }
19232
18958
  url = encodeURI(fixUrlStr(url));
19233
- return this._loadData(url, options);
19234
- } else {
19235
- throw new Error("Empty `url` not allowed");
19236
- }
18959
+ const {
18960
+ cache,
18961
+ signal: externalSignal,
18962
+ method = "GET",
18963
+ headers,
18964
+ cacheName,
18965
+ cacheProps,
18966
+ responseType,
18967
+ withCredentials
18968
+ } = options;
18969
+ const internalAbortController = new AbortController();
18970
+ const internalSignal = internalAbortController.signal;
18971
+ if (externalSignal) {
18972
+ if (externalSignal.aborted) {
18973
+ throw new AbortError();
18974
+ }
18975
+ externalSignal.addEventListener("abort", () => {
18976
+ internalAbortController.abort();
18977
+ });
18978
+ }
18979
+ options.signal = internalSignal;
18980
+ const createPromise = () => __async$p(this, null, function* () {
18981
+ const id = REQUEST_ID++;
18982
+ this.activeRequests[id] = internalAbortController;
18983
+ try {
18984
+ return this._loadData(url, options);
18985
+ } finally {
18986
+ this._cleanActiveRequest(id);
18987
+ }
18988
+ });
18989
+ if (cache && method === "GET") {
18990
+ const cacheOptions = cacheProps ? cacheProps : __spreadProps$e(__spreadValues$q({}, objectRemoveEmpty({
18991
+ headers,
18992
+ withCredentials,
18993
+ responseType,
18994
+ baseUrl: this.options.baseUrl,
18995
+ userId: (_b = this.user) == null ? void 0 : _b.id
18996
+ })), {
18997
+ params
18998
+ });
18999
+ return this.cache.add(
19000
+ cacheName || url,
19001
+ createPromise,
19002
+ cacheOptions,
19003
+ false
19004
+ );
19005
+ }
19006
+ return createPromise();
19007
+ });
19237
19008
  }
19238
19009
  // -------------------------------------------------------------------------
19239
19010
  // Resource Methods
@@ -19315,26 +19086,29 @@ var NgwLeaflet = (function () {
19315
19086
  */
19316
19087
  _loadData(url, options) {
19317
19088
  options.responseType = options.responseType || "json";
19318
- if (options.signal && options.signal.aborted) {
19319
- return CancelablePromise.reject(new CancelablePromise.CancelError());
19320
- }
19321
- const request = new CancelablePromise((resolve, reject, onCancel) => {
19089
+ return new Promise((resolve, reject) => {
19090
+ var _a;
19322
19091
  if (this.user) {
19323
19092
  options = options || {};
19324
- options.headers = __spreadValues$p(__spreadValues$p({}, this.getAuthorizationHeaders()), options.headers);
19093
+ options.headers = __spreadValues$q(__spreadValues$q({}, this.getAuthorizationHeaders()), options.headers);
19325
19094
  }
19326
19095
  if (this.requestTransform) {
19327
19096
  const [transUrl, transOptions] = this.requestTransform(url, options);
19328
19097
  url = transUrl;
19329
19098
  options = transOptions;
19330
19099
  }
19331
- loadData(url, resolve, options, reject, onCancel);
19332
- }).then((resp) => {
19333
- this._cleanActiveRequests(request);
19334
- return resp;
19100
+ let runOnAbort = void 0;
19101
+ loadData(url, resolve, options, reject, (handler) => {
19102
+ runOnAbort = handler;
19103
+ });
19104
+ (_a = options.signal) == null ? void 0 : _a.addEventListener("abort", () => {
19105
+ if (runOnAbort !== void 0) {
19106
+ runOnAbort();
19107
+ }
19108
+ reject(new AbortError());
19109
+ });
19335
19110
  }).catch((httpError) => {
19336
- this._cleanActiveRequests(request);
19337
- if (httpError instanceof CancelablePromise.CancelError) ; else {
19111
+ if (httpError.name !== "AbortError") {
19338
19112
  {
19339
19113
  console.warn("DEV WARN", httpError);
19340
19114
  }
@@ -19343,31 +19117,24 @@ var NgwLeaflet = (function () {
19343
19117
  throw er;
19344
19118
  }
19345
19119
  }
19120
+ throw httpError;
19346
19121
  });
19347
- if (options.signal && typeof options.signal.addEventListener === "function") {
19348
- options.signal.addEventListener("abort", () => {
19349
- request.cancel();
19350
- this._cleanActiveRequests(request);
19351
- });
19352
- }
19353
- this.activeRequests.push(request);
19354
- return request;
19355
19122
  }
19356
19123
  _login(credentials, options) {
19357
- return this.getUserInfo(credentials, options).then((data) => {
19358
- this.user = data;
19359
- this.emitter.emit("login", data);
19360
- return data;
19361
- }).catch((er) => {
19362
- this.emitter.emit("login:error", er);
19363
- throw er;
19124
+ return __async$p(this, null, function* () {
19125
+ try {
19126
+ const data = yield this.getUserInfo(credentials, options);
19127
+ this.user = data;
19128
+ this.emitter.emit("login", data);
19129
+ return data;
19130
+ } catch (er) {
19131
+ this.emitter.emit("login:error", er);
19132
+ throw er;
19133
+ }
19364
19134
  });
19365
19135
  }
19366
- _cleanActiveRequests(request) {
19367
- const activeRequestIndex = this.activeRequests.indexOf(request);
19368
- if (activeRequestIndex !== -1) {
19369
- this.activeRequests.splice(activeRequestIndex, 1);
19370
- }
19136
+ _cleanActiveRequest(requestId) {
19137
+ delete this.activeRequests[requestId];
19371
19138
  }
19372
19139
  _handleHttpError(er) {
19373
19140
  if (er) {
@@ -19390,22 +19157,42 @@ var NgwLeaflet = (function () {
19390
19157
  var __defProp$z = Object.defineProperty;
19391
19158
  var __defProps$d = Object.defineProperties;
19392
19159
  var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
19393
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
19394
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
19395
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
19160
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
19161
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
19162
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
19396
19163
  var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19397
- var __spreadValues$o = (a, b) => {
19164
+ var __spreadValues$p = (a, b) => {
19398
19165
  for (var prop in b || (b = {}))
19399
- if (__hasOwnProp$p.call(b, prop))
19166
+ if (__hasOwnProp$q.call(b, prop))
19400
19167
  __defNormalProp$z(a, prop, b[prop]);
19401
- if (__getOwnPropSymbols$p)
19402
- for (var prop of __getOwnPropSymbols$p(b)) {
19403
- if (__propIsEnum$p.call(b, prop))
19168
+ if (__getOwnPropSymbols$q)
19169
+ for (var prop of __getOwnPropSymbols$q(b)) {
19170
+ if (__propIsEnum$q.call(b, prop))
19404
19171
  __defNormalProp$z(a, prop, b[prop]);
19405
19172
  }
19406
19173
  return a;
19407
19174
  };
19408
19175
  var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
19176
+ var __async$o = (__this, __arguments, generator) => {
19177
+ return new Promise((resolve, reject) => {
19178
+ var fulfilled = (value) => {
19179
+ try {
19180
+ step(generator.next(value));
19181
+ } catch (e) {
19182
+ reject(e);
19183
+ }
19184
+ };
19185
+ var rejected = (value) => {
19186
+ try {
19187
+ step(generator.throw(value));
19188
+ } catch (e) {
19189
+ reject(e);
19190
+ }
19191
+ };
19192
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
19193
+ step((generator = generator.apply(__this, __arguments)).next());
19194
+ });
19195
+ };
19409
19196
  const FEATURE_REQUEST_PARAMS = {
19410
19197
  srs: 4326,
19411
19198
  geom_format: "geojson"
@@ -19446,10 +19233,9 @@ var NgwLeaflet = (function () {
19446
19233
  }
19447
19234
  }
19448
19235
  function createFeatureFieldFilterQueries(opt) {
19449
- const queries = getQueries(
19450
- opt
19451
- );
19452
- return CancelablePromise.all(queries).then((itemsParts) => {
19236
+ return __async$o(this, null, function* () {
19237
+ const queries = getQueries(opt);
19238
+ const itemsParts = yield Promise.all(queries);
19453
19239
  const ids = [];
19454
19240
  const items = [];
19455
19241
  for (const part of itemsParts) {
@@ -19491,13 +19277,13 @@ var NgwLeaflet = (function () {
19491
19277
  for (const f of filters_) {
19492
19278
  if (isPropertyFilter(f)) {
19493
19279
  _queries.push(
19494
- fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$o({}, opt), {
19280
+ fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$p({}, opt), {
19495
19281
  paramList: [..._parentAllParams, ...paramList, createParam(f)]
19496
19282
  }))
19497
19283
  );
19498
19284
  } else {
19499
19285
  getQueries(
19500
- __spreadProps$d(__spreadValues$o({}, opt), {
19286
+ __spreadProps$d(__spreadValues$p({}, opt), {
19501
19287
  filters: f
19502
19288
  }),
19503
19289
  _queries,
@@ -19518,7 +19304,7 @@ var NgwLeaflet = (function () {
19518
19304
  if (propertiesFilterList.length) {
19519
19305
  for (const x of propertiesFilterList) {
19520
19306
  getQueries(
19521
- __spreadProps$d(__spreadValues$o({}, opt), {
19307
+ __spreadProps$d(__spreadValues$p({}, opt), {
19522
19308
  filters: x
19523
19309
  }),
19524
19310
  _queries,
@@ -19527,7 +19313,7 @@ var NgwLeaflet = (function () {
19527
19313
  }
19528
19314
  } else {
19529
19315
  _queries.push(
19530
- fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$o({}, opt), {
19316
+ fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$p({}, opt), {
19531
19317
  paramList: [..._parentAllParams, ...paramList, ...filters2]
19532
19318
  }))
19533
19319
  );
@@ -19543,7 +19329,7 @@ var NgwLeaflet = (function () {
19543
19329
  return `POLYGON((${polygon.join(", ")}))`;
19544
19330
  }
19545
19331
  function fetchNgwLayerItemsRequest(options) {
19546
- const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
19332
+ const params = __spreadValues$p({}, FEATURE_REQUEST_PARAMS);
19547
19333
  const {
19548
19334
  limit,
19549
19335
  cache,
@@ -19582,7 +19368,7 @@ var NgwLeaflet = (function () {
19582
19368
  if (paramList) {
19583
19369
  params.paramList = paramList;
19584
19370
  }
19585
- const reqParams = __spreadValues$o({
19371
+ const reqParams = __spreadValues$p({
19586
19372
  id: resourceId
19587
19373
  }, params);
19588
19374
  return connector.get(
@@ -19595,52 +19381,90 @@ var NgwLeaflet = (function () {
19595
19381
  var __defProp$y = Object.defineProperty;
19596
19382
  var __defProps$c = Object.defineProperties;
19597
19383
  var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
19598
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
19599
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
19600
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
19384
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
19385
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
19386
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
19601
19387
  var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19602
- var __spreadValues$n = (a, b) => {
19388
+ var __spreadValues$o = (a, b) => {
19603
19389
  for (var prop in b || (b = {}))
19604
- if (__hasOwnProp$o.call(b, prop))
19390
+ if (__hasOwnProp$p.call(b, prop))
19605
19391
  __defNormalProp$y(a, prop, b[prop]);
19606
- if (__getOwnPropSymbols$o)
19607
- for (var prop of __getOwnPropSymbols$o(b)) {
19608
- if (__propIsEnum$o.call(b, prop))
19392
+ if (__getOwnPropSymbols$p)
19393
+ for (var prop of __getOwnPropSymbols$p(b)) {
19394
+ if (__propIsEnum$p.call(b, prop))
19609
19395
  __defNormalProp$y(a, prop, b[prop]);
19610
19396
  }
19611
19397
  return a;
19612
19398
  };
19613
19399
  var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
19400
+ var __async$n = (__this, __arguments, generator) => {
19401
+ return new Promise((resolve, reject) => {
19402
+ var fulfilled = (value) => {
19403
+ try {
19404
+ step(generator.next(value));
19405
+ } catch (e) {
19406
+ reject(e);
19407
+ }
19408
+ };
19409
+ var rejected = (value) => {
19410
+ try {
19411
+ step(generator.throw(value));
19412
+ } catch (e) {
19413
+ reject(e);
19414
+ }
19415
+ };
19416
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
19417
+ step((generator = generator.apply(__this, __arguments)).next());
19418
+ });
19419
+ };
19614
19420
  function fetchNgwLayerItem(options) {
19615
- const params = __spreadValues$n({}, FEATURE_REQUEST_PARAMS);
19616
- updateItemRequestParam(params, options);
19617
- const queryParams = __spreadValues$n({
19618
- id: options.resourceId,
19619
- fid: options.featureId
19620
- }, params);
19621
- const cache = options.cache || true;
19622
- return options.connector.get("feature_layer.feature.item", { cache }, queryParams).then((resp) => {
19623
- return __spreadProps$c(__spreadValues$n({}, resp), {
19624
- toGeojson: () => {
19625
- if (resp.geom) {
19626
- return CancelablePromise.resolve(createGeoJsonFeature(resp));
19627
- } else {
19628
- return fetchNgwLayerItem(__spreadProps$c(__spreadValues$n({}, options), {
19629
- geom: true,
19630
- fields: null,
19631
- extensions: null
19632
- })).then((onlyGeomItem) => {
19633
- const geom = onlyGeomItem.geom;
19634
- return createGeoJsonFeature(__spreadProps$c(__spreadValues$n({}, resp), { geom }));
19635
- });
19636
- }
19421
+ return __async$n(this, null, function* () {
19422
+ const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
19423
+ updateItemRequestParam(params, options);
19424
+ const queryParams = __spreadValues$o({
19425
+ id: options.resourceId,
19426
+ fid: options.featureId
19427
+ }, params);
19428
+ const resp = yield options.connector.get(
19429
+ "feature_layer.feature.item",
19430
+ options,
19431
+ queryParams
19432
+ );
19433
+ const toGeojson = () => __async$n(this, null, function* () {
19434
+ if (resp.geom) {
19435
+ return createGeoJsonFeature(resp);
19436
+ } else {
19437
+ const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$c(__spreadValues$o({}, options), {
19438
+ geom: true,
19439
+ fields: null,
19440
+ extensions: null
19441
+ }));
19442
+ const geom = onlyGeomItem.geom;
19443
+ return createGeoJsonFeature(__spreadProps$c(__spreadValues$o({}, resp), { geom }));
19637
19444
  }
19638
19445
  });
19446
+ return __spreadProps$c(__spreadValues$o({}, resp), {
19447
+ toGeojson
19448
+ });
19639
19449
  });
19640
19450
  }
19641
19451
 
19642
19452
  var __defProp$x = Object.defineProperty;
19453
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
19454
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
19455
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
19643
19456
  var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19457
+ var __spreadValues$n = (a, b) => {
19458
+ for (var prop in b || (b = {}))
19459
+ if (__hasOwnProp$o.call(b, prop))
19460
+ __defNormalProp$x(a, prop, b[prop]);
19461
+ if (__getOwnPropSymbols$o)
19462
+ for (var prop of __getOwnPropSymbols$o(b)) {
19463
+ if (__propIsEnum$o.call(b, prop))
19464
+ __defNormalProp$x(a, prop, b[prop]);
19465
+ }
19466
+ return a;
19467
+ };
19644
19468
  var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
19645
19469
  class BookmarkItem {
19646
19470
  constructor(options) {
@@ -19658,11 +19482,11 @@ var NgwLeaflet = (function () {
19658
19482
  this.name = String(item.id);
19659
19483
  }
19660
19484
  }
19661
- extent() {
19485
+ extent(opt) {
19662
19486
  if (this._extent) {
19663
- return CancelablePromise.resolve(this._extent);
19487
+ return Promise.resolve(this._extent);
19664
19488
  }
19665
- return this.options.connector.get("feature_layer.feature.item_extent", null, {
19489
+ return this.options.connector.get("feature_layer.feature.item_extent", opt, {
19666
19490
  id: this.resourceId,
19667
19491
  fid: this.item.id
19668
19492
  }).then((resp) => {
@@ -19672,18 +19496,18 @@ var NgwLeaflet = (function () {
19672
19496
  return lonLat;
19673
19497
  });
19674
19498
  }
19675
- geoJson() {
19499
+ geoJson(opt) {
19676
19500
  if (this.item.geom) {
19677
- return CancelablePromise.resolve(createGeoJsonFeature(this.item));
19501
+ return Promise.resolve(createGeoJsonFeature(this.item));
19678
19502
  } else {
19679
- return fetchNgwLayerItem({
19503
+ return fetchNgwLayerItem(__spreadValues$n({
19680
19504
  resourceId: this.resourceId,
19681
19505
  featureId: this.item.id,
19682
19506
  connector: this.options.connector,
19683
19507
  geom: true,
19684
19508
  fields: null,
19685
19509
  extensions: null
19686
- }).then((onlyGeomItem) => {
19510
+ }, opt)).then((onlyGeomItem) => {
19687
19511
  const geom = onlyGeomItem.geom;
19688
19512
  this.item.geom = geom;
19689
19513
  return createGeoJsonFeature(this.item);
@@ -19693,22 +19517,20 @@ var NgwLeaflet = (function () {
19693
19517
  }
19694
19518
 
19695
19519
  function treeEvery(item, filter, relation, itemPrepare) {
19696
- return !!treeWrapper(item, filter, relation, treeEvery_, itemPrepare);
19520
+ return !!treeWrapper(item, filter, relation, treeEvery_);
19697
19521
  }
19698
19522
  function treeSome(item, filter, relation, itemPrepare) {
19699
- return !!treeWrapper(item, filter, relation, treeFind_, itemPrepare);
19523
+ return !!treeWrapper(item, filter, relation, treeFind_);
19700
19524
  }
19701
19525
  function treeFind(item, filter, relation, itemPrepare) {
19702
- return treeWrapper(item, filter, relation, treeFind_, itemPrepare);
19526
+ return treeWrapper(item, filter, relation, treeFind_);
19703
19527
  }
19704
19528
  function treeFilter(item, filter, relation, itemPrepare) {
19705
19529
  return treeWrapper(
19706
19530
  item,
19707
19531
  filter,
19708
19532
  relation,
19709
- treeFilter_,
19710
- itemPrepare
19711
- );
19533
+ treeFilter_);
19712
19534
  }
19713
19535
  function getChildren(item, relation = "children") {
19714
19536
  let children = [];
@@ -19725,13 +19547,6 @@ var NgwLeaflet = (function () {
19725
19547
  }
19726
19548
  function treeWrapper(item, filter = (x) => !!x, relation = "children", treeFunction, itemPrepare) {
19727
19549
  const filterFunction = typeof filter === "function" ? filter : (i) => propertiesFilter(i, filter);
19728
- if (itemPrepare) {
19729
- return treeFunction(
19730
- item,
19731
- (i) => filterFunction(itemPrepare(i)),
19732
- relation
19733
- );
19734
- }
19735
19550
  return treeFunction(item, filterFunction, relation);
19736
19551
  }
19737
19552
  function treeFind_(item, filterFunc = (x) => !!x, relation, _filtered = []) {
@@ -19998,7 +19813,7 @@ var NgwLeaflet = (function () {
19998
19813
  }
19999
19814
  return a;
20000
19815
  };
20001
- var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
19816
+ var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, key + "" , value);
20002
19817
  const _CheckProperty = class _CheckProperty extends BaseProperty {
20003
19818
  constructor(name, item, options) {
20004
19819
  super(name, item, __spreadValues$m(__spreadValues$m({}, _CheckProperty.options), options));
@@ -20322,9 +20137,10 @@ var NgwLeaflet = (function () {
20322
20137
  function fetchNgwLayerExtent({
20323
20138
  resourceId,
20324
20139
  connector,
20325
- cache = true
20140
+ cache = true,
20141
+ signal
20326
20142
  }) {
20327
- return connector.get("layer.extent", { cache }, { id: resourceId }).then((resp) => {
20143
+ return connector.get("layer.extent", { cache, signal }, { id: resourceId }).then((resp) => {
20328
20144
  if (resp) {
20329
20145
  const { maxLat, maxLon, minLat, minLon } = resp.extent;
20330
20146
  const extentArray = [minLon, minLat, maxLon, maxLat];
@@ -20336,11 +20152,12 @@ var NgwLeaflet = (function () {
20336
20152
  resourceId,
20337
20153
  featureId,
20338
20154
  connector,
20339
- cache = true
20155
+ cache = true,
20156
+ signal
20340
20157
  }) {
20341
20158
  return connector.get(
20342
20159
  "feature_layer.feature.item_extent",
20343
- { cache },
20160
+ { cache, signal },
20344
20161
  { id: resourceId, fid: featureId }
20345
20162
  ).then((resp) => {
20346
20163
  if (resp) {
@@ -20351,7 +20168,10 @@ var NgwLeaflet = (function () {
20351
20168
  });
20352
20169
  }
20353
20170
  function fetchNgwExtent(options) {
20354
- return options.connector.getResource(options.resourceId).then((resource) => {
20171
+ return options.connector.getResource(options.resourceId, {
20172
+ signal: options.signal,
20173
+ cache: options.cache
20174
+ }).then((resource) => {
20355
20175
  if (resource) {
20356
20176
  return fetchNgwResourceExtent(resource, options.connector, options);
20357
20177
  }
@@ -20359,11 +20179,11 @@ var NgwLeaflet = (function () {
20359
20179
  }
20360
20180
  function fetchNgwResourceExtent(item, connector, options) {
20361
20181
  if (item.webmap) {
20362
- return CancelablePromise.resolve(getNgwWebmapExtent(item.webmap));
20182
+ return Promise.resolve(getNgwWebmapExtent(item.webmap));
20363
20183
  } else {
20364
20184
  const resource = item.resource;
20365
20185
  if (resource.cls && resource.cls.indexOf("style") !== -1) {
20366
- return connector.getResource(resource.parent.id).then((res) => {
20186
+ return connector.getResource(resource.parent.id, options).then((res) => {
20367
20187
  if (res) {
20368
20188
  return fetchNgwLayerExtent(__spreadProps$b(__spreadValues$j({}, options), {
20369
20189
  resourceId: res.resource.id,
@@ -20383,7 +20203,7 @@ var NgwLeaflet = (function () {
20383
20203
  var __defProp$q = Object.defineProperty;
20384
20204
  var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20385
20205
  var __publicField$i = (obj, key, value) => __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
20386
- var __async$j = (__this, __arguments, generator) => {
20206
+ var __async$m = (__this, __arguments, generator) => {
20387
20207
  return new Promise((resolve, reject) => {
20388
20208
  var fulfilled = (value) => {
20389
20209
  try {
@@ -20411,12 +20231,12 @@ var NgwLeaflet = (function () {
20411
20231
  }
20412
20232
  /** @deprecated use {@link NgwResource.getBounds} instead */
20413
20233
  getExtent() {
20414
- return __async$j(this, null, function* () {
20234
+ return __async$m(this, null, function* () {
20415
20235
  return this.getBounds();
20416
20236
  });
20417
20237
  }
20418
20238
  getBounds(options) {
20419
- return __async$j(this, null, function* () {
20239
+ return __async$m(this, null, function* () {
20420
20240
  if (this._extent) {
20421
20241
  return this._extent;
20422
20242
  }
@@ -20432,7 +20252,7 @@ var NgwLeaflet = (function () {
20432
20252
  }
20433
20253
  }
20434
20254
 
20435
- var __async$i = (__this, __arguments, generator) => {
20255
+ var __async$l = (__this, __arguments, generator) => {
20436
20256
  return new Promise((resolve, reject) => {
20437
20257
  var fulfilled = (value) => {
20438
20258
  try {
@@ -20453,7 +20273,7 @@ var NgwLeaflet = (function () {
20453
20273
  });
20454
20274
  };
20455
20275
  function resourceIdFromLayerOptions(options, connector) {
20456
- return __async$i(this, null, function* () {
20276
+ return __async$l(this, null, function* () {
20457
20277
  const resource = options.resource;
20458
20278
  const item = resource;
20459
20279
  let { keyname, resourceId } = options;
@@ -20555,7 +20375,7 @@ var NgwLeaflet = (function () {
20555
20375
  return target;
20556
20376
  };
20557
20377
  var __publicField$h = (obj, key, value) => __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
20558
- var __async$h = (__this, __arguments, generator) => {
20378
+ var __async$k = (__this, __arguments, generator) => {
20559
20379
  return new Promise((resolve, reject) => {
20560
20380
  var fulfilled = (value) => {
20561
20381
  try {
@@ -20607,7 +20427,7 @@ var NgwLeaflet = (function () {
20607
20427
  }
20608
20428
  }
20609
20429
  addLayer(options) {
20610
- return __async$h(this, null, function* () {
20430
+ return __async$k(this, null, function* () {
20611
20431
  if (!this.qms && options.qmsId) {
20612
20432
  try {
20613
20433
  this.qms = yield loadJson(
@@ -20715,7 +20535,7 @@ var NgwLeaflet = (function () {
20715
20535
  };
20716
20536
  var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
20717
20537
  var __superGet$2 = (cls, obj, key) => __reflectGet$2(__getProtoOf$2(cls), key, obj);
20718
- var __async$g = (__this, __arguments, generator) => {
20538
+ var __async$j = (__this, __arguments, generator) => {
20719
20539
  return new Promise((resolve, reject) => {
20720
20540
  var fulfilled = (value) => {
20721
20541
  try {
@@ -20736,7 +20556,7 @@ var NgwLeaflet = (function () {
20736
20556
  });
20737
20557
  };
20738
20558
  function createBasemapLayerAdapter(_0) {
20739
- return __async$g(this, arguments, function* ({
20559
+ return __async$j(this, arguments, function* ({
20740
20560
  webMap,
20741
20561
  item
20742
20562
  }) {
@@ -20757,7 +20577,7 @@ var NgwLeaflet = (function () {
20757
20577
  if (TileAdapter) {
20758
20578
  class BasemapTileAdapter extends TileAdapter {
20759
20579
  addLayer(opt) {
20760
- return __async$g(this, null, function* () {
20580
+ return __async$j(this, null, function* () {
20761
20581
  return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$a(__spreadValues$g({}, opt), { url }));
20762
20582
  });
20763
20583
  }
@@ -20797,11 +20617,12 @@ var NgwLeaflet = (function () {
20797
20617
  function fetchNgwLayerCount({
20798
20618
  connector,
20799
20619
  resourceId,
20800
- cache = true
20620
+ cache = true,
20621
+ signal
20801
20622
  }) {
20802
20623
  return connector.get(
20803
20624
  "feature_layer.feature.count",
20804
- { cache },
20625
+ { cache, signal },
20805
20626
  {
20806
20627
  id: resourceId
20807
20628
  }
@@ -20855,13 +20676,34 @@ var NgwLeaflet = (function () {
20855
20676
  return a;
20856
20677
  };
20857
20678
  var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
20679
+ var __async$i = (__this, __arguments, generator) => {
20680
+ return new Promise((resolve, reject) => {
20681
+ var fulfilled = (value) => {
20682
+ try {
20683
+ step(generator.next(value));
20684
+ } catch (e) {
20685
+ reject(e);
20686
+ }
20687
+ };
20688
+ var rejected = (value) => {
20689
+ try {
20690
+ step(generator.throw(value));
20691
+ } catch (e) {
20692
+ reject(e);
20693
+ }
20694
+ };
20695
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
20696
+ step((generator = generator.apply(__this, __arguments)).next());
20697
+ });
20698
+ };
20858
20699
  function fetchNgwLayerItems(options) {
20859
- const filters = options.filters;
20860
- if (filters) {
20861
- return createFeatureFieldFilterQueries(__spreadProps$9(__spreadValues$f({}, options), {
20862
- filters
20863
- })).then((data) => {
20864
- var _a;
20700
+ return __async$i(this, null, function* () {
20701
+ var _a;
20702
+ const filters = options.filters;
20703
+ if (filters) {
20704
+ let data = yield createFeatureFieldFilterQueries(__spreadProps$9(__spreadValues$f({}, options), {
20705
+ filters
20706
+ }));
20865
20707
  const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a : isFilterWithAnyCase(filters);
20866
20708
  if (clientFilterValidate) {
20867
20709
  data = data.filter((y) => {
@@ -20873,10 +20715,10 @@ var NgwLeaflet = (function () {
20873
20715
  });
20874
20716
  }
20875
20717
  return data;
20876
- });
20877
- } else {
20878
- return fetchNgwLayerItemsRequest(options);
20879
- }
20718
+ } else {
20719
+ return fetchNgwLayerItemsRequest(options);
20720
+ }
20721
+ });
20880
20722
  }
20881
20723
  function isFilterWithAnyCase(filters) {
20882
20724
  if (filters[0] === "any") {
@@ -20894,8 +20736,29 @@ var NgwLeaflet = (function () {
20894
20736
  return false;
20895
20737
  }
20896
20738
 
20739
+ var __async$h = (__this, __arguments, generator) => {
20740
+ return new Promise((resolve, reject) => {
20741
+ var fulfilled = (value) => {
20742
+ try {
20743
+ step(generator.next(value));
20744
+ } catch (e) {
20745
+ reject(e);
20746
+ }
20747
+ };
20748
+ var rejected = (value) => {
20749
+ try {
20750
+ step(generator.throw(value));
20751
+ } catch (e) {
20752
+ reject(e);
20753
+ }
20754
+ };
20755
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
20756
+ step((generator = generator.apply(__this, __arguments)).next());
20757
+ });
20758
+ };
20897
20759
  function fetchNgwLayerFeatures(options) {
20898
- return fetchNgwLayerItems(options).then((x) => {
20760
+ return __async$h(this, null, function* () {
20761
+ const x = yield fetchNgwLayerItems(options);
20899
20762
  const features = [];
20900
20763
  x.forEach((y) => {
20901
20764
  features.push(createGeoJsonFeature(y));
@@ -20955,7 +20818,7 @@ var NgwLeaflet = (function () {
20955
20818
  var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
20956
20819
  var __publicField$f = (obj, key, value) => __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
20957
20820
  var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
20958
- var __async$f = (__this, __arguments, generator) => {
20821
+ var __async$g = (__this, __arguments, generator) => {
20959
20822
  return new Promise((resolve, reject) => {
20960
20823
  var fulfilled = (value) => {
20961
20824
  try {
@@ -20976,7 +20839,7 @@ var NgwLeaflet = (function () {
20976
20839
  });
20977
20840
  };
20978
20841
  function createGeoJsonAdapter(props) {
20979
- return __async$f(this, null, function* () {
20842
+ return __async$g(this, null, function* () {
20980
20843
  var _a, _b;
20981
20844
  const {
20982
20845
  item,
@@ -20992,29 +20855,35 @@ var NgwLeaflet = (function () {
20992
20855
  const _loadedIds = [];
20993
20856
  let _fullDataLoad = false;
20994
20857
  let _lastFilterArgs;
20995
- let _dataPromise;
20858
+ let internalAbortController;
20996
20859
  const resourceId = yield resourceIdFromLayerOptions(options, connector);
20997
20860
  if ((_b = (_a = options.adapterOptions) == null ? void 0 : _a.popupOptions) == null ? void 0 : _b.fromProperties) {
20998
20861
  options.adapterOptions.popupOptions.createPopupContent = ({ feature }) => {
20999
20862
  return feature && createPopupContent(feature, item);
21000
20863
  };
21001
20864
  }
21002
- const getData = (filters, filterOpt) => __async$f(this, null, function* () {
20865
+ const getData = (filters, filterOpt) => __async$g(this, null, function* () {
21003
20866
  abort();
20867
+ internalAbortController = new AbortController();
20868
+ const internalSignal = internalAbortController.signal;
20869
+ if (filterOpt == null ? void 0 : filterOpt.signal) {
20870
+ filterOpt.signal.addEventListener("abort", internalAbortController.abort);
20871
+ }
20872
+ filterOpt = filterOpt || {};
20873
+ filterOpt.signal = internalSignal;
21004
20874
  _lastFilterArgs = { filters, options: filterOpt };
21005
- _dataPromise = fetchNgwLayerFeatureCollection(__spreadValues$e({
20875
+ return fetchNgwLayerFeatureCollection(__spreadValues$e({
21006
20876
  resourceId,
21007
20877
  filters,
21008
20878
  connector,
21009
20879
  cache: true
21010
20880
  }, filterOpt));
21011
- return yield _dataPromise;
21012
20881
  });
21013
20882
  let removed = false;
21014
20883
  const abort = () => {
21015
- if (_dataPromise) {
21016
- _dataPromise.cancel();
21017
- _dataPromise = void 0;
20884
+ if (internalAbortController) {
20885
+ internalAbortController.abort();
20886
+ internalAbortController = void 0;
21018
20887
  }
21019
20888
  };
21020
20889
  class NgwGeoJsonAdapter extends GeoJsonAdapter {
@@ -21027,7 +20896,7 @@ var NgwLeaflet = (function () {
21027
20896
  __publicField$f(this, "__disableMapMoveListener");
21028
20897
  }
21029
20898
  addLayer(opt) {
21030
- return __async$f(this, null, function* () {
20899
+ return __async$g(this, null, function* () {
21031
20900
  let needUpdate = !opt.data;
21032
20901
  const waitFullLoad = opt.waitFullLoad !== void 0 ? opt.waitFullLoad : true;
21033
20902
  if (options.id !== void 0) {
@@ -21072,7 +20941,7 @@ var NgwLeaflet = (function () {
21072
20941
  return this.getBounds();
21073
20942
  }
21074
20943
  getBounds() {
21075
- return __async$f(this, null, function* () {
20944
+ return __async$g(this, null, function* () {
21076
20945
  const hasData = this.getLayers && this.getLayers().length;
21077
20946
  const strategy = this.options.strategy;
21078
20947
  if ((strategy == null ? void 0 : strategy.startsWith("BBOX")) || hasData) {
@@ -21098,7 +20967,7 @@ var NgwLeaflet = (function () {
21098
20967
  return fetchNgwLayerCount({ connector, resourceId, cache: true });
21099
20968
  }
21100
20969
  updateLayer(filterArgs) {
21101
- return __async$f(this, null, function* () {
20970
+ return __async$g(this, null, function* () {
21102
20971
  var _a2;
21103
20972
  filterArgs = filterArgs || _lastFilterArgs || {};
21104
20973
  if ((_a2 = this.options.strategy) == null ? void 0 : _a2.startsWith("BBOX")) {
@@ -21164,7 +21033,7 @@ var NgwLeaflet = (function () {
21164
21033
  });
21165
21034
  }
21166
21035
  propertiesFilter(filters, opt) {
21167
- return __async$f(this, null, function* () {
21036
+ return __async$g(this, null, function* () {
21168
21037
  abort();
21169
21038
  if (this.filter && _fullDataLoad) {
21170
21039
  this.filter((e) => {
@@ -21238,7 +21107,7 @@ var NgwLeaflet = (function () {
21238
21107
  });
21239
21108
  }
21240
21109
 
21241
- var __async$e = (__this, __arguments, generator) => {
21110
+ var __async$f = (__this, __arguments, generator) => {
21242
21111
  return new Promise((resolve, reject) => {
21243
21112
  var fulfilled = (value) => {
21244
21113
  try {
@@ -21259,7 +21128,7 @@ var NgwLeaflet = (function () {
21259
21128
  });
21260
21129
  };
21261
21130
  function createWebMapAdapter(_0) {
21262
- return __async$e(this, arguments, function* ({
21131
+ return __async$f(this, arguments, function* ({
21263
21132
  layerOptions: options,
21264
21133
  webMap,
21265
21134
  connector
@@ -21387,7 +21256,7 @@ var NgwLeaflet = (function () {
21387
21256
  };
21388
21257
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
21389
21258
  var __publicField$e = (obj, key, value) => __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
21390
- var __async$d = (__this, __arguments, generator) => {
21259
+ var __async$e = (__this, __arguments, generator) => {
21391
21260
  return new Promise((resolve, reject) => {
21392
21261
  var fulfilled = (value) => {
21393
21262
  try {
@@ -21408,7 +21277,7 @@ var NgwLeaflet = (function () {
21408
21277
  });
21409
21278
  };
21410
21279
  function createRasterAdapter(_0) {
21411
- return __async$d(this, arguments, function* ({
21280
+ return __async$e(this, arguments, function* ({
21412
21281
  layerOptions,
21413
21282
  webMap,
21414
21283
  connector,
@@ -21464,7 +21333,7 @@ var NgwLeaflet = (function () {
21464
21333
  return super.addLayer(__spreadValues$d(__spreadValues$d({}, this.options), addOptions));
21465
21334
  }
21466
21335
  getLegend(options) {
21467
- return __async$d(this, null, function* () {
21336
+ return __async$e(this, null, function* () {
21468
21337
  const ngwLegend = yield connector.get("render.legend_symbols", __spreadValues$d({
21469
21338
  params: { id: resourceId },
21470
21339
  cache: true
@@ -21484,7 +21353,7 @@ var NgwLeaflet = (function () {
21484
21353
  });
21485
21354
  }
21486
21355
  getIdentificationIds() {
21487
- return __async$d(this, null, function* () {
21356
+ return __async$e(this, null, function* () {
21488
21357
  if (this.item) {
21489
21358
  if (adapter === "MVT") {
21490
21359
  return [this.item.resource.id];
@@ -21525,7 +21394,7 @@ var NgwLeaflet = (function () {
21525
21394
  return a;
21526
21395
  };
21527
21396
  var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
21528
- var __async$c = (__this, __arguments, generator) => {
21397
+ var __async$d = (__this, __arguments, generator) => {
21529
21398
  return new Promise((resolve, reject) => {
21530
21399
  var fulfilled = (value) => {
21531
21400
  try {
@@ -21561,7 +21430,7 @@ var NgwLeaflet = (function () {
21561
21430
  "tmsclient_layer"
21562
21431
  ];
21563
21432
  function createAdapterFromFirstStyle(_0) {
21564
- return __async$c(this, arguments, function* ({
21433
+ return __async$d(this, arguments, function* ({
21565
21434
  layerOptions,
21566
21435
  webMap,
21567
21436
  connector,
@@ -21580,7 +21449,7 @@ var NgwLeaflet = (function () {
21580
21449
  });
21581
21450
  }
21582
21451
  function createAsyncAdapter(options, webMap, connector) {
21583
- return __async$c(this, null, function* () {
21452
+ return __async$d(this, null, function* () {
21584
21453
  let adapter;
21585
21454
  let item;
21586
21455
  const adapterType = options.adapter;
@@ -21777,7 +21646,7 @@ var NgwLeaflet = (function () {
21777
21646
  return a;
21778
21647
  };
21779
21648
  var __publicField$d = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
21780
- var __async$b = (__this, __arguments, generator) => {
21649
+ var __async$c = (__this, __arguments, generator) => {
21781
21650
  return new Promise((resolve, reject) => {
21782
21651
  var fulfilled = (value) => {
21783
21652
  try {
@@ -21827,7 +21696,7 @@ var NgwLeaflet = (function () {
21827
21696
  }
21828
21697
  }
21829
21698
  static create(webMap, item, options, connector, parent) {
21830
- return __async$b(this, null, function* () {
21699
+ return __async$c(this, null, function* () {
21831
21700
  const ngwWebmapItem = new _NgwWebmapItem(
21832
21701
  webMap,
21833
21702
  item,
@@ -21856,15 +21725,14 @@ var NgwLeaflet = (function () {
21856
21725
  return this.layer;
21857
21726
  }
21858
21727
  getLegend(options) {
21859
- return __async$b(this, null, function* () {
21728
+ return __async$c(this, null, function* () {
21860
21729
  var _a;
21861
21730
  const id = (_a = this.layer) == null ? void 0 : _a.id;
21862
21731
  if (id !== void 0) {
21863
21732
  const connector = this.connector;
21864
21733
  if (connector) {
21865
21734
  const ngwLegend = yield connector.get("render.legend_symbols", __spreadValues$a({
21866
- params: { id: this.item.resourceId },
21867
- cache: true
21735
+ params: { id: this.item.resourceId }
21868
21736
  }, options));
21869
21737
  const legend = {
21870
21738
  layerId: id,
@@ -22055,7 +21923,7 @@ var NgwLeaflet = (function () {
22055
21923
  return a;
22056
21924
  };
22057
21925
  var __publicField$c = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
22058
- var __async$a = (__this, __arguments, generator) => {
21926
+ var __async$b = (__this, __arguments, generator) => {
22059
21927
  return new Promise((resolve, reject) => {
22060
21928
  var fulfilled = (value) => {
22061
21929
  try {
@@ -22076,7 +21944,7 @@ var NgwLeaflet = (function () {
22076
21944
  });
22077
21945
  };
22078
21946
  function createOnFirstShowAdapter(_0) {
22079
- return __async$a(this, arguments, function* ({
21947
+ return __async$b(this, arguments, function* ({
22080
21948
  webMap,
22081
21949
  adapterOptions = {},
22082
21950
  onLayerAdded,
@@ -22102,7 +21970,7 @@ var NgwLeaflet = (function () {
22102
21970
  return this._removed;
22103
21971
  }
22104
21972
  showLayer() {
22105
- return __async$a(this, null, function* () {
21973
+ return __async$b(this, null, function* () {
22106
21974
  this.options.visibility = true;
22107
21975
  if (this.layer.length) {
22108
21976
  for (const x of this.layer) {
@@ -22114,7 +21982,7 @@ var NgwLeaflet = (function () {
22114
21982
  });
22115
21983
  }
22116
21984
  hideLayer() {
22117
- return __async$a(this, null, function* () {
21985
+ return __async$b(this, null, function* () {
22118
21986
  this.options.visibility = false;
22119
21987
  if (this.layer) {
22120
21988
  for (const x of this.layer) {
@@ -22124,7 +21992,7 @@ var NgwLeaflet = (function () {
22124
21992
  });
22125
21993
  }
22126
21994
  loadLayer() {
22127
- return __async$a(this, null, function* () {
21995
+ return __async$b(this, null, function* () {
22128
21996
  if (!this.layer.length && !this._creatingInProgress) {
22129
21997
  this._creatingInProgress = true;
22130
21998
  const Adapter = yield createAdapter(this);
@@ -22158,7 +22026,7 @@ var NgwLeaflet = (function () {
22158
22026
  });
22159
22027
  }
22160
22028
 
22161
- var __async$9 = (__this, __arguments, generator) => {
22029
+ var __async$a = (__this, __arguments, generator) => {
22162
22030
  return new Promise((resolve, reject) => {
22163
22031
  var fulfilled = (value) => {
22164
22032
  try {
@@ -22179,7 +22047,7 @@ var NgwLeaflet = (function () {
22179
22047
  });
22180
22048
  };
22181
22049
  function createOnFirstShowNgwAdapter(_0) {
22182
- return __async$9(this, arguments, function* ({
22050
+ return __async$a(this, arguments, function* ({
22183
22051
  webMap,
22184
22052
  connector,
22185
22053
  item,
@@ -22232,7 +22100,7 @@ var NgwLeaflet = (function () {
22232
22100
  return a;
22233
22101
  };
22234
22102
  var __publicField$b = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
22235
- var __async$8 = (__this, __arguments, generator) => {
22103
+ var __async$9 = (__this, __arguments, generator) => {
22236
22104
  return new Promise((resolve, reject) => {
22237
22105
  var fulfilled = (value) => {
22238
22106
  try {
@@ -22283,7 +22151,7 @@ var NgwLeaflet = (function () {
22283
22151
  }
22284
22152
  }
22285
22153
  addLayer(options) {
22286
- return __async$8(this, null, function* () {
22154
+ return __async$9(this, null, function* () {
22287
22155
  var _a, _b;
22288
22156
  this.options = __spreadValues$8(__spreadValues$8({}, this.options), options);
22289
22157
  this.layer = yield this._getWebMapLayerItem();
@@ -22316,21 +22184,21 @@ var NgwLeaflet = (function () {
22316
22184
  delete this._webmapLayersIds;
22317
22185
  }
22318
22186
  showLayer() {
22319
- return __async$8(this, null, function* () {
22187
+ return __async$9(this, null, function* () {
22320
22188
  if (this.layer && this.layer.properties) {
22321
22189
  return this.layer.properties.property("visibility").set(true);
22322
22190
  }
22323
22191
  });
22324
22192
  }
22325
22193
  hideLayer() {
22326
- return __async$8(this, null, function* () {
22194
+ return __async$9(this, null, function* () {
22327
22195
  if (this.layer && this.layer.properties) {
22328
22196
  return this.layer.properties.property("visibility").set(false);
22329
22197
  }
22330
22198
  });
22331
22199
  }
22332
22200
  setOpacity(val) {
22333
- return __async$8(this, null, function* () {
22201
+ return __async$9(this, null, function* () {
22334
22202
  if (this.layer && this.layer.properties) {
22335
22203
  return this.layer.properties.property("opacity").set(val);
22336
22204
  }
@@ -22355,22 +22223,22 @@ var NgwLeaflet = (function () {
22355
22223
  return webmap.bookmark_resource.id;
22356
22224
  }
22357
22225
  }
22358
- fetchBookmarks() {
22226
+ fetchBookmarks(options) {
22359
22227
  const bookmarkResId = this.getBookmarksResourceId();
22360
22228
  const connector = this.options.connector;
22361
22229
  if (bookmarkResId) {
22362
- return connector.getResourceOrFail(bookmarkResId).then((item) => {
22230
+ return connector.getResourceOrFail(bookmarkResId, options).then((item) => {
22363
22231
  var _a;
22364
22232
  const labelField = (_a = item.feature_layer) == null ? void 0 : _a.fields.find(
22365
22233
  (x) => x.label_field
22366
22234
  );
22367
22235
  const keyname = labelField && labelField.keyname;
22368
- return fetchNgwLayerItems({
22236
+ return fetchNgwLayerItems(__spreadValues$8({
22369
22237
  connector,
22370
22238
  resourceId: bookmarkResId,
22371
22239
  geom: false,
22372
22240
  fields: keyname ? [keyname] : void 0
22373
- }).then((items) => {
22241
+ }, options)).then((items) => {
22374
22242
  const bookmarks = [];
22375
22243
  for (const i of items) {
22376
22244
  const bookmark = new BookmarkItem({
@@ -22389,24 +22257,24 @@ var NgwLeaflet = (function () {
22389
22257
  "Webmap was not loaded correctly, it is impossible to extract bookmarks"
22390
22258
  );
22391
22259
  }
22392
- getLegend() {
22393
- return __async$8(this, null, function* () {
22260
+ getLegend(options) {
22261
+ return __async$9(this, null, function* () {
22394
22262
  const legends = [];
22395
22263
  let deps = this.getDependLayers();
22396
22264
  deps = deps.sort((a, b) => b.id - a.id);
22397
22265
  for (const d of deps) {
22398
- const layerLegend = yield d.getLegend();
22266
+ const layerLegend = yield d.getLegend(options);
22399
22267
  legends.push(...layerLegend);
22400
22268
  }
22401
22269
  return legends;
22402
22270
  });
22403
22271
  }
22404
- getIdentificationIds() {
22405
- return __async$8(this, null, function* () {
22272
+ getIdentificationIds(options) {
22273
+ return __async$9(this, null, function* () {
22406
22274
  const visibleLayers = [];
22407
22275
  let ids = this._webmapLayersIds;
22408
22276
  if (!ids) {
22409
- ids = yield this._getWebMapIds();
22277
+ ids = yield this._getWebMapIds(options);
22410
22278
  this._webmapLayersIds = ids;
22411
22279
  }
22412
22280
  if (ids && ids.length) {
@@ -22428,7 +22296,7 @@ var NgwLeaflet = (function () {
22428
22296
  });
22429
22297
  }
22430
22298
  _getWebMapLayerItem() {
22431
- return __async$8(this, null, function* () {
22299
+ return __async$9(this, null, function* () {
22432
22300
  if (this.resourceId) {
22433
22301
  const webmap = yield this.getWebMapConfig(this.resourceId);
22434
22302
  if (webmap && webmap.root_item) {
@@ -22461,7 +22329,7 @@ var NgwLeaflet = (function () {
22461
22329
  });
22462
22330
  }
22463
22331
  getWebMapConfig(id) {
22464
- return __async$8(this, null, function* () {
22332
+ return __async$9(this, null, function* () {
22465
22333
  const data = yield this.options.connector.getResource(id);
22466
22334
  if (data) {
22467
22335
  this.response = data;
@@ -22555,8 +22423,8 @@ var NgwLeaflet = (function () {
22555
22423
  }
22556
22424
  return item;
22557
22425
  }
22558
- _getWebMapIds() {
22559
- return __async$8(this, null, function* () {
22426
+ _getWebMapIds(options) {
22427
+ return __async$9(this, null, function* () {
22560
22428
  const webMapItem = this.layer;
22561
22429
  if (webMapItem && webMapItem.item.item_type === "root") {
22562
22430
  const layers = webMapItem.tree.getDescendants();
@@ -22565,7 +22433,7 @@ var NgwLeaflet = (function () {
22565
22433
  const item = x.item;
22566
22434
  if (item.item_type === "layer") {
22567
22435
  const id = item.layer_style_id;
22568
- const promise = this.options.connector.getResource(id).then((y) => {
22436
+ const promise = this.options.connector.getResource(id, options).then((y) => {
22569
22437
  if (y) {
22570
22438
  const parentId = Number(y.resource.parent.id);
22571
22439
  item.parentId = parentId;
@@ -22599,7 +22467,7 @@ var NgwLeaflet = (function () {
22599
22467
  return a;
22600
22468
  };
22601
22469
  var __publicField$a = (obj, key, value) => __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
22602
- var __async$7 = (__this, __arguments, generator) => {
22470
+ var __async$8 = (__this, __arguments, generator) => {
22603
22471
  return new Promise((resolve, reject) => {
22604
22472
  var fulfilled = (value) => {
22605
22473
  try {
@@ -22644,7 +22512,7 @@ var NgwLeaflet = (function () {
22644
22512
  classAdapters[cls] = adapter;
22645
22513
  }
22646
22514
  onLoadSync(webMap) {
22647
- return __async$7(this, null, function* () {
22515
+ return __async$8(this, null, function* () {
22648
22516
  if (this.options.resourceId && this.url) {
22649
22517
  const resourceIds = [this.options.resourceId];
22650
22518
  if (resourceIds.length) {
@@ -22727,7 +22595,7 @@ var NgwLeaflet = (function () {
22727
22595
  }
22728
22596
  identify(options = {}) {
22729
22597
  if (this._item) {
22730
- return CancelablePromise.resolve(this._item);
22598
+ return Promise.resolve(this._item);
22731
22599
  }
22732
22600
  return fetchNgwLayerItem(__spreadValues$6({
22733
22601
  connector: this.connector,
@@ -22742,30 +22610,30 @@ var NgwLeaflet = (function () {
22742
22610
  return resp;
22743
22611
  });
22744
22612
  }
22745
- resource() {
22613
+ resource(opt) {
22746
22614
  if (this._resource) {
22747
- return CancelablePromise.resolve(this._resource.feature_layer);
22615
+ return Promise.resolve(this._resource.feature_layer);
22748
22616
  }
22749
- return this.connector.getResource(this.layerId).then((resp) => {
22617
+ return this.connector.getResource(this.layerId, opt).then((resp) => {
22750
22618
  this._resource = resp;
22751
22619
  return this._resource.feature_layer;
22752
22620
  });
22753
22621
  }
22754
- getBounds() {
22622
+ getBounds(opt) {
22755
22623
  if (this._extent) {
22756
- return CancelablePromise.resolve(this._extent);
22624
+ return Promise.resolve(this._extent);
22757
22625
  }
22758
- return fetchNgwLayerItemExtent({
22626
+ return fetchNgwLayerItemExtent(__spreadValues$6({
22759
22627
  connector: this.connector,
22760
22628
  featureId: this.id,
22761
22629
  resourceId: this.layerId
22762
- });
22630
+ }, opt));
22763
22631
  }
22764
- geojson() {
22632
+ geojson(options) {
22765
22633
  if (this._geojson) {
22766
- return CancelablePromise.resolve(this._geojson);
22634
+ return Promise.resolve(this._geojson);
22767
22635
  }
22768
- return this.identify().then((resp) => {
22636
+ return this.identify(options).then((resp) => {
22769
22637
  return resp.toGeojson().then((geojson) => {
22770
22638
  this._geojson = geojson;
22771
22639
  return geojson;
@@ -22774,8 +22642,29 @@ var NgwLeaflet = (function () {
22774
22642
  }
22775
22643
  }
22776
22644
 
22645
+ var __async$7 = (__this, __arguments, generator) => {
22646
+ return new Promise((resolve, reject) => {
22647
+ var fulfilled = (value) => {
22648
+ try {
22649
+ step(generator.next(value));
22650
+ } catch (e) {
22651
+ reject(e);
22652
+ }
22653
+ };
22654
+ var rejected = (value) => {
22655
+ try {
22656
+ step(generator.throw(value));
22657
+ } catch (e) {
22658
+ reject(e);
22659
+ }
22660
+ };
22661
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
22662
+ step((generator = generator.apply(__this, __arguments)).next());
22663
+ });
22664
+ };
22777
22665
  function fetchNgwLayerFeature(options) {
22778
- return fetchNgwLayerItem(options).then((item) => {
22666
+ return __async$7(this, null, function* () {
22667
+ const item = yield fetchNgwLayerItem(options);
22779
22668
  return createGeoJsonFeature(item);
22780
22669
  });
22781
22670
  }
@@ -22860,7 +22749,7 @@ var NgwLeaflet = (function () {
22860
22749
  const withGeom = item.features.find((x) => x.geom);
22861
22750
  if (withGeom && withGeom.geom) {
22862
22751
  const geom = withGeom.geom;
22863
- return CancelablePromise.resolve(
22752
+ return Promise.resolve(
22864
22753
  createGeoJsonFeature(__spreadProps$5(__spreadValues$5({}, withGeom), {
22865
22754
  geom
22866
22755
  }))
@@ -22873,7 +22762,7 @@ var NgwLeaflet = (function () {
22873
22762
  if (params && params.length) {
22874
22763
  return fetchNgwLayerFeature(__spreadValues$5(__spreadProps$5(__spreadValues$5({}, requestOptions), { connector }), params[0]));
22875
22764
  }
22876
- return CancelablePromise.resolve(void 0);
22765
+ return Promise.resolve(void 0);
22877
22766
  }
22878
22767
  function fetchIdentifyItem(options) {
22879
22768
  const { connector, identify } = options;
@@ -22883,7 +22772,7 @@ var NgwLeaflet = (function () {
22883
22772
  connector
22884
22773
  }, options.requestOptions), params[0]));
22885
22774
  }
22886
- return CancelablePromise.resolve(void 0);
22775
+ return Promise.resolve(void 0);
22887
22776
  }
22888
22777
  function featureLayerIdentify(options) {
22889
22778
  const { geom, signal, cache, layers } = options;
@@ -22927,9 +22816,9 @@ var NgwLeaflet = (function () {
22927
22816
  function sendIdentifyRequest(ev, options) {
22928
22817
  deprecatedMapClick(ev);
22929
22818
  const [lng, lat] = ev.lngLat;
22930
- const { geom, radius, signal, cache } = options;
22819
+ const { geom, radius } = options;
22931
22820
  const geom_ = geom != null ? geom : getCirclePolygonCoordinates(lng, lat, radius);
22932
- return featureLayerIdentify(__spreadProps$5(__spreadValues$5({}, options), { geom: geom_, signal, cache }));
22821
+ return featureLayerIdentify(__spreadProps$5(__spreadValues$5({}, options), { geom: geom_ }));
22933
22822
  }
22934
22823
  function createIdentifyItem(opt) {
22935
22824
  return new IdentifyItem(opt);
@@ -23275,7 +23164,7 @@ var NgwLeaflet = (function () {
23275
23164
  __publicField$3(this, "_mapState", []);
23276
23165
  __publicField$3(this, "_extent");
23277
23166
  __publicField$3(this, "_eventsStatus", {});
23278
- __publicField$3(this, "_coordFromMapClickPromise");
23167
+ __publicField$3(this, "_coordFromMapClickAbort");
23279
23168
  __publicField$3(this, "_mapEvents", {});
23280
23169
  this.mapAdapter = mapOptions.mapAdapter;
23281
23170
  this._starterKits = mapOptions.starterKits || [];
@@ -23590,36 +23479,34 @@ var NgwLeaflet = (function () {
23590
23479
  return { stop };
23591
23480
  }
23592
23481
  stopGetCoordFromMapClick() {
23593
- if (this._coordFromMapClickPromise) {
23594
- this._coordFromMapClickPromise.cancel();
23482
+ if (this._coordFromMapClickAbort) {
23483
+ this._coordFromMapClickAbort();
23484
+ this._coordFromMapClickAbort = void 0;
23595
23485
  }
23596
23486
  }
23597
23487
  getCoordFromMapClick() {
23598
- if (!this._coordFromMapClickPromise) {
23599
- this._coordFromMapClickPromise = new CancelablePromise(
23600
- (resolve, reject, onCancel) => {
23601
- const cursor = this.getCursor() || "grab";
23602
- this._removeEventListeners({ include: ["click"] });
23603
- this.setCursor("crosshair");
23604
- const onCancel_ = () => {
23605
- this.setCursor(cursor);
23606
- this._addEventsListeners({ include: ["click"] });
23607
- this.mapAdapter.emitter.off("click", onMapClick);
23608
- this._coordFromMapClickPromise = void 0;
23609
- };
23610
- const onMapClick = (e) => {
23611
- onCancel_();
23612
- deprecatedMapClick(e);
23613
- resolve(e.lngLat);
23614
- };
23615
- this.mapAdapter.emitter.once("click", onMapClick);
23616
- onCancel(onCancel_);
23617
- }
23618
- );
23488
+ if (!this._coordFromMapClickAbort) {
23489
+ return new Promise((resolve, reject) => {
23490
+ const cursor = this.getCursor() || "grab";
23491
+ this._removeEventListeners({ include: ["click"] });
23492
+ this.setCursor("crosshair");
23493
+ const onCancel_ = () => {
23494
+ this.setCursor(cursor);
23495
+ this._addEventsListeners({ include: ["click"] });
23496
+ this.mapAdapter.emitter.off("click", onMapClick);
23497
+ this._coordFromMapClickAbort = void 0;
23498
+ };
23499
+ const onMapClick = (e) => {
23500
+ onCancel_();
23501
+ deprecatedMapClick(e);
23502
+ resolve(e.lngLat);
23503
+ };
23504
+ this.mapAdapter.emitter.once("click", onMapClick);
23505
+ this._coordFromMapClickAbort = onCancel_;
23506
+ });
23619
23507
  } else {
23620
23508
  return this.getCoordFromMapClick();
23621
23509
  }
23622
- return this._coordFromMapClickPromise;
23623
23510
  }
23624
23511
  _emitStatusEvent(eventName, data) {
23625
23512
  const _eventName = eventName;
@@ -25407,26 +25294,35 @@ var NgwLeaflet = (function () {
25407
25294
  }, options));
25408
25295
  }
25409
25296
  fetchIdentifyItem(identify, requestOptions) {
25297
+ const abortController = new AbortController();
25298
+ const abortSignal = abortController.signal;
25299
+ if (requestOptions == null ? void 0 : requestOptions.signal) {
25300
+ requestOptions.signal.addEventListener("abort", abortController.abort);
25301
+ }
25302
+ requestOptions = requestOptions || {};
25303
+ requestOptions.signal = abortSignal;
25410
25304
  const promise = fetchIdentifyItem({
25411
25305
  identify,
25412
25306
  connector: this.connector,
25413
25307
  requestOptions
25414
25308
  // multiple,
25415
25309
  });
25416
- this._addPromise("identify", promise);
25310
+ this._addPromise("identify", promise, abortController);
25417
25311
  return promise;
25418
25312
  }
25419
25313
  fetchIdentifyGeoJson(identify, multiple = false) {
25314
+ const abortController = new AbortController();
25420
25315
  const promise = fetchIdentifyGeoJson({
25421
25316
  identify,
25422
25317
  connector: this.connector,
25423
- multiple
25318
+ multiple,
25319
+ requestOptions: { signal: abortController.signal }
25424
25320
  });
25425
25321
  if (promise && "then" in promise) {
25426
- this._addPromise("identify", promise);
25322
+ this._addPromise("identify", promise, abortController);
25427
25323
  return promise;
25428
25324
  } else {
25429
- return CancelablePromise.resolve(promise);
25325
+ return Promise.resolve(promise);
25430
25326
  }
25431
25327
  }
25432
25328
  /**
@@ -25600,7 +25496,7 @@ var NgwLeaflet = (function () {
25600
25496
  args.forEach((name) => {
25601
25497
  const group = this._promises[name];
25602
25498
  if (group) {
25603
- group.forEach((x) => x.cancel());
25499
+ group.forEach((x) => x[1].abort());
25604
25500
  this._promises[name] = [];
25605
25501
  }
25606
25502
  });
@@ -25667,11 +25563,13 @@ var NgwLeaflet = (function () {
25667
25563
  }, highlightDuration);
25668
25564
  }
25669
25565
  }
25566
+ const abortController = new AbortController();
25670
25567
  const selectPromise = sendIdentifyRequest(ev, {
25671
25568
  layers: ids,
25672
25569
  connector: this.connector,
25673
25570
  radius,
25674
- geom
25571
+ geom,
25572
+ signal: abortController.signal
25675
25573
  }).then((resp) => {
25676
25574
  const identify = __spreadProps$1(__spreadValues$1({}, resp), {
25677
25575
  resources: ids,
@@ -25682,22 +25580,22 @@ var NgwLeaflet = (function () {
25682
25580
  this._emitStatusEvent("ngw:select", identifyEvent);
25683
25581
  return identifyEvent;
25684
25582
  });
25685
- this._addPromise("select", selectPromise);
25583
+ this._addPromise("select", selectPromise, abortController);
25686
25584
  return selectPromise;
25687
25585
  });
25688
25586
  }
25689
- _addPromise(groupName, promise) {
25587
+ _addPromise(groupName, promise, abortController) {
25690
25588
  const group = this._promises[groupName];
25691
- if (group && group.indexOf(promise) === -1) {
25589
+ if (group && group.findIndex((g) => g[0] === promise) === -1) {
25692
25590
  const removeFromGroup = () => {
25693
- const index = group.indexOf(promise);
25591
+ const index = group.findIndex((g) => g[0] === promise);
25694
25592
  if (index !== -1) {
25695
25593
  group.splice(index, 1);
25696
25594
  }
25697
25595
  };
25698
25596
  promise.then(removeFromGroup);
25699
25597
  promise.catch(removeFromGroup);
25700
- group.push(promise);
25598
+ group.push([promise, abortController]);
25701
25599
  }
25702
25600
  }
25703
25601
  _isFitFromResource() {