@nextgis/ngw-leaflet 4.1.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 4.1.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 4.1.1; author: NextGIS */
2
2
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -16,29 +16,29 @@ var NgwLeaflet = (function () {
16
16
  return el;
17
17
  }
18
18
 
19
- var __defProp$1b = Object.defineProperty;
20
- var __defProps$v = Object.defineProperties;
21
- var __getOwnPropDescs$v = Object.getOwnPropertyDescriptors;
22
- var __getOwnPropSymbols$O = Object.getOwnPropertySymbols;
23
- var __hasOwnProp$O = Object.prototype.hasOwnProperty;
24
- var __propIsEnum$O = Object.prototype.propertyIsEnumerable;
25
- var __defNormalProp$1b = (obj, key, value) => key in obj ? __defProp$1b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
26
- var __spreadValues$N = (a, b) => {
19
+ var __defProp$1c = Object.defineProperty;
20
+ var __defProps$x = Object.defineProperties;
21
+ var __getOwnPropDescs$x = Object.getOwnPropertyDescriptors;
22
+ var __getOwnPropSymbols$S = Object.getOwnPropertySymbols;
23
+ var __hasOwnProp$S = Object.prototype.hasOwnProperty;
24
+ var __propIsEnum$S = Object.prototype.propertyIsEnumerable;
25
+ var __defNormalProp$1c = (obj, key, value) => key in obj ? __defProp$1c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
26
+ var __spreadValues$R = (a, b) => {
27
27
  for (var prop in b || (b = {}))
28
- if (__hasOwnProp$O.call(b, prop))
29
- __defNormalProp$1b(a, prop, b[prop]);
30
- if (__getOwnPropSymbols$O)
31
- for (var prop of __getOwnPropSymbols$O(b)) {
32
- if (__propIsEnum$O.call(b, prop))
33
- __defNormalProp$1b(a, prop, b[prop]);
28
+ if (__hasOwnProp$S.call(b, prop))
29
+ __defNormalProp$1c(a, prop, b[prop]);
30
+ if (__getOwnPropSymbols$S)
31
+ for (var prop of __getOwnPropSymbols$S(b)) {
32
+ if (__propIsEnum$S.call(b, prop))
33
+ __defNormalProp$1c(a, prop, b[prop]);
34
34
  }
35
35
  return a;
36
36
  };
37
- var __spreadProps$v = (a, b) => __defProps$v(a, __getOwnPropDescs$v(b));
37
+ var __spreadProps$x = (a, b) => __defProps$x(a, __getOwnPropDescs$x(b));
38
38
  const controlOptions = /* @__PURE__ */ new WeakMap();
39
39
  function resolveControlOptions(options = {}) {
40
40
  var _a;
41
- return __spreadProps$v(__spreadValues$N({}, options), {
41
+ return __spreadProps$x(__spreadValues$R({}, options), {
42
42
  margin: (_a = options.margin) != null ? _a : options.bar
43
43
  });
44
44
  }
@@ -79,25 +79,25 @@ var NgwLeaflet = (function () {
79
79
  var css_248z$4 = ".webmap-ctrl-bottom-left,.webmap-ctrl-bottom-right,.webmap-ctrl-left,.webmap-ctrl-right,.webmap-ctrl-top-left,.webmap-ctrl-top-right{position:absolute;pointer-events:none;z-index:9999}.webmap-ctrl-left,.webmap-ctrl-right{height:100%}.webmap-ctrl-left{padding-right:0}.webmap-ctrl-right{padding-left:0}.webmap-ctrl-top-left{top:0;left:0}.webmap-ctrl-top-right{top:0;right:0}.webmap-ctrl-bottom-left{bottom:0;left:0}.webmap-ctrl-bottom-right{right:0;bottom:0}.webmap-ctrl,.webmap-ctrl-wrapper{clear:both;pointer-events:auto;transform:translate(0)}.webmap-ctrl-top-left>.webmap-ctrl,.webmap-ctrl-top-left>.webmap-ctrl-wrapper{float:left}.webmap-ctrl-top-right>.webmap-ctrl,.webmap-ctrl-top-right>.webmap-ctrl-wrapper{float:right}.webmap-ctrl-bottom-left>.webmap-ctrl,.webmap-ctrl-bottom-left>.webmap-ctrl-wrapper{float:left}.webmap-ctrl-bottom-right>.webmap-ctrl,.webmap-ctrl-bottom-right>.webmap-ctrl-wrapper{float:right}.webmap-ctrl-top-left>.webmap-ctrl-margin{margin:10px 0 0 10px}.webmap-ctrl-top-right>.webmap-ctrl-margin{margin:10px 10px 0 0}.webmap-ctrl-bottom-left>.webmap-ctrl-margin{margin:0 0 10px 10px}.webmap-ctrl-bottom-right>.webmap-ctrl-margin{margin:0 10px 10px 0}.webmap-ctrl-group{border-radius:4px;background:#fff}.webmap-ctrl .webmap-ctrl-wrapper{clear:none;float:none;margin:0}.webmap-ctrl .webmap-ctrl-wrapper>.webmap-ctrl,.webmap-ctrl>.webmap-ctrl{clear:none;float:none;margin:0!important}.webmap-ctrl-horizontal,.webmap-ctrl-vertical{display:flex}.webmap-ctrl-vertical{flex-direction:column;align-items:var(--webmap-ctrl-align,flex-start)}.webmap-ctrl-horizontal{flex-direction:row;align-items:var(--webmap-ctrl-align,stretch)}.webmap-ctrl:not(.webmap-ctrl-group).webmap-ctrl-horizontal,.webmap-ctrl:not(.webmap-ctrl-group).webmap-ctrl-vertical{gap:var(--webmap-ctrl-gap,0)}.webmap-ctrl-gapless:not(.webmap-ctrl-group){border:2px solid rgba(0,0,0,.1);border-radius:4px;box-sizing:border-box;background:#fff;overflow:hidden}.webmap-ctrl-gapless:not(.webmap-ctrl-group):not(:empty){box-shadow:none}.webmap-ctrl-gapless>.webmap-ctrl-group,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl-group{border-radius:0;border:0!important;box-shadow:none!important}.webmap-ctrl-gapless>.leaflet-bar,.webmap-ctrl-gapless>.maplibregl-ctrl-group,.webmap-ctrl-gapless>.ol-control,.webmap-ctrl-gapless>.webmap-ctrl,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.leaflet-bar,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.maplibregl-ctrl-group,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.ol-control,.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl{border:0!important;box-shadow:none!important}.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-group:first-child,.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-wrapper:first-child>.webmap-ctrl-group{border-radius:4px 0 0 4px}.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-group:last-child,.webmap-ctrl-gapless.webmap-ctrl-horizontal>.webmap-ctrl-wrapper:last-child>.webmap-ctrl-group{border-radius:0 4px 4px 0}.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-group:first-child,.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-wrapper:first-child>.webmap-ctrl-group{border-radius:4px 4px 0 0}.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-group:last-child,.webmap-ctrl-gapless.webmap-ctrl-vertical>.webmap-ctrl-wrapper:last-child>.webmap-ctrl-group{border-radius:0 0 4px 4px}.webmap-ctrl-gapless>.webmap-ctrl-group:only-child,.webmap-ctrl-gapless>.webmap-ctrl-wrapper:only-child>.webmap-ctrl-group{border-radius:4px}.webmap-ctrl-horizontal>.webmap-ctrl-wrapper,.webmap-ctrl-vertical>.webmap-ctrl-wrapper{display:flex}.webmap-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.webmap-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}.webmap-ctrl-gapless:not(.webmap-ctrl-group){border-color:ButtonText}}.webmap-ctrl-gapless>.webmap-ctrl-group:not(:empty),.webmap-ctrl-gapless>.webmap-ctrl-wrapper>.webmap-ctrl-group:not(:empty){border:0!important;box-shadow:none!important}.webmap-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.webmap-ctrl-button{line-height:inherit!important;font-weight:400!important}.webmap-ctrl-group button+button{border-top:1px solid #ddd}.webmap-ctrl-group.webmap-ctrl-horizontal>button+button{border-top:0;border-left:1px solid #ddd}.webmap-ctrl-gapless .webmap-ctrl-group button+button,.webmap-ctrl-group.webmap-ctrl-gapless button+button{border-top:0!important;border-left:0!important}.webmap-ctrl-gapless .webmap-ctrl-group button{border:0!important;border-radius:0!important;box-shadow:none!important}.webmap-ctrl button .webmap-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.webmap-ctrl-icon{background-color:transparent}.webmap-ctrl-group button+button{border-top:1px solid ButtonText}}.webmap-ctrl button::-moz-focus-inner{border:0;padding:0}.webmap-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.webmap-ctrl button:disabled{cursor:not-allowed}.webmap-ctrl button:disabled .webmap-ctrl-icon{opacity:.25}.webmap-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.webmap-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.webmap-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.webmap-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.webmap-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.webmap-ctrl-group button:focus:only-child{border-radius:inherit}.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E\")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E\")}@media (-ms-high-contrast:active){.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E\")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E\")}}@media (-ms-high-contrast:black-on-white){.webmap-ctrl button.webmap-ctrl-zoom-out .webmap-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E\")}.webmap-ctrl button.webmap-ctrl-zoom-in .webmap-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E\")}}";
80
80
  styleInject(css_248z$4);
81
81
 
82
- var __defProp$1a = Object.defineProperty;
83
- var __defNormalProp$1a = (obj, key, value) => key in obj ? __defProp$1a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
84
- var __publicField$N = (obj, key, value) => __defNormalProp$1a(obj, typeof key !== "symbol" ? key + "" : key, value);
82
+ var __defProp$1b = Object.defineProperty;
83
+ var __defNormalProp$1b = (obj, key, value) => key in obj ? __defProp$1b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
84
+ var __publicField$K = (obj, key, value) => __defNormalProp$1b(obj, typeof key !== "symbol" ? key + "" : key, value);
85
85
  class ControlContainer {
86
86
  constructor(opt = {}) {
87
- __publicField$N(this, "classPrefix", "webmap");
88
- __publicField$N(this, "addClass");
89
- __publicField$N(this, "map");
90
- __publicField$N(this, "wrapperClass");
91
- __publicField$N(this, "ownsContainer");
92
- __publicField$N(this, "_container");
93
- __publicField$N(this, "_positionsContainers");
94
- __publicField$N(this, "_targets", /* @__PURE__ */ new Set());
95
- __publicField$N(this, "_idContainers", /* @__PURE__ */ new Map());
96
- __publicField$N(this, "_pendingChildren", /* @__PURE__ */ new Map());
97
- __publicField$N(this, "_orders", /* @__PURE__ */ new WeakMap());
98
- __publicField$N(this, "_targetOptions", /* @__PURE__ */ new WeakMap());
99
- __publicField$N(this, "_switchGroups", /* @__PURE__ */ new WeakMap());
100
- __publicField$N(this, "_switchBindings", /* @__PURE__ */ new WeakMap());
87
+ __publicField$K(this, "classPrefix", "webmap");
88
+ __publicField$K(this, "addClass");
89
+ __publicField$K(this, "map");
90
+ __publicField$K(this, "wrapperClass");
91
+ __publicField$K(this, "ownsContainer");
92
+ __publicField$K(this, "_container");
93
+ __publicField$K(this, "_positionsContainers");
94
+ __publicField$K(this, "_targets", /* @__PURE__ */ new Set());
95
+ __publicField$K(this, "_idContainers", /* @__PURE__ */ new Map());
96
+ __publicField$K(this, "_pendingChildren", /* @__PURE__ */ new Map());
97
+ __publicField$K(this, "_orders", /* @__PURE__ */ new WeakMap());
98
+ __publicField$K(this, "_targetOptions", /* @__PURE__ */ new WeakMap());
99
+ __publicField$K(this, "_switchGroups", /* @__PURE__ */ new WeakMap());
100
+ __publicField$K(this, "_switchBindings", /* @__PURE__ */ new WeakMap());
101
101
  this.classPrefix = opt.classPrefix || this.classPrefix;
102
102
  this.addClass = opt.addClass;
103
103
  this.map = opt.map;
@@ -14703,25 +14703,25 @@ var NgwLeaflet = (function () {
14703
14703
 
14704
14704
  var leafletSrcExports = requireLeafletSrc();
14705
14705
 
14706
- var __defProp$19 = Object.defineProperty;
14707
- var __defProps$u = Object.defineProperties;
14708
- var __getOwnPropDescs$u = Object.getOwnPropertyDescriptors;
14709
- var __getOwnPropSymbols$N = Object.getOwnPropertySymbols;
14710
- var __hasOwnProp$N = Object.prototype.hasOwnProperty;
14711
- var __propIsEnum$N = Object.prototype.propertyIsEnumerable;
14712
- var __defNormalProp$19 = (obj, key, value) => key in obj ? __defProp$19(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14713
- var __spreadValues$M = (a, b) => {
14706
+ var __defProp$1a = Object.defineProperty;
14707
+ var __defProps$w = Object.defineProperties;
14708
+ var __getOwnPropDescs$w = Object.getOwnPropertyDescriptors;
14709
+ var __getOwnPropSymbols$R = Object.getOwnPropertySymbols;
14710
+ var __hasOwnProp$R = Object.prototype.hasOwnProperty;
14711
+ var __propIsEnum$R = Object.prototype.propertyIsEnumerable;
14712
+ var __defNormalProp$1a = (obj, key, value) => key in obj ? __defProp$1a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14713
+ var __spreadValues$Q = (a, b) => {
14714
14714
  for (var prop in b || (b = {}))
14715
- if (__hasOwnProp$N.call(b, prop))
14716
- __defNormalProp$19(a, prop, b[prop]);
14717
- if (__getOwnPropSymbols$N)
14718
- for (var prop of __getOwnPropSymbols$N(b)) {
14719
- if (__propIsEnum$N.call(b, prop))
14720
- __defNormalProp$19(a, prop, b[prop]);
14715
+ if (__hasOwnProp$R.call(b, prop))
14716
+ __defNormalProp$1a(a, prop, b[prop]);
14717
+ if (__getOwnPropSymbols$R)
14718
+ for (var prop of __getOwnPropSymbols$R(b)) {
14719
+ if (__propIsEnum$R.call(b, prop))
14720
+ __defNormalProp$1a(a, prop, b[prop]);
14721
14721
  }
14722
14722
  return a;
14723
14723
  };
14724
- var __spreadProps$u = (a, b) => __defProps$u(a, __getOwnPropDescs$u(b));
14724
+ var __spreadProps$w = (a, b) => __defProps$w(a, __getOwnPropDescs$w(b));
14725
14725
  function createControl(control, options = {}, map) {
14726
14726
  const resolvedOptions = resolveControlOptions(options);
14727
14727
  const C = leafletSrcExports.Control.extend({
@@ -14733,7 +14733,7 @@ var NgwLeaflet = (function () {
14733
14733
  ].filter(Boolean).join(" ");
14734
14734
  const element = createControlElement(
14735
14735
  control,
14736
- __spreadProps$u(__spreadValues$M({}, resolvedOptions), { addClass }),
14736
+ __spreadProps$w(__spreadValues$Q({}, resolvedOptions), { addClass }),
14737
14737
  map != null ? map : leafletMap
14738
14738
  );
14739
14739
  if (!resolvedOptions.margin) {
@@ -14783,32 +14783,32 @@ var NgwLeaflet = (function () {
14783
14783
  var css_248z$3 = ".leaflet-bar.webmap-ctrl-group:not(:empty){box-shadow:0 0 2px rgba(0,0,0,.1)}";
14784
14784
  styleInject(css_248z$3);
14785
14785
 
14786
- var __defProp$18 = Object.defineProperty;
14787
- var __defProps$t = Object.defineProperties;
14788
- var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
14789
- var __getOwnPropSymbols$M = Object.getOwnPropertySymbols;
14790
- var __hasOwnProp$M = Object.prototype.hasOwnProperty;
14791
- var __propIsEnum$M = Object.prototype.propertyIsEnumerable;
14792
- var __defNormalProp$18 = (obj, key, value) => key in obj ? __defProp$18(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14793
- var __spreadValues$L = (a, b) => {
14786
+ var __defProp$19 = Object.defineProperty;
14787
+ var __defProps$v = Object.defineProperties;
14788
+ var __getOwnPropDescs$v = Object.getOwnPropertyDescriptors;
14789
+ var __getOwnPropSymbols$Q = Object.getOwnPropertySymbols;
14790
+ var __hasOwnProp$Q = Object.prototype.hasOwnProperty;
14791
+ var __propIsEnum$Q = Object.prototype.propertyIsEnumerable;
14792
+ var __defNormalProp$19 = (obj, key, value) => key in obj ? __defProp$19(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14793
+ var __spreadValues$P = (a, b) => {
14794
14794
  for (var prop in b || (b = {}))
14795
- if (__hasOwnProp$M.call(b, prop))
14796
- __defNormalProp$18(a, prop, b[prop]);
14797
- if (__getOwnPropSymbols$M)
14798
- for (var prop of __getOwnPropSymbols$M(b)) {
14799
- if (__propIsEnum$M.call(b, prop))
14800
- __defNormalProp$18(a, prop, b[prop]);
14795
+ if (__hasOwnProp$Q.call(b, prop))
14796
+ __defNormalProp$19(a, prop, b[prop]);
14797
+ if (__getOwnPropSymbols$Q)
14798
+ for (var prop of __getOwnPropSymbols$Q(b)) {
14799
+ if (__propIsEnum$Q.call(b, prop))
14800
+ __defNormalProp$19(a, prop, b[prop]);
14801
14801
  }
14802
14802
  return a;
14803
14803
  };
14804
- var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
14805
- var __publicField$M = (obj, key, value) => __defNormalProp$18(obj, typeof key !== "symbol" ? key + "" : key, value);
14804
+ var __spreadProps$v = (a, b) => __defProps$v(a, __getOwnPropDescs$v(b));
14805
+ var __publicField$J = (obj, key, value) => __defNormalProp$19(obj, typeof key !== "symbol" ? key + "" : key, value);
14806
14806
  class LeafletControlContainer {
14807
14807
  constructor(map, options = {}) {
14808
- __publicField$M(this, "map");
14809
- __publicField$M(this, "controlContainer");
14810
- __publicField$M(this, "targets", /* @__PURE__ */ new WeakMap());
14811
- __publicField$M(this, "ids", /* @__PURE__ */ new WeakMap());
14808
+ __publicField$J(this, "map");
14809
+ __publicField$J(this, "controlContainer");
14810
+ __publicField$J(this, "targets", /* @__PURE__ */ new WeakMap());
14811
+ __publicField$J(this, "ids", /* @__PURE__ */ new WeakMap());
14812
14812
  this.map = map;
14813
14813
  this.controlContainer = this.createControlContainer(options);
14814
14814
  this.controlContainer.addTo(map.getContainer());
@@ -14870,7 +14870,7 @@ var NgwLeaflet = (function () {
14870
14870
  const mapAny = this.map;
14871
14871
  const controlCorners = mapAny._controlCorners || {};
14872
14872
  const getCorner = (key, selector) => controlCorners[key] || this.map.getContainer().querySelector(selector) || void 0;
14873
- return new ControlContainer(__spreadProps$t(__spreadValues$L({}, options), {
14873
+ return new ControlContainer(__spreadProps$v(__spreadValues$P({}, options), {
14874
14874
  map: this.map,
14875
14875
  container: mapAny._controlContainer,
14876
14876
  positionContainers: {
@@ -15755,6 +15755,8 @@ var NgwLeaflet = (function () {
15755
15755
  _data.geometries = _data.geometries.filter(
15756
15756
  (g) => geometryFilter(g.type, type)
15757
15757
  );
15758
+ } else if (!geometryFilter(data.type, type)) {
15759
+ return false;
15758
15760
  }
15759
15761
  return data;
15760
15762
  }
@@ -15778,15 +15780,15 @@ var NgwLeaflet = (function () {
15778
15780
  };
15779
15781
  }
15780
15782
 
15781
- var __defProp$17 = Object.defineProperty;
15782
- var __defNormalProp$17 = (obj, key, value) => key in obj ? __defProp$17(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15783
- var __publicField$L = (obj, key, value) => __defNormalProp$17(obj, typeof key !== "symbol" ? key + "" : key, value);
15783
+ var __defProp$18 = Object.defineProperty;
15784
+ var __defNormalProp$18 = (obj, key, value) => key in obj ? __defProp$18(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15785
+ var __publicField$I = (obj, key, value) => __defNormalProp$18(obj, typeof key !== "symbol" ? key + "" : key, value);
15784
15786
  class BaseAdapter {
15785
15787
  constructor(map, options) {
15786
- __publicField$L(this, "map", map);
15787
- __publicField$L(this, "options", options);
15788
- __publicField$L(this, "layer");
15789
- __publicField$L(this, "pane", "order-0");
15788
+ __publicField$I(this, "map", map);
15789
+ __publicField$I(this, "options", options);
15790
+ __publicField$I(this, "layer");
15791
+ __publicField$I(this, "pane", "order-0");
15790
15792
  var _a, _b;
15791
15793
  if (options.order !== void 0) {
15792
15794
  const order = options.order;
@@ -15824,19 +15826,19 @@ var NgwLeaflet = (function () {
15824
15826
  };
15825
15827
  }
15826
15828
 
15827
- var __defProp$16 = Object.defineProperty;
15828
- var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
15829
- var __hasOwnProp$L = Object.prototype.hasOwnProperty;
15830
- var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
15831
- var __defNormalProp$16 = (obj, key, value) => key in obj ? __defProp$16(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15832
- var __spreadValues$K = (a, b) => {
15829
+ var __defProp$17 = Object.defineProperty;
15830
+ var __getOwnPropSymbols$P = Object.getOwnPropertySymbols;
15831
+ var __hasOwnProp$P = Object.prototype.hasOwnProperty;
15832
+ var __propIsEnum$P = Object.prototype.propertyIsEnumerable;
15833
+ var __defNormalProp$17 = (obj, key, value) => key in obj ? __defProp$17(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15834
+ var __spreadValues$O = (a, b) => {
15833
15835
  for (var prop in b || (b = {}))
15834
- if (__hasOwnProp$L.call(b, prop))
15835
- __defNormalProp$16(a, prop, b[prop]);
15836
- if (__getOwnPropSymbols$L)
15837
- for (var prop of __getOwnPropSymbols$L(b)) {
15838
- if (__propIsEnum$L.call(b, prop))
15839
- __defNormalProp$16(a, prop, b[prop]);
15836
+ if (__hasOwnProp$P.call(b, prop))
15837
+ __defNormalProp$17(a, prop, b[prop]);
15838
+ if (__getOwnPropSymbols$P)
15839
+ for (var prop of __getOwnPropSymbols$P(b)) {
15840
+ if (__propIsEnum$P.call(b, prop))
15841
+ __defNormalProp$17(a, prop, b[prop]);
15840
15842
  }
15841
15843
  return a;
15842
15844
  };
@@ -15846,7 +15848,7 @@ var NgwLeaflet = (function () {
15846
15848
  }) {
15847
15849
  const layer_ = source.target;
15848
15850
  const feature = layer_.feature;
15849
- const opt = __spreadValues$K({
15851
+ const opt = __spreadValues$O({
15850
15852
  layer,
15851
15853
  feature,
15852
15854
  event: convertMapClickEvent(source),
@@ -15855,30 +15857,30 @@ var NgwLeaflet = (function () {
15855
15857
  return opt;
15856
15858
  }
15857
15859
 
15858
- var __defProp$15 = Object.defineProperty;
15859
- var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
15860
- var __hasOwnProp$K = Object.prototype.hasOwnProperty;
15861
- var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
15862
- var __defNormalProp$15 = (obj, key, value) => key in obj ? __defProp$15(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15863
- var __spreadValues$J = (a, b) => {
15860
+ var __defProp$16 = Object.defineProperty;
15861
+ var __getOwnPropSymbols$O = Object.getOwnPropertySymbols;
15862
+ var __hasOwnProp$O = Object.prototype.hasOwnProperty;
15863
+ var __propIsEnum$O = Object.prototype.propertyIsEnumerable;
15864
+ var __defNormalProp$16 = (obj, key, value) => key in obj ? __defProp$16(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15865
+ var __spreadValues$N = (a, b) => {
15864
15866
  for (var prop in b || (b = {}))
15865
- if (__hasOwnProp$K.call(b, prop))
15866
- __defNormalProp$15(a, prop, b[prop]);
15867
- if (__getOwnPropSymbols$K)
15868
- for (var prop of __getOwnPropSymbols$K(b)) {
15869
- if (__propIsEnum$K.call(b, prop))
15870
- __defNormalProp$15(a, prop, b[prop]);
15867
+ if (__hasOwnProp$O.call(b, prop))
15868
+ __defNormalProp$16(a, prop, b[prop]);
15869
+ if (__getOwnPropSymbols$O)
15870
+ for (var prop of __getOwnPropSymbols$O(b)) {
15871
+ if (__propIsEnum$O.call(b, prop))
15872
+ __defNormalProp$16(a, prop, b[prop]);
15871
15873
  }
15872
15874
  return a;
15873
15875
  };
15874
- var __publicField$K = (obj, key, value) => __defNormalProp$15(obj, typeof key !== "symbol" ? key + "" : key, value);
15876
+ var __publicField$H = (obj, key, value) => __defNormalProp$16(obj, typeof key !== "symbol" ? key + "" : key, value);
15875
15877
  class GeoJsonEvents {
15876
15878
  constructor(layer) {
15877
- __publicField$K(this, "layer");
15878
- __publicField$K(this, "_onclick");
15879
- __publicField$K(this, "_ondblclick");
15880
- __publicField$K(this, "_mouseout");
15881
- __publicField$K(this, "_mouseover");
15879
+ __publicField$H(this, "layer");
15880
+ __publicField$H(this, "_onclick");
15881
+ __publicField$H(this, "_ondblclick");
15882
+ __publicField$H(this, "_mouseout");
15883
+ __publicField$H(this, "_mouseover");
15882
15884
  this.layer = layer;
15883
15885
  }
15884
15886
  handleMouseEvents(layer) {
@@ -15887,7 +15889,7 @@ var NgwLeaflet = (function () {
15887
15889
  if (onClick_) {
15888
15890
  this._onclick = (e) => {
15889
15891
  const selected = !!this.layer._getSelected(layer);
15890
- onClick_(__spreadValues$J({
15892
+ onClick_(__spreadValues$N({
15891
15893
  selected
15892
15894
  }, this._createMouseEvent(e)));
15893
15895
  };
@@ -15897,7 +15899,7 @@ var NgwLeaflet = (function () {
15897
15899
  this._ondblclick = (e) => {
15898
15900
  leafletSrcExports.DomEvent.stopPropagation(e);
15899
15901
  const selected = !!this.layer._getSelected(layer);
15900
- onDoubleClick(__spreadValues$J({
15902
+ onDoubleClick(__spreadValues$N({
15901
15903
  selected
15902
15904
  }, this._createMouseEvent(e)));
15903
15905
  };
@@ -16556,19 +16558,19 @@ var NgwLeaflet = (function () {
16556
16558
  typeof: evaluateArgs(([arg]) => typeOfValue(arg))
16557
16559
  };
16558
16560
 
16559
- var __defProp$14 = Object.defineProperty;
16560
- var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
16561
- var __hasOwnProp$J = Object.prototype.hasOwnProperty;
16562
- var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
16563
- var __defNormalProp$14 = (obj, key, value) => key in obj ? __defProp$14(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16564
- var __spreadValues$I = (a, b) => {
16561
+ var __defProp$15 = Object.defineProperty;
16562
+ var __getOwnPropSymbols$N = Object.getOwnPropertySymbols;
16563
+ var __hasOwnProp$N = Object.prototype.hasOwnProperty;
16564
+ var __propIsEnum$N = Object.prototype.propertyIsEnumerable;
16565
+ var __defNormalProp$15 = (obj, key, value) => key in obj ? __defProp$15(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16566
+ var __spreadValues$M = (a, b) => {
16565
16567
  for (var prop in b || (b = {}))
16566
- if (__hasOwnProp$J.call(b, prop))
16567
- __defNormalProp$14(a, prop, b[prop]);
16568
- if (__getOwnPropSymbols$J)
16569
- for (var prop of __getOwnPropSymbols$J(b)) {
16570
- if (__propIsEnum$J.call(b, prop))
16571
- __defNormalProp$14(a, prop, b[prop]);
16568
+ if (__hasOwnProp$N.call(b, prop))
16569
+ __defNormalProp$15(a, prop, b[prop]);
16570
+ if (__getOwnPropSymbols$N)
16571
+ for (var prop of __getOwnPropSymbols$N(b)) {
16572
+ if (__propIsEnum$N.call(b, prop))
16573
+ __defNormalProp$15(a, prop, b[prop]);
16572
16574
  }
16573
16575
  return a;
16574
16576
  };
@@ -16580,7 +16582,7 @@ var NgwLeaflet = (function () {
16580
16582
  }
16581
16583
  return false;
16582
16584
  }
16583
- const expressions = __spreadValues$I(__spreadValues$I(__spreadValues$I(__spreadValues$I(__spreadValues$I(__spreadValues$I({}, mathExpressions), typeExpressions), stringExpressions), lookupExpressions), decisionExpressions), interpolationExpressions);
16585
+ const expressions = __spreadValues$M(__spreadValues$M(__spreadValues$M(__spreadValues$M(__spreadValues$M(__spreadValues$M({}, mathExpressions), typeExpressions), stringExpressions), lookupExpressions), decisionExpressions), interpolationExpressions);
16584
16586
  function evaluate(expression, data = {}) {
16585
16587
  const [name, ...args] = expression;
16586
16588
  const expressionFun = expressions[name];
@@ -16593,19 +16595,19 @@ var NgwLeaflet = (function () {
16593
16595
  throw new Error(`Expression "${name}" is not supported.`);
16594
16596
  }
16595
16597
 
16596
- var __defProp$13 = Object.defineProperty;
16597
- var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
16598
- var __hasOwnProp$I = Object.prototype.hasOwnProperty;
16599
- var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
16600
- var __defNormalProp$13 = (obj, key, value) => key in obj ? __defProp$13(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16601
- var __spreadValues$H = (a, b) => {
16598
+ var __defProp$14 = Object.defineProperty;
16599
+ var __getOwnPropSymbols$M = Object.getOwnPropertySymbols;
16600
+ var __hasOwnProp$M = Object.prototype.hasOwnProperty;
16601
+ var __propIsEnum$M = Object.prototype.propertyIsEnumerable;
16602
+ var __defNormalProp$14 = (obj, key, value) => key in obj ? __defProp$14(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16603
+ var __spreadValues$L = (a, b) => {
16602
16604
  for (var prop in b || (b = {}))
16603
- if (__hasOwnProp$I.call(b, prop))
16604
- __defNormalProp$13(a, prop, b[prop]);
16605
- if (__getOwnPropSymbols$I)
16606
- for (var prop of __getOwnPropSymbols$I(b)) {
16607
- if (__propIsEnum$I.call(b, prop))
16608
- __defNormalProp$13(a, prop, b[prop]);
16605
+ if (__hasOwnProp$M.call(b, prop))
16606
+ __defNormalProp$14(a, prop, b[prop]);
16607
+ if (__getOwnPropSymbols$M)
16608
+ for (var prop of __getOwnPropSymbols$M(b)) {
16609
+ if (__propIsEnum$M.call(b, prop))
16610
+ __defNormalProp$14(a, prop, b[prop]);
16609
16611
  }
16610
16612
  return a;
16611
16613
  };
@@ -16638,25 +16640,25 @@ var NgwLeaflet = (function () {
16638
16640
  for (const p in expressions) {
16639
16641
  fromCb[p] = expressions[p](feature);
16640
16642
  }
16641
- return __spreadValues$H(__spreadValues$H({}, paint), fromCb);
16643
+ return __spreadValues$L(__spreadValues$L({}, paint), fromCb);
16642
16644
  };
16643
16645
  }
16644
16646
  return;
16645
16647
  }
16646
16648
 
16647
- var __defProp$12 = Object.defineProperty;
16648
- var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
16649
- var __hasOwnProp$H = Object.prototype.hasOwnProperty;
16650
- var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
16651
- var __defNormalProp$12 = (obj, key, value) => key in obj ? __defProp$12(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16652
- var __spreadValues$G = (a, b) => {
16649
+ var __defProp$13 = Object.defineProperty;
16650
+ var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
16651
+ var __hasOwnProp$L = Object.prototype.hasOwnProperty;
16652
+ var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
16653
+ var __defNormalProp$13 = (obj, key, value) => key in obj ? __defProp$13(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16654
+ var __spreadValues$K = (a, b) => {
16653
16655
  for (var prop in b || (b = {}))
16654
- if (__hasOwnProp$H.call(b, prop))
16655
- __defNormalProp$12(a, prop, b[prop]);
16656
- if (__getOwnPropSymbols$H)
16657
- for (var prop of __getOwnPropSymbols$H(b)) {
16658
- if (__propIsEnum$H.call(b, prop))
16659
- __defNormalProp$12(a, prop, b[prop]);
16656
+ if (__hasOwnProp$L.call(b, prop))
16657
+ __defNormalProp$13(a, prop, b[prop]);
16658
+ if (__getOwnPropSymbols$L)
16659
+ for (var prop of __getOwnPropSymbols$L(b)) {
16660
+ if (__propIsEnum$L.call(b, prop))
16661
+ __defNormalProp$13(a, prop, b[prop]);
16660
16662
  }
16661
16663
  return a;
16662
16664
  };
@@ -16703,7 +16705,7 @@ var NgwLeaflet = (function () {
16703
16705
  return false;
16704
16706
  }
16705
16707
  function featureFilter(feature, filters) {
16706
- const properties = __spreadValues$G({}, feature.properties);
16708
+ const properties = __spreadValues$K({}, feature.properties);
16707
16709
  if (properties) {
16708
16710
  properties.$id = feature.id;
16709
16711
  return propertiesFilter(properties, filters);
@@ -16757,19 +16759,19 @@ var NgwLeaflet = (function () {
16757
16759
  return false;
16758
16760
  }
16759
16761
 
16760
- var __defProp$11 = Object.defineProperty;
16761
- var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
16762
- var __hasOwnProp$G = Object.prototype.hasOwnProperty;
16763
- var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
16764
- var __defNormalProp$11 = (obj, key, value) => key in obj ? __defProp$11(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16765
- var __spreadValues$F = (a, b) => {
16762
+ var __defProp$12 = Object.defineProperty;
16763
+ var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
16764
+ var __hasOwnProp$K = Object.prototype.hasOwnProperty;
16765
+ var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
16766
+ var __defNormalProp$12 = (obj, key, value) => key in obj ? __defProp$12(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16767
+ var __spreadValues$J = (a, b) => {
16766
16768
  for (var prop in b || (b = {}))
16767
- if (__hasOwnProp$G.call(b, prop))
16768
- __defNormalProp$11(a, prop, b[prop]);
16769
- if (__getOwnPropSymbols$G)
16770
- for (var prop of __getOwnPropSymbols$G(b)) {
16771
- if (__propIsEnum$G.call(b, prop))
16772
- __defNormalProp$11(a, prop, b[prop]);
16769
+ if (__hasOwnProp$K.call(b, prop))
16770
+ __defNormalProp$12(a, prop, b[prop]);
16771
+ if (__getOwnPropSymbols$K)
16772
+ for (var prop of __getOwnPropSymbols$K(b)) {
16773
+ if (__propIsEnum$K.call(b, prop))
16774
+ __defNormalProp$12(a, prop, b[prop]);
16773
16775
  }
16774
16776
  return a;
16775
16777
  };
@@ -16798,7 +16800,7 @@ var NgwLeaflet = (function () {
16798
16800
  return (feature) => {
16799
16801
  const paint = paintsFilters.find((x) => featureFilter(feature, x[0]));
16800
16802
  if (paint) {
16801
- return __spreadValues$F(__spreadValues$F({}, mask), paint[1]);
16803
+ return __spreadValues$J(__spreadValues$J({}, mask), paint[1]);
16802
16804
  }
16803
16805
  return mask;
16804
16806
  };
@@ -16822,8 +16824,8 @@ var NgwLeaflet = (function () {
16822
16824
  }
16823
16825
  function finalizePaint({ paint, defaultPaint }) {
16824
16826
  var _a;
16825
- let newPaint = __spreadValues$F({}, defaultPaint);
16826
- newPaint = __spreadValues$F(__spreadValues$F({}, newPaint), paint);
16827
+ let newPaint = __spreadValues$J({}, defaultPaint);
16828
+ newPaint = __spreadValues$J(__spreadValues$J({}, newPaint), paint);
16827
16829
  newPaint.fill = (_a = newPaint.fill) != null ? _a : true;
16828
16830
  newPaint.stroke = newPaint.stroke !== void 0 ? newPaint.stroke : !newPaint.fill || !!(newPaint.strokeColor || newPaint.strokeOpacity);
16829
16831
  return newPaint;
@@ -16836,7 +16838,7 @@ var NgwLeaflet = (function () {
16836
16838
  if (!paint) {
16837
16839
  throw new Error("paint is empty");
16838
16840
  }
16839
- let newPaint = __spreadValues$F({}, defaultPaint);
16841
+ let newPaint = __spreadValues$J({}, defaultPaint);
16840
16842
  if (isPaintCallback(paint)) {
16841
16843
  const getPaintFunction = (feature) => {
16842
16844
  const getPaint = preparePaint({
@@ -16893,41 +16895,41 @@ var NgwLeaflet = (function () {
16893
16895
  return newPaint;
16894
16896
  }
16895
16897
 
16896
- var __defProp$10 = Object.defineProperty;
16897
- var __defProps$s = Object.defineProperties;
16898
- var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
16899
- var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
16900
- var __hasOwnProp$F = Object.prototype.hasOwnProperty;
16901
- var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
16902
- var __defNormalProp$10 = (obj, key, value) => key in obj ? __defProp$10(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16903
- var __spreadValues$E = (a, b) => {
16898
+ var __defProp$11 = Object.defineProperty;
16899
+ var __defProps$u = Object.defineProperties;
16900
+ var __getOwnPropDescs$u = Object.getOwnPropertyDescriptors;
16901
+ var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
16902
+ var __hasOwnProp$J = Object.prototype.hasOwnProperty;
16903
+ var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
16904
+ var __defNormalProp$11 = (obj, key, value) => key in obj ? __defProp$11(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16905
+ var __spreadValues$I = (a, b) => {
16904
16906
  for (var prop in b || (b = {}))
16905
- if (__hasOwnProp$F.call(b, prop))
16906
- __defNormalProp$10(a, prop, b[prop]);
16907
- if (__getOwnPropSymbols$F)
16908
- for (var prop of __getOwnPropSymbols$F(b)) {
16909
- if (__propIsEnum$F.call(b, prop))
16910
- __defNormalProp$10(a, prop, b[prop]);
16907
+ if (__hasOwnProp$J.call(b, prop))
16908
+ __defNormalProp$11(a, prop, b[prop]);
16909
+ if (__getOwnPropSymbols$J)
16910
+ for (var prop of __getOwnPropSymbols$J(b)) {
16911
+ if (__propIsEnum$J.call(b, prop))
16912
+ __defNormalProp$11(a, prop, b[prop]);
16911
16913
  }
16912
16914
  return a;
16913
16915
  };
16914
- var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
16916
+ var __spreadProps$u = (a, b) => __defProps$u(a, __getOwnPropDescs$u(b));
16915
16917
  var __objRest$a = (source, exclude) => {
16916
16918
  var target = {};
16917
16919
  for (var prop in source)
16918
- if (__hasOwnProp$F.call(source, prop) && exclude.indexOf(prop) < 0)
16920
+ if (__hasOwnProp$J.call(source, prop) && exclude.indexOf(prop) < 0)
16919
16921
  target[prop] = source[prop];
16920
- if (source != null && __getOwnPropSymbols$F)
16921
- for (var prop of __getOwnPropSymbols$F(source)) {
16922
- if (exclude.indexOf(prop) < 0 && __propIsEnum$F.call(source, prop))
16922
+ if (source != null && __getOwnPropSymbols$J)
16923
+ for (var prop of __getOwnPropSymbols$J(source)) {
16924
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$J.call(source, prop))
16923
16925
  target[prop] = source[prop];
16924
16926
  }
16925
16927
  return target;
16926
16928
  };
16927
- var __publicField$J = (obj, key, value) => __defNormalProp$10(obj, key + "" , value);
16929
+ var __publicField$G = (obj, key, value) => __defNormalProp$11(obj, key + "" , value);
16928
16930
  class GeoJsonPaint {
16929
16931
  constructor(layer) {
16930
- __publicField$J(this, "layer");
16932
+ __publicField$G(this, "layer");
16931
16933
  this.layer = layer;
16932
16934
  }
16933
16935
  setPaintEachLayer(paint) {
@@ -17006,7 +17008,7 @@ var NgwLeaflet = (function () {
17006
17008
  if (html) {
17007
17009
  element.innerHTML = html;
17008
17010
  }
17009
- const divIcon = new leafletSrcExports.DivIcon(__spreadProps$s(__spreadValues$E({
17011
+ const divIcon = new leafletSrcExports.DivIcon(__spreadProps$u(__spreadValues$I({
17010
17012
  className: ""
17011
17013
  }, toLIconOpt), {
17012
17014
  html: element
@@ -17032,7 +17034,7 @@ var NgwLeaflet = (function () {
17032
17034
  }
17033
17035
  return (_, latlng) => {
17034
17036
  const p = PAINT;
17035
- return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$E(__spreadValues$E({}, p), icon)));
17037
+ return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$I(__spreadValues$I({}, p), icon)));
17036
17038
  };
17037
17039
  }
17038
17040
  createPaintOptions(paint) {
@@ -17054,26 +17056,26 @@ var NgwLeaflet = (function () {
17054
17056
  }
17055
17057
  }
17056
17058
 
17057
- var __defProp$$ = Object.defineProperty;
17058
- var __defProps$r = Object.defineProperties;
17059
- var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
17060
- var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
17061
- var __hasOwnProp$E = Object.prototype.hasOwnProperty;
17062
- var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
17063
- var __defNormalProp$$ = (obj, key, value) => key in obj ? __defProp$$(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17064
- var __spreadValues$D = (a, b) => {
17059
+ var __defProp$10 = Object.defineProperty;
17060
+ var __defProps$t = Object.defineProperties;
17061
+ var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
17062
+ var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
17063
+ var __hasOwnProp$I = Object.prototype.hasOwnProperty;
17064
+ var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
17065
+ var __defNormalProp$10 = (obj, key, value) => key in obj ? __defProp$10(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17066
+ var __spreadValues$H = (a, b) => {
17065
17067
  for (var prop in b || (b = {}))
17066
- if (__hasOwnProp$E.call(b, prop))
17067
- __defNormalProp$$(a, prop, b[prop]);
17068
- if (__getOwnPropSymbols$E)
17069
- for (var prop of __getOwnPropSymbols$E(b)) {
17070
- if (__propIsEnum$E.call(b, prop))
17071
- __defNormalProp$$(a, prop, b[prop]);
17068
+ if (__hasOwnProp$I.call(b, prop))
17069
+ __defNormalProp$10(a, prop, b[prop]);
17070
+ if (__getOwnPropSymbols$I)
17071
+ for (var prop of __getOwnPropSymbols$I(b)) {
17072
+ if (__propIsEnum$I.call(b, prop))
17073
+ __defNormalProp$10(a, prop, b[prop]);
17072
17074
  }
17073
17075
  return a;
17074
17076
  };
17075
- var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
17076
- var __publicField$I = (obj, key, value) => __defNormalProp$$(obj, typeof key !== "symbol" ? key + "" : key, value);
17077
+ var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
17078
+ var __publicField$F = (obj, key, value) => __defNormalProp$10(obj, typeof key !== "symbol" ? key + "" : key, value);
17077
17079
  var __async$x = (__this, __arguments, generator) => {
17078
17080
  return new Promise((resolve, reject) => {
17079
17081
  var fulfilled = (value) => {
@@ -17097,22 +17099,22 @@ var NgwLeaflet = (function () {
17097
17099
  class GeoJsonAdapter extends BaseAdapter {
17098
17100
  constructor(map, options) {
17099
17101
  super(map, options);
17100
- __publicField$I(this, "layer");
17101
- __publicField$I(this, "selected", false);
17102
- __publicField$I(this, "type");
17103
- __publicField$I(this, "_layers", []);
17104
- __publicField$I(this, "_events");
17105
- __publicField$I(this, "paint");
17106
- __publicField$I(this, "selectedPaint");
17107
- __publicField$I(this, "_selectedLayers", []);
17108
- __publicField$I(this, "_filteredLayers", []);
17109
- __publicField$I(this, "_filterFun");
17110
- __publicField$I(this, "_openedPopup", []);
17111
- __publicField$I(this, "_paint");
17112
- __publicField$I(this, "$updateTooltip", debounce(() => {
17102
+ __publicField$F(this, "layer");
17103
+ __publicField$F(this, "selected", false);
17104
+ __publicField$F(this, "type");
17105
+ __publicField$F(this, "_layers", []);
17106
+ __publicField$F(this, "_events");
17107
+ __publicField$F(this, "paint");
17108
+ __publicField$F(this, "selectedPaint");
17109
+ __publicField$F(this, "_selectedLayers", []);
17110
+ __publicField$F(this, "_filteredLayers", []);
17111
+ __publicField$F(this, "_filterFun");
17112
+ __publicField$F(this, "_openedPopup", []);
17113
+ __publicField$F(this, "_paint");
17114
+ __publicField$F(this, "$updateTooltip", debounce(() => {
17113
17115
  this.updateTooltip();
17114
17116
  }, 300));
17115
- __publicField$I(this, "$unselect", () => {
17117
+ __publicField$F(this, "$unselect", () => {
17116
17118
  this.unselect();
17117
17119
  });
17118
17120
  this._events = new GeoJsonEvents(this);
@@ -17121,7 +17123,7 @@ var NgwLeaflet = (function () {
17121
17123
  addLayer(options) {
17122
17124
  Object.assign(this.options, options);
17123
17125
  this.paint = options.paint;
17124
- this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$r(__spreadValues$D({}, options.nativeOptions), {
17126
+ this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$t(__spreadValues$H({}, options.nativeOptions), {
17125
17127
  pane: this.pane
17126
17128
  }));
17127
17129
  this.selectedPaint = options.selectedPaint;
@@ -17170,7 +17172,7 @@ var NgwLeaflet = (function () {
17170
17172
  }
17171
17173
  getSelected() {
17172
17174
  return this._selectedLayers.map((x) => {
17173
- return __spreadValues$D({
17175
+ return __spreadValues$H({
17174
17176
  target: this,
17175
17177
  feature: x.feature,
17176
17178
  layer: x
@@ -17189,14 +17191,14 @@ var NgwLeaflet = (function () {
17189
17191
  const filteredLayers = [];
17190
17192
  this._layers.forEach(({ feature, layer }) => {
17191
17193
  if (layer) {
17192
- const ok = fun ? fun(__spreadValues$D({
17194
+ const ok = fun ? fun(__spreadValues$H({
17193
17195
  target: this,
17194
17196
  feature,
17195
17197
  layer
17196
17198
  }, createFeaturePositionOptions(feature))) : true;
17197
17199
  if (ok) {
17198
17200
  layer_.addLayer(layer);
17199
- filteredLayers.push(__spreadValues$D({
17201
+ filteredLayers.push(__spreadValues$H({
17200
17202
  target: this,
17201
17203
  feature,
17202
17204
  layer
@@ -17217,7 +17219,7 @@ var NgwLeaflet = (function () {
17217
17219
  getLayers() {
17218
17220
  return this._layers.map(({ layer, feature }) => {
17219
17221
  const visible = layer && !!layer._map;
17220
- return __spreadValues$D({
17222
+ return __spreadValues$H({
17221
17223
  feature,
17222
17224
  layer,
17223
17225
  visible,
@@ -17251,6 +17253,9 @@ var NgwLeaflet = (function () {
17251
17253
  }
17252
17254
  setData(data) {
17253
17255
  this.clearLayer();
17256
+ if (!this.options.type) {
17257
+ this.type = void 0;
17258
+ }
17254
17259
  this.addData(data);
17255
17260
  }
17256
17261
  addData(data) {
@@ -17265,15 +17270,20 @@ var NgwLeaflet = (function () {
17265
17270
  } else {
17266
17271
  type = options.type;
17267
17272
  }
17273
+ if (!type) {
17274
+ return;
17275
+ }
17268
17276
  if (this.type && this.type !== type) {
17269
17277
  console.warn("no other data type than layer can be added");
17270
17278
  return;
17271
17279
  }
17272
17280
  this.type = type;
17273
17281
  data = filterGeometries(data, type);
17274
- if (data) {
17275
- geoJsonOptions = this._getGeoJsonOptions(options, type);
17282
+ if (!data) {
17283
+ console.warn("no other data type than layer can be added");
17284
+ return;
17276
17285
  }
17286
+ geoJsonOptions = this._getGeoJsonOptions(options, type);
17277
17287
  }
17278
17288
  new leafletSrcExports.GeoJSON(data || void 0, geoJsonOptions);
17279
17289
  }
@@ -17335,13 +17345,13 @@ var NgwLeaflet = (function () {
17335
17345
  }
17336
17346
  }
17337
17347
  updatePaint(paint) {
17338
- this.paint = __spreadValues$D(__spreadValues$D({}, this.paint), paint);
17348
+ this.paint = __spreadValues$H(__spreadValues$H({}, this.paint), paint);
17339
17349
  for (const l of this._layers) {
17340
17350
  this._paint.setPaint(l, this.paint);
17341
17351
  }
17342
17352
  }
17343
17353
  updateSelectedPaint(paint) {
17344
- this.selectedPaint = __spreadValues$D(__spreadValues$D({}, this.selectedPaint), paint);
17354
+ this.selectedPaint = __spreadValues$H(__spreadValues$H({}, this.selectedPaint), paint);
17345
17355
  for (const l of this._selectedLayers) {
17346
17356
  this._paint.setPaint(l, this.selectedPaint);
17347
17357
  }
@@ -17358,7 +17368,7 @@ var NgwLeaflet = (function () {
17358
17368
  if (feature.properties && labelField) {
17359
17369
  message = feature.properties[labelField];
17360
17370
  } else if (label) {
17361
- message = label(__spreadValues$D(__spreadValues$D({
17371
+ message = label(__spreadValues$H(__spreadValues$H({
17362
17372
  target: this
17363
17373
  }, layerDef), createFeaturePositionOptions(feature)));
17364
17374
  }
@@ -17377,7 +17387,7 @@ var NgwLeaflet = (function () {
17377
17387
  autoPan,
17378
17388
  maxWidth,
17379
17389
  closeButton: closeButton_
17380
- } = __spreadValues$D({
17390
+ } = __spreadValues$H({
17381
17391
  minWidth: 300
17382
17392
  }, options);
17383
17393
  const closeButton = closeButton_ != null ? closeButton_ : !this.options.selectOnHover;
@@ -17393,7 +17403,7 @@ var NgwLeaflet = (function () {
17393
17403
  };
17394
17404
  let content;
17395
17405
  if (options.createPopupContent) {
17396
- content = yield options.createPopupContent(__spreadValues$D({
17406
+ content = yield options.createPopupContent(__spreadValues$H({
17397
17407
  layer,
17398
17408
  feature,
17399
17409
  target: this,
@@ -17471,9 +17481,9 @@ var NgwLeaflet = (function () {
17471
17481
  lopt = {
17472
17482
  style: (feature) => {
17473
17483
  if (feature) {
17474
- return this._paint.preparePaint(__spreadValues$D(__spreadValues$D({}, PAINT), paint(feature)));
17484
+ return this._paint.preparePaint(__spreadValues$H(__spreadValues$H({}, PAINT), paint(feature)));
17475
17485
  } else {
17476
- return this._paint.preparePaint(__spreadProps$r(__spreadValues$D({}, PAINT), { type: "path" }));
17486
+ return this._paint.preparePaint(__spreadProps$t(__spreadValues$H({}, PAINT), { type: "path" }));
17477
17487
  }
17478
17488
  }
17479
17489
  };
@@ -17489,7 +17499,7 @@ var NgwLeaflet = (function () {
17489
17499
  _onEachFeature(feature, layer) {
17490
17500
  const layer_ = this.layer;
17491
17501
  if (layer_) {
17492
- const def = __spreadValues$D({
17502
+ const def = __spreadValues$H({
17493
17503
  target: this,
17494
17504
  feature,
17495
17505
  layer
@@ -17524,7 +17534,7 @@ var NgwLeaflet = (function () {
17524
17534
  setTimeout(() => {
17525
17535
  if (popup) {
17526
17536
  this._openPopup(
17527
- __spreadValues$D({
17537
+ __spreadValues$H({
17528
17538
  target: this,
17529
17539
  layer,
17530
17540
  feature
@@ -17542,7 +17552,7 @@ var NgwLeaflet = (function () {
17542
17552
  leafletSrcExports.DomEvent.stopPropagation(e);
17543
17553
  const layer = e.target;
17544
17554
  const feature = layer.feature;
17545
- const def = __spreadValues$D({
17555
+ const def = __spreadValues$H({
17546
17556
  target: this,
17547
17557
  layer,
17548
17558
  feature
@@ -17575,7 +17585,7 @@ var NgwLeaflet = (function () {
17575
17585
  }
17576
17586
  if (this.options.onSelect) {
17577
17587
  const features = def.feature ? [def.feature] : [];
17578
- this.options.onSelect(__spreadValues$D({
17588
+ this.options.onSelect(__spreadValues$H({
17579
17589
  type,
17580
17590
  layer: this,
17581
17591
  features
@@ -17764,19 +17774,19 @@ var NgwLeaflet = (function () {
17764
17774
  return buttonControl;
17765
17775
  }
17766
17776
 
17767
- var __defProp$_ = Object.defineProperty;
17768
- var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
17769
- var __hasOwnProp$D = Object.prototype.hasOwnProperty;
17770
- var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
17771
- var __defNormalProp$_ = (obj, key, value) => key in obj ? __defProp$_(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17772
- var __spreadValues$C = (a, b) => {
17777
+ var __defProp$$ = Object.defineProperty;
17778
+ var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
17779
+ var __hasOwnProp$H = Object.prototype.hasOwnProperty;
17780
+ var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
17781
+ var __defNormalProp$$ = (obj, key, value) => key in obj ? __defProp$$(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17782
+ var __spreadValues$G = (a, b) => {
17773
17783
  for (var prop in b || (b = {}))
17774
- if (__hasOwnProp$D.call(b, prop))
17775
- __defNormalProp$_(a, prop, b[prop]);
17776
- if (__getOwnPropSymbols$D)
17777
- for (var prop of __getOwnPropSymbols$D(b)) {
17778
- if (__propIsEnum$D.call(b, prop))
17779
- __defNormalProp$_(a, prop, b[prop]);
17784
+ if (__hasOwnProp$H.call(b, prop))
17785
+ __defNormalProp$$(a, prop, b[prop]);
17786
+ if (__getOwnPropSymbols$H)
17787
+ for (var prop of __getOwnPropSymbols$H(b)) {
17788
+ if (__propIsEnum$H.call(b, prop))
17789
+ __defNormalProp$$(a, prop, b[prop]);
17780
17790
  }
17781
17791
  return a;
17782
17792
  };
@@ -17787,12 +17797,12 @@ var NgwLeaflet = (function () {
17787
17797
  if (!request) {
17788
17798
  return void 0;
17789
17799
  }
17790
- const normalized = __spreadValues$C({}, request);
17800
+ const normalized = __spreadValues$G({}, request);
17791
17801
  return hasLayerRequestOptions(normalized) ? normalized : void 0;
17792
17802
  }
17793
17803
  function getLayerRequestOptions(options) {
17794
17804
  const request = options == null ? void 0 : options.request;
17795
- const headers = __spreadValues$C(__spreadValues$C({}, (options == null ? void 0 : options.headers) || {}), (request == null ? void 0 : request.headers) || {});
17805
+ const headers = __spreadValues$G(__spreadValues$G({}, (options == null ? void 0 : options.headers) || {}), (request == null ? void 0 : request.headers) || {});
17796
17806
  const result = {};
17797
17807
  if (hasHeaders(headers)) {
17798
17808
  result.headers = headers;
@@ -17871,95 +17881,95 @@ var NgwLeaflet = (function () {
17871
17881
  return opt;
17872
17882
  }
17873
17883
 
17874
- var __defProp$Z = Object.defineProperty;
17875
- var __defNormalProp$Z = (obj, key, value) => key in obj ? __defProp$Z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17876
- var __publicField$H = (obj, key, value) => __defNormalProp$Z(obj, typeof key !== "symbol" ? key + "" : key, value);
17884
+ var __defProp$_ = Object.defineProperty;
17885
+ var __defNormalProp$_ = (obj, key, value) => key in obj ? __defProp$_(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17886
+ var __publicField$E = (obj, key, value) => __defNormalProp$_(obj, typeof key !== "symbol" ? key + "" : key, value);
17877
17887
  class KeyCodes {
17878
17888
  constructor() {
17879
- __publicField$H(this, "backspace", 8);
17880
- __publicField$H(this, "tab", 9);
17881
- __publicField$H(this, "enter", 13);
17882
- __publicField$H(this, "shift", 16);
17883
- __publicField$H(this, "ctrl", 17);
17884
- __publicField$H(this, "alt", 18);
17885
- __publicField$H(this, "pause/break", 19);
17886
- __publicField$H(this, "caps_lock", 20);
17887
- __publicField$H(this, "escape", 27);
17888
- __publicField$H(this, "page_up", 33);
17889
- __publicField$H(this, "page_down", 34);
17890
- __publicField$H(this, "end", 35);
17891
- __publicField$H(this, "home", 36);
17892
- __publicField$H(this, "left_arrow", 37);
17893
- __publicField$H(this, "up_arrow", 38);
17894
- __publicField$H(this, "right_arrow", 39);
17895
- __publicField$H(this, "down_arrow", 40);
17896
- __publicField$H(this, "insert", 45);
17897
- __publicField$H(this, "delete", 46);
17898
- __publicField$H(this, "left_window_key", 91);
17899
- __publicField$H(this, "right_window_key", 92);
17900
- __publicField$H(this, "select_key", 93);
17901
- __publicField$H(this, "numpad_0", 96);
17902
- __publicField$H(this, "numpad_1", 97);
17903
- __publicField$H(this, "numpad_2", 98);
17904
- __publicField$H(this, "numpad_3", 99);
17905
- __publicField$H(this, "numpad_4", 100);
17906
- __publicField$H(this, "numpad_5", 101);
17907
- __publicField$H(this, "numpad_6", 102);
17908
- __publicField$H(this, "numpad_7", 103);
17909
- __publicField$H(this, "numpad_8", 104);
17910
- __publicField$H(this, "numpad_9", 105);
17911
- __publicField$H(this, "multiply", 106);
17912
- __publicField$H(this, "add", 107);
17913
- __publicField$H(this, "subtract", 109);
17914
- __publicField$H(this, "decimal_point", 110);
17915
- __publicField$H(this, "divide", 111);
17916
- __publicField$H(this, "f1", 112);
17917
- __publicField$H(this, "f2", 113);
17918
- __publicField$H(this, "f3", 114);
17919
- __publicField$H(this, "f4", 115);
17920
- __publicField$H(this, "f5", 116);
17921
- __publicField$H(this, "f6", 117);
17922
- __publicField$H(this, "f7", 118);
17923
- __publicField$H(this, "f8", 119);
17924
- __publicField$H(this, "f9", 120);
17925
- __publicField$H(this, "f10", 121);
17926
- __publicField$H(this, "f11", 122);
17927
- __publicField$H(this, "f12", 123);
17928
- __publicField$H(this, "num_lock", 144);
17929
- __publicField$H(this, "scroll_lock", 145);
17930
- __publicField$H(this, "semi-colon", 186);
17931
- __publicField$H(this, "equal_sign", 187);
17932
- __publicField$H(this, ",", 188);
17889
+ __publicField$E(this, "backspace", 8);
17890
+ __publicField$E(this, "tab", 9);
17891
+ __publicField$E(this, "enter", 13);
17892
+ __publicField$E(this, "shift", 16);
17893
+ __publicField$E(this, "ctrl", 17);
17894
+ __publicField$E(this, "alt", 18);
17895
+ __publicField$E(this, "pause/break", 19);
17896
+ __publicField$E(this, "caps_lock", 20);
17897
+ __publicField$E(this, "escape", 27);
17898
+ __publicField$E(this, "page_up", 33);
17899
+ __publicField$E(this, "page_down", 34);
17900
+ __publicField$E(this, "end", 35);
17901
+ __publicField$E(this, "home", 36);
17902
+ __publicField$E(this, "left_arrow", 37);
17903
+ __publicField$E(this, "up_arrow", 38);
17904
+ __publicField$E(this, "right_arrow", 39);
17905
+ __publicField$E(this, "down_arrow", 40);
17906
+ __publicField$E(this, "insert", 45);
17907
+ __publicField$E(this, "delete", 46);
17908
+ __publicField$E(this, "left_window_key", 91);
17909
+ __publicField$E(this, "right_window_key", 92);
17910
+ __publicField$E(this, "select_key", 93);
17911
+ __publicField$E(this, "numpad_0", 96);
17912
+ __publicField$E(this, "numpad_1", 97);
17913
+ __publicField$E(this, "numpad_2", 98);
17914
+ __publicField$E(this, "numpad_3", 99);
17915
+ __publicField$E(this, "numpad_4", 100);
17916
+ __publicField$E(this, "numpad_5", 101);
17917
+ __publicField$E(this, "numpad_6", 102);
17918
+ __publicField$E(this, "numpad_7", 103);
17919
+ __publicField$E(this, "numpad_8", 104);
17920
+ __publicField$E(this, "numpad_9", 105);
17921
+ __publicField$E(this, "multiply", 106);
17922
+ __publicField$E(this, "add", 107);
17923
+ __publicField$E(this, "subtract", 109);
17924
+ __publicField$E(this, "decimal_point", 110);
17925
+ __publicField$E(this, "divide", 111);
17926
+ __publicField$E(this, "f1", 112);
17927
+ __publicField$E(this, "f2", 113);
17928
+ __publicField$E(this, "f3", 114);
17929
+ __publicField$E(this, "f4", 115);
17930
+ __publicField$E(this, "f5", 116);
17931
+ __publicField$E(this, "f6", 117);
17932
+ __publicField$E(this, "f7", 118);
17933
+ __publicField$E(this, "f8", 119);
17934
+ __publicField$E(this, "f9", 120);
17935
+ __publicField$E(this, "f10", 121);
17936
+ __publicField$E(this, "f11", 122);
17937
+ __publicField$E(this, "f12", 123);
17938
+ __publicField$E(this, "num_lock", 144);
17939
+ __publicField$E(this, "scroll_lock", 145);
17940
+ __publicField$E(this, "semi-colon", 186);
17941
+ __publicField$E(this, "equal_sign", 187);
17942
+ __publicField$E(this, ",", 188);
17933
17943
  // "comma";
17934
- __publicField$H(this, "-", 189);
17944
+ __publicField$E(this, "-", 189);
17935
17945
  // "dash";
17936
- __publicField$H(this, ".", 190);
17946
+ __publicField$E(this, ".", 190);
17937
17947
  // "period";
17938
- __publicField$H(this, "/", 191);
17948
+ __publicField$E(this, "/", 191);
17939
17949
  // "forward slash";
17940
- __publicField$H(this, "`", 192);
17950
+ __publicField$E(this, "`", 192);
17941
17951
  // "grave accent";
17942
- __publicField$H(this, "[", 219);
17952
+ __publicField$E(this, "[", 219);
17943
17953
  // "open bracket";
17944
- __publicField$H(this, "\\", 220);
17954
+ __publicField$E(this, "\\", 220);
17945
17955
  // "back slash";
17946
- __publicField$H(this, "]", 221);
17956
+ __publicField$E(this, "]", 221);
17947
17957
  // "close braket";
17948
- __publicField$H(this, "'", 222);
17958
+ __publicField$E(this, "'", 222);
17949
17959
  }
17950
17960
  // "single quote"
17951
17961
  }
17952
17962
 
17953
- var __defProp$Y = Object.defineProperty;
17954
- var __defNormalProp$Y = (obj, key, value) => key in obj ? __defProp$Y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17955
- var __publicField$G = (obj, key, value) => __defNormalProp$Y(obj, typeof key !== "symbol" ? key + "" : key, value);
17963
+ var __defProp$Z = Object.defineProperty;
17964
+ var __defNormalProp$Z = (obj, key, value) => key in obj ? __defProp$Z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17965
+ var __publicField$D = (obj, key, value) => __defNormalProp$Z(obj, typeof key !== "symbol" ? key + "" : key, value);
17956
17966
  class Keys {
17957
17967
  constructor() {
17958
- __publicField$G(this, "keyCodeAlias", new KeyCodes());
17959
- __publicField$G(this, "keys", {});
17960
- __publicField$G(this, "_windowOnFocus");
17961
- __publicField$G(this, "_keysPressed");
17962
- __publicField$G(this, "_keysReleased");
17968
+ __publicField$D(this, "keyCodeAlias", new KeyCodes());
17969
+ __publicField$D(this, "keys", {});
17970
+ __publicField$D(this, "_windowOnFocus");
17971
+ __publicField$D(this, "_keysPressed");
17972
+ __publicField$D(this, "_keysReleased");
17963
17973
  this._windowOnFocus = this.windowOnFocus.bind(this);
17964
17974
  this._keysPressed = this.keysPressed.bind(this);
17965
17975
  this._keysReleased = this.keysReleased.bind(this);
@@ -17998,28 +18008,24 @@ var NgwLeaflet = (function () {
17998
18008
  }
17999
18009
  }
18000
18010
 
18001
- var __defProp$X = Object.defineProperty;
18002
- var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18003
- var __publicField$F = (obj, key, value) => __defNormalProp$X(obj, typeof key !== "symbol" ? key + "" : key, value);
18011
+ var __defProp$Y = Object.defineProperty;
18012
+ var __defNormalProp$Y = (obj, key, value) => key in obj ? __defProp$Y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18013
+ var __publicField$C = (obj, key, value) => __defNormalProp$Y(obj, typeof key !== "symbol" ? key + "" : key, value);
18004
18014
  class StateItem {
18005
18015
  constructor(webMap, opt) {
18006
- __publicField$F(this, "webMap", webMap);
18007
- __publicField$F(this, "name");
18008
- __publicField$F(this, "event");
18009
- __publicField$F(this, "value");
18016
+ __publicField$C(this, "webMap", webMap);
18017
+ __publicField$C(this, "name");
18018
+ __publicField$C(this, "event");
18019
+ __publicField$C(this, "value");
18010
18020
  if (opt) {
18011
- if (opt.value) {
18021
+ if (opt.value !== void 0) {
18012
18022
  this.setValue(opt.value);
18013
18023
  }
18014
18024
  if (opt.name) {
18015
18025
  this.name = opt.name;
18016
18026
  }
18017
18027
  if (opt.event) {
18018
- if (typeof opt.event === "string") {
18019
- this.event = [opt.event];
18020
- } else {
18021
- this.event = opt.event;
18022
- }
18028
+ this.event = Array.isArray(opt.event) ? opt.event : [opt.event];
18023
18029
  }
18024
18030
  }
18025
18031
  }
@@ -18031,14 +18037,28 @@ var NgwLeaflet = (function () {
18031
18037
  }
18032
18038
  }
18033
18039
 
18034
- var __defProp$W = Object.defineProperty;
18035
- var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18036
- var __publicField$E = (obj, key, value) => __defNormalProp$W(obj, typeof key !== "symbol" ? key + "" : key, value);
18040
+ var __defProp$X = Object.defineProperty;
18041
+ var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
18042
+ var __hasOwnProp$G = Object.prototype.hasOwnProperty;
18043
+ var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
18044
+ var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18045
+ var __spreadValues$F = (a, b) => {
18046
+ for (var prop in b || (b = {}))
18047
+ if (__hasOwnProp$G.call(b, prop))
18048
+ __defNormalProp$X(a, prop, b[prop]);
18049
+ if (__getOwnPropSymbols$G)
18050
+ for (var prop of __getOwnPropSymbols$G(b)) {
18051
+ if (__propIsEnum$G.call(b, prop))
18052
+ __defNormalProp$X(a, prop, b[prop]);
18053
+ }
18054
+ return a;
18055
+ };
18037
18056
  class BoundState extends StateItem {
18038
- constructor() {
18039
- super(...arguments);
18040
- __publicField$E(this, "name", "bounds");
18041
- __publicField$E(this, "event", ["moveend"]);
18057
+ constructor(webMap, opt) {
18058
+ super(webMap, __spreadValues$F({
18059
+ name: "bounds",
18060
+ event: "moveend"
18061
+ }, opt));
18042
18062
  }
18043
18063
  getValue() {
18044
18064
  return this.webMap.getBounds();
@@ -18059,14 +18079,28 @@ var NgwLeaflet = (function () {
18059
18079
  }
18060
18080
  }
18061
18081
 
18062
- var __defProp$V = Object.defineProperty;
18063
- var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18064
- var __publicField$D = (obj, key, value) => __defNormalProp$V(obj, typeof key !== "symbol" ? key + "" : key, value);
18082
+ var __defProp$W = Object.defineProperty;
18083
+ var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
18084
+ var __hasOwnProp$F = Object.prototype.hasOwnProperty;
18085
+ var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
18086
+ var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18087
+ var __spreadValues$E = (a, b) => {
18088
+ for (var prop in b || (b = {}))
18089
+ if (__hasOwnProp$F.call(b, prop))
18090
+ __defNormalProp$W(a, prop, b[prop]);
18091
+ if (__getOwnPropSymbols$F)
18092
+ for (var prop of __getOwnPropSymbols$F(b)) {
18093
+ if (__propIsEnum$F.call(b, prop))
18094
+ __defNormalProp$W(a, prop, b[prop]);
18095
+ }
18096
+ return a;
18097
+ };
18065
18098
  class CenterState extends StateItem {
18066
- constructor() {
18067
- super(...arguments);
18068
- __publicField$D(this, "name", "center");
18069
- __publicField$D(this, "event", ["moveend"]);
18099
+ constructor(webMap, opt) {
18100
+ super(webMap, __spreadValues$E({
18101
+ name: "center",
18102
+ event: "moveend"
18103
+ }, opt));
18070
18104
  }
18071
18105
  getValue() {
18072
18106
  return this.webMap.getCenter();
@@ -18088,14 +18122,28 @@ var NgwLeaflet = (function () {
18088
18122
  }
18089
18123
  }
18090
18124
 
18091
- var __defProp$U = Object.defineProperty;
18092
- var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18093
- var __publicField$C = (obj, key, value) => __defNormalProp$U(obj, typeof key !== "symbol" ? key + "" : key, value);
18125
+ var __defProp$V = Object.defineProperty;
18126
+ var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
18127
+ var __hasOwnProp$E = Object.prototype.hasOwnProperty;
18128
+ var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
18129
+ var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18130
+ var __spreadValues$D = (a, b) => {
18131
+ for (var prop in b || (b = {}))
18132
+ if (__hasOwnProp$E.call(b, prop))
18133
+ __defNormalProp$V(a, prop, b[prop]);
18134
+ if (__getOwnPropSymbols$E)
18135
+ for (var prop of __getOwnPropSymbols$E(b)) {
18136
+ if (__propIsEnum$E.call(b, prop))
18137
+ __defNormalProp$V(a, prop, b[prop]);
18138
+ }
18139
+ return a;
18140
+ };
18094
18141
  class ZoomState extends StateItem {
18095
- constructor() {
18096
- super(...arguments);
18097
- __publicField$C(this, "name", "zoom");
18098
- __publicField$C(this, "event", ["zoomend"]);
18142
+ constructor(webMap, opt) {
18143
+ super(webMap, __spreadValues$D({
18144
+ name: "zoom",
18145
+ event: "zoomend"
18146
+ }, opt));
18099
18147
  }
18100
18148
  getValue() {
18101
18149
  const zoom = this.webMap.getZoom();
@@ -18118,9 +18166,9 @@ var NgwLeaflet = (function () {
18118
18166
  }
18119
18167
  }
18120
18168
 
18121
- var __defProp$T = Object.defineProperty;
18122
- var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18123
- var __publicField$B = (obj, key, value) => __defNormalProp$T(obj, typeof key !== "symbol" ? key + "" : key, value);
18169
+ var __defProp$U = Object.defineProperty;
18170
+ var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18171
+ var __publicField$B = (obj, key, value) => __defNormalProp$U(obj, typeof key !== "symbol" ? key + "" : key, value);
18124
18172
  var __async$w = (__this, __arguments, generator) => {
18125
18173
  return new Promise((resolve, reject) => {
18126
18174
  var fulfilled = (value) => {
@@ -18267,9 +18315,12 @@ var NgwLeaflet = (function () {
18267
18315
  * @returns The map's container
18268
18316
  */
18269
18317
  getContainer() {
18270
- if (this.mapAdapter.getContainer) {
18271
- return this.mapAdapter.getContainer();
18272
- } else if (this.options.target) {
18318
+ var _a, _b;
18319
+ const nativeContainer = (_b = (_a = this.mapAdapter).getContainer) == null ? void 0 : _b.call(_a);
18320
+ if (nativeContainer) {
18321
+ return nativeContainer;
18322
+ }
18323
+ if (this.options.target) {
18273
18324
  if (this.options.target instanceof HTMLElement) {
18274
18325
  return this.options.target;
18275
18326
  } else if (typeof this.options.target === "string") {
@@ -18667,26 +18718,26 @@ var NgwLeaflet = (function () {
18667
18718
  __publicField$B(_WebMapMain, "getPaintFunctions");
18668
18719
  let WebMapMain = _WebMapMain;
18669
18720
 
18670
- var __defProp$S = Object.defineProperty;
18671
- var __defProps$q = Object.defineProperties;
18672
- var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
18673
- var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
18674
- var __hasOwnProp$C = Object.prototype.hasOwnProperty;
18675
- var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
18676
- var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18677
- var __spreadValues$B = (a, b) => {
18721
+ var __defProp$T = Object.defineProperty;
18722
+ var __defProps$s = Object.defineProperties;
18723
+ var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
18724
+ var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
18725
+ var __hasOwnProp$D = Object.prototype.hasOwnProperty;
18726
+ var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
18727
+ var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18728
+ var __spreadValues$C = (a, b) => {
18678
18729
  for (var prop in b || (b = {}))
18679
- if (__hasOwnProp$C.call(b, prop))
18680
- __defNormalProp$S(a, prop, b[prop]);
18681
- if (__getOwnPropSymbols$C)
18682
- for (var prop of __getOwnPropSymbols$C(b)) {
18683
- if (__propIsEnum$C.call(b, prop))
18684
- __defNormalProp$S(a, prop, b[prop]);
18730
+ if (__hasOwnProp$D.call(b, prop))
18731
+ __defNormalProp$T(a, prop, b[prop]);
18732
+ if (__getOwnPropSymbols$D)
18733
+ for (var prop of __getOwnPropSymbols$D(b)) {
18734
+ if (__propIsEnum$D.call(b, prop))
18735
+ __defNormalProp$T(a, prop, b[prop]);
18685
18736
  }
18686
18737
  return a;
18687
18738
  };
18688
- var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
18689
- var __publicField$A = (obj, key, value) => __defNormalProp$S(obj, typeof key !== "symbol" ? key + "" : key, value);
18739
+ var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
18740
+ var __publicField$A = (obj, key, value) => __defNormalProp$T(obj, typeof key !== "symbol" ? key + "" : key, value);
18690
18741
  var __async$v = (__this, __arguments, generator) => {
18691
18742
  return new Promise((resolve, reject) => {
18692
18743
  var fulfilled = (value) => {
@@ -18716,6 +18767,8 @@ var NgwLeaflet = (function () {
18716
18767
  __publicField$A(this, "_baselayers", []);
18717
18768
  __publicField$A(this, "_layers", {});
18718
18769
  __publicField$A(this, "_selectedLayers", []);
18770
+ // true means a layer was removed before its addLayer() completed.
18771
+ __publicField$A(this, "_pendingLayerAdds", /* @__PURE__ */ new WeakMap());
18719
18772
  const tileJson = this.options.tileJson;
18720
18773
  if (tileJson) {
18721
18774
  this.emitter.once("build-map", () => this.addTileJsonLayer(tileJson));
@@ -18822,7 +18875,7 @@ var NgwLeaflet = (function () {
18822
18875
  return __async$v(this, null, function* () {
18823
18876
  const layer = yield this.addLayer(
18824
18877
  adapter,
18825
- __spreadProps$q(__spreadValues$B({}, options), {
18878
+ __spreadProps$s(__spreadValues$C({}, options), {
18826
18879
  baselayer: true
18827
18880
  }),
18828
18881
  void 0
@@ -18859,7 +18912,7 @@ var NgwLeaflet = (function () {
18859
18912
  }
18860
18913
  const geoJsonOptions = options;
18861
18914
  this._updateGeoJsonOptions(geoJsonOptions);
18862
- options = __spreadValues$B({
18915
+ options = __spreadValues$C({
18863
18916
  id: String(id),
18864
18917
  order: _order
18865
18918
  }, options);
@@ -18887,12 +18940,12 @@ var NgwLeaflet = (function () {
18887
18940
  }
18888
18941
  }
18889
18942
  }
18890
- options = __spreadProps$q(__spreadValues$B({}, options), {
18943
+ options = __spreadProps$s(__spreadValues$C({}, options), {
18891
18944
  request: this._getLayerRequestOptions(options)
18892
18945
  });
18893
18946
  if (adapterEngine !== void 0) {
18894
18947
  const _adapter = new adapterEngine(this.mapAdapter.map, options);
18895
- _adapter.options = __spreadValues$B(__spreadValues$B({}, options), _adapter.options);
18948
+ _adapter.options = __spreadValues$C(__spreadValues$C({}, options), _adapter.options);
18896
18949
  if (_adapter.options.baselayer && _adapter.options.toplayer) {
18897
18950
  throw new Error("Layer cannot be both baselayer and toplayer");
18898
18951
  }
@@ -18908,54 +18961,93 @@ var NgwLeaflet = (function () {
18908
18961
  let layerId;
18909
18962
  if (_adapter.options.id) {
18910
18963
  layerId = String(_adapter.options.id);
18964
+ if (layerId && this._layers[layerId]) {
18965
+ throw new Error(`layer with id '${layerId}' already exist`);
18966
+ }
18911
18967
  this._layers[layerId] = _adapter;
18912
18968
  }
18913
- this._emitLayerEvent("layer:preadd", layerId || "", _adapter);
18914
- yield this.onMapLoad();
18915
- _adapter.map = this.mapAdapter.map;
18916
- const layer = yield _adapter.addLayer(_adapter.options);
18917
- _adapter.layer = layer;
18918
- _adapter.id = _adapter.options.id || String(id);
18919
- _adapter.options.id = _adapter.id;
18920
- if (options.baselayer) {
18921
- _adapter.options.order = 0;
18922
- }
18923
- _adapter.order = (_b = _adapter.options.order) != null ? _b : _order;
18924
- if (layerId) {
18925
- delete this._layers[layerId];
18926
- }
18927
- layerId = String(_adapter.id);
18928
- if (this._layers[layerId]) {
18929
- throw Error(`layer with id '${layerId}' already exist`);
18930
- }
18931
- if (layerId) {
18932
- this._layers[layerId] = _adapter;
18933
- if (geoJsonOptions.filter) {
18934
- this.filterLayer(_adapter, geoJsonOptions.filter);
18969
+ this._pendingLayerAdds.set(_adapter, false);
18970
+ let nativeStarted = false;
18971
+ const cancelled = () => this._pendingLayerAdds.get(_adapter) === true;
18972
+ try {
18973
+ this._emitLayerEvent("layer:preadd", layerId || "", _adapter);
18974
+ yield this.onMapLoad();
18975
+ if (cancelled()) {
18976
+ return _adapter;
18977
+ }
18978
+ _adapter.map = this.mapAdapter.map;
18979
+ nativeStarted = true;
18980
+ const layer = yield _adapter.addLayer(_adapter.options);
18981
+ _adapter.layer = layer;
18982
+ if (cancelled()) {
18983
+ return _adapter;
18935
18984
  }
18985
+ _adapter.id = _adapter.options.id || String(id);
18986
+ _adapter.options.id = _adapter.id;
18936
18987
  if (options.baselayer) {
18937
- this._baselayers.push(layerId);
18988
+ _adapter.options.order = 0;
18938
18989
  }
18939
- if (visibility) {
18940
- yield this.showLayer(layerId);
18990
+ _adapter.order = (_b = _adapter.options.order) != null ? _b : _order;
18991
+ if (layerId && this._layers[layerId] === _adapter) {
18992
+ delete this._layers[layerId];
18941
18993
  }
18942
- }
18943
- const opacity = options.opacity;
18944
- if (opacity !== void 0 && opacity !== null && opacity <= 1) {
18945
- this.setLayerOpacity(_adapter, opacity);
18946
- }
18947
- const getBounds = layer && (_adapter.getBounds || _adapter.getExtent);
18948
- if (options.fit && getBounds) {
18949
- const extent = yield getBounds.call(_adapter);
18950
- if (extent) {
18951
- yield this.fitBounds(extent);
18994
+ layerId = String(_adapter.id);
18995
+ if (this._layers[layerId]) {
18996
+ throw Error(`layer with id '${layerId}' already exist`);
18997
+ }
18998
+ if (layerId) {
18999
+ this._layers[layerId] = _adapter;
19000
+ if (geoJsonOptions.filter) {
19001
+ this.filterLayer(_adapter, geoJsonOptions.filter);
19002
+ }
19003
+ if (options.baselayer) {
19004
+ this._baselayers.push(layerId);
19005
+ }
19006
+ if (visibility) {
19007
+ yield this.showLayer(layerId);
19008
+ if (cancelled()) return _adapter;
19009
+ }
19010
+ }
19011
+ const opacity = options.opacity;
19012
+ if (opacity !== void 0 && opacity !== null && opacity <= 1) {
19013
+ this.setLayerOpacity(_adapter, opacity);
19014
+ }
19015
+ const getBounds = layer && (_adapter.getBounds || _adapter.getExtent);
19016
+ if (options.fit && getBounds) {
19017
+ const extent = yield getBounds.call(_adapter);
19018
+ if (cancelled()) {
19019
+ return _adapter;
19020
+ }
19021
+ if (extent) {
19022
+ yield this.fitBounds(extent);
19023
+ }
19024
+ }
19025
+ if (cancelled()) {
19026
+ return _adapter;
19027
+ }
19028
+ if (options.onAdded) {
19029
+ options.onAdded(_adapter);
19030
+ }
19031
+ if (!cancelled()) {
19032
+ this._emitLayerEvent("layer:add", layerId, _adapter);
19033
+ }
19034
+ return _adapter;
19035
+ } catch (error) {
19036
+ if (cancelled()) {
19037
+ return _adapter;
19038
+ }
19039
+ this.removeLayer(_adapter);
19040
+ throw error;
19041
+ } finally {
19042
+ const removed = cancelled();
19043
+ this._pendingLayerAdds.delete(_adapter);
19044
+ if (removed && nativeStarted) {
19045
+ if (_adapter.removeLayer) {
19046
+ _adapter.removeLayer();
19047
+ } else if (_adapter.layer !== void 0)
19048
+ this.mapAdapter.removeLayer(_adapter.layer);
18952
19049
  }
18953
19050
  }
18954
- if (options.onAdded) {
18955
- options.onAdded(_adapter);
18956
- }
18957
- this._emitLayerEvent("layer:add", layerId, _adapter);
18958
- return _adapter;
18959
19051
  }
18960
19052
  return Promise.reject("No adapter");
18961
19053
  });
@@ -19016,21 +19108,23 @@ var NgwLeaflet = (function () {
19016
19108
  * Remove specific layer from map and memory by its definition.
19017
19109
  */
19018
19110
  removeLayer(layerDef) {
19111
+ var _a;
19019
19112
  const layer = this.getLayer(layerDef);
19020
19113
  const layerId = layer && this.getLayerId(layer);
19021
- if (layer && layerId) {
19114
+ if (layer && layerId && this._layers[layerId] === layer) {
19022
19115
  this.emitter.emit("layer:preremove", layer);
19023
- if (layer.beforeRemove) {
19024
- layer.beforeRemove();
19025
- }
19026
- if (layer.removeLayer) {
19027
- layer.removeLayer();
19116
+ (_a = layer.beforeRemove) == null ? void 0 : _a.call(layer);
19117
+ if (this._pendingLayerAdds.has(layer)) {
19118
+ this._pendingLayerAdds.set(layer, true);
19028
19119
  } else {
19029
- this.mapAdapter.removeLayer(layer.layer);
19120
+ if (layer.removeLayer) {
19121
+ layer.removeLayer();
19122
+ } else if (layer.layer !== void 0)
19123
+ this.mapAdapter.removeLayer(layer.layer);
19030
19124
  }
19031
19125
  if (layer.options && layer.options.baselayer) {
19032
19126
  const index = this._baselayers.indexOf(layerId);
19033
- if (index) {
19127
+ if (index !== -1) {
19034
19128
  this._baselayers.splice(index, 1);
19035
19129
  }
19036
19130
  }
@@ -19086,7 +19180,7 @@ var NgwLeaflet = (function () {
19086
19180
  }
19087
19181
  /** Shortcut for {@link WebMapLayers.addLayer} to create TileLayer adapter */
19088
19182
  addTileLayer(url, options = {}) {
19089
- return this.addLayer("TILE", __spreadProps$q(__spreadValues$B({}, options), { url }));
19183
+ return this.addLayer("TILE", __spreadProps$s(__spreadValues$C({}, options), { url }));
19090
19184
  }
19091
19185
  addImageLayer(urlOrOptions, options) {
19092
19186
  let url;
@@ -19096,7 +19190,7 @@ var NgwLeaflet = (function () {
19096
19190
  url = urlOrOptions.url;
19097
19191
  options = urlOrOptions;
19098
19192
  }
19099
- return this.addLayer("IMAGE", __spreadProps$q(__spreadValues$B({}, options), { url }));
19193
+ return this.addLayer("IMAGE", __spreadProps$s(__spreadValues$C({}, options), { url }));
19100
19194
  }
19101
19195
  /**
19102
19196
  * Show added layer on the map by it definition.
@@ -19168,7 +19262,10 @@ var NgwLeaflet = (function () {
19168
19262
  }
19169
19263
  });
19170
19264
  if (layer) {
19171
- return this.onMapLoad().then(() => action(layer));
19265
+ return this.onMapLoad().then(() => {
19266
+ if (this._layers[String(layer.id)] !== layer) return;
19267
+ return action(layer);
19268
+ });
19172
19269
  }
19173
19270
  return Promise.resolve();
19174
19271
  }
@@ -19482,10 +19579,10 @@ var NgwLeaflet = (function () {
19482
19579
  this.options.layerRequest
19483
19580
  );
19484
19581
  const layerRequest = getLayerRequestOptions(options);
19485
- const headers = __spreadValues$B(__spreadValues$B({}, (defaultRequest == null ? void 0 : defaultRequest.headers) || {}), (layerRequest == null ? void 0 : layerRequest.headers) || {});
19582
+ const headers = __spreadValues$C(__spreadValues$C({}, (defaultRequest == null ? void 0 : defaultRequest.headers) || {}), (layerRequest == null ? void 0 : layerRequest.headers) || {});
19486
19583
  const credentials = options.withCredentials === false && ((_a = options.request) == null ? void 0 : _a.credentials) === void 0 && (defaultRequest == null ? void 0 : defaultRequest.credentials) !== void 0 ? "same-origin" : (_b = layerRequest == null ? void 0 : layerRequest.credentials) != null ? _b : defaultRequest == null ? void 0 : defaultRequest.credentials;
19487
19584
  const cache = ((_c = options.request) == null ? void 0 : _c.cache) !== void 0 ? options.request.cache : (_d = layerRequest == null ? void 0 : layerRequest.cache) != null ? _d : defaultRequest == null ? void 0 : defaultRequest.cache;
19488
- return normalizeLayerRequestOptions(__spreadValues$B(__spreadValues$B(__spreadValues$B(__spreadValues$B(__spreadValues$B({}, defaultRequest), layerRequest), Object.keys(headers).length ? { headers } : {}), credentials !== void 0 ? { credentials } : {}), cache !== void 0 ? { cache } : {}));
19585
+ return normalizeLayerRequestOptions(__spreadValues$C(__spreadValues$C(__spreadValues$C(__spreadValues$C(__spreadValues$C({}, defaultRequest), layerRequest), Object.keys(headers).length ? { headers } : {}), credentials !== void 0 ? { credentials } : {}), cache !== void 0 ? { cache } : {}));
19489
19586
  }
19490
19587
  /** @internal */
19491
19588
  _emitLayerEvent(name, id, options) {
@@ -19580,24 +19677,24 @@ var NgwLeaflet = (function () {
19580
19677
  }
19581
19678
  }
19582
19679
 
19583
- var __defProp$R = Object.defineProperty;
19584
- var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
19585
- var __hasOwnProp$B = Object.prototype.hasOwnProperty;
19586
- var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
19587
- var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19680
+ var __defProp$S = Object.defineProperty;
19681
+ var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
19682
+ var __hasOwnProp$C = Object.prototype.hasOwnProperty;
19683
+ var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
19684
+ var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19588
19685
  var __objRest$9 = (source, exclude) => {
19589
19686
  var target = {};
19590
19687
  for (var prop in source)
19591
- if (__hasOwnProp$B.call(source, prop) && exclude.indexOf(prop) < 0)
19688
+ if (__hasOwnProp$C.call(source, prop) && exclude.indexOf(prop) < 0)
19592
19689
  target[prop] = source[prop];
19593
- if (source != null && __getOwnPropSymbols$B)
19594
- for (var prop of __getOwnPropSymbols$B(source)) {
19595
- if (exclude.indexOf(prop) < 0 && __propIsEnum$B.call(source, prop))
19690
+ if (source != null && __getOwnPropSymbols$C)
19691
+ for (var prop of __getOwnPropSymbols$C(source)) {
19692
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$C.call(source, prop))
19596
19693
  target[prop] = source[prop];
19597
19694
  }
19598
19695
  return target;
19599
19696
  };
19600
- var __publicField$z = (obj, key, value) => __defNormalProp$R(obj, typeof key !== "symbol" ? key + "" : key, value);
19697
+ var __publicField$z = (obj, key, value) => __defNormalProp$S(obj, typeof key !== "symbol" ? key + "" : key, value);
19601
19698
  var __async$u = (__this, __arguments, generator) => {
19602
19699
  return new Promise((resolve, reject) => {
19603
19700
  var fulfilled = (value) => {
@@ -19805,34 +19902,34 @@ var NgwLeaflet = (function () {
19805
19902
  });
19806
19903
  let WebMapControls = _WebMapControls;
19807
19904
 
19808
- var __defProp$Q = Object.defineProperty;
19809
- var __defProps$p = Object.defineProperties;
19810
- var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
19811
- var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
19812
- var __hasOwnProp$A = Object.prototype.hasOwnProperty;
19813
- var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
19905
+ var __defProp$R = Object.defineProperty;
19906
+ var __defProps$r = Object.defineProperties;
19907
+ var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
19908
+ var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
19909
+ var __hasOwnProp$B = Object.prototype.hasOwnProperty;
19910
+ var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
19814
19911
  var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
19815
- var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19816
- var __spreadValues$A = (a, b) => {
19912
+ var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19913
+ var __spreadValues$B = (a, b) => {
19817
19914
  for (var prop in b || (b = {}))
19818
- if (__hasOwnProp$A.call(b, prop))
19819
- __defNormalProp$Q(a, prop, b[prop]);
19820
- if (__getOwnPropSymbols$A)
19821
- for (var prop of __getOwnPropSymbols$A(b)) {
19822
- if (__propIsEnum$A.call(b, prop))
19823
- __defNormalProp$Q(a, prop, b[prop]);
19915
+ if (__hasOwnProp$B.call(b, prop))
19916
+ __defNormalProp$R(a, prop, b[prop]);
19917
+ if (__getOwnPropSymbols$B)
19918
+ for (var prop of __getOwnPropSymbols$B(b)) {
19919
+ if (__propIsEnum$B.call(b, prop))
19920
+ __defNormalProp$R(a, prop, b[prop]);
19824
19921
  }
19825
19922
  return a;
19826
19923
  };
19827
- var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
19924
+ var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
19828
19925
  var __objRest$8 = (source, exclude) => {
19829
19926
  var target = {};
19830
19927
  for (var prop in source)
19831
- if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
19928
+ if (__hasOwnProp$B.call(source, prop) && exclude.indexOf(prop) < 0)
19832
19929
  target[prop] = source[prop];
19833
- if (source != null && __getOwnPropSymbols$A)
19834
- for (var prop of __getOwnPropSymbols$A(source)) {
19835
- if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
19930
+ if (source != null && __getOwnPropSymbols$B)
19931
+ for (var prop of __getOwnPropSymbols$B(source)) {
19932
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$B.call(source, prop))
19836
19933
  target[prop] = source[prop];
19837
19934
  }
19838
19935
  return target;
@@ -19953,7 +20050,7 @@ var NgwLeaflet = (function () {
19953
20050
  }
19954
20051
  }
19955
20052
  const _a = controlOptions, { id, order, position } = _a, options = __objRest$8(_a, ["id", "order", "position"]);
19956
- this.addControl(controlAdapterName, position || "top-left", __spreadProps$p(__spreadValues$A({}, options), {
20053
+ this.addControl(controlAdapterName, position || "top-left", __spreadProps$r(__spreadValues$B({}, options), {
19957
20054
  id,
19958
20055
  order
19959
20056
  }));
@@ -20005,9 +20102,9 @@ var NgwLeaflet = (function () {
20005
20102
  return [promise, abortFunc];
20006
20103
  }
20007
20104
 
20008
- var __defProp$P = Object.defineProperty;
20009
- var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20010
- var __publicField$y = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
20105
+ var __defProp$Q = Object.defineProperty;
20106
+ var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20107
+ var __publicField$y = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
20011
20108
  class Queue {
20012
20109
  /**
20013
20110
  * @param {PromiseQueueOptions} options - Configuration options for the queue.
@@ -20226,9 +20323,9 @@ var NgwLeaflet = (function () {
20226
20323
 
20227
20324
  const imageQueue = new Queue({ limit: 6, debounce: 150 });
20228
20325
 
20229
- var __defProp$O = Object.defineProperty;
20230
- var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20231
- var __publicField$x = (obj, key, value) => __defNormalProp$O(obj, key + "" , value);
20326
+ var __defProp$P = Object.defineProperty;
20327
+ var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20328
+ var __publicField$x = (obj, key, value) => __defNormalProp$P(obj, key + "" , value);
20232
20329
  const transparentImage = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEAAAAALAAAAAABAAEAAAIBAAA=";
20233
20330
  class ImageOverlay extends leafletSrcExports.ImageOverlay {
20234
20331
  constructor(imageUrl, bounds, options) {
@@ -20272,9 +20369,9 @@ var NgwLeaflet = (function () {
20272
20369
  }
20273
20370
  }
20274
20371
 
20275
- var __defProp$N = Object.defineProperty;
20276
- var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20277
- var __publicField$w = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
20372
+ var __defProp$O = Object.defineProperty;
20373
+ var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20374
+ var __publicField$w = (obj, key, value) => __defNormalProp$O(obj, typeof key !== "symbol" ? key + "" : key, value);
20278
20375
  class ImageLayer extends leafletSrcExports.Layer {
20279
20376
  constructor(url, options) {
20280
20377
  super(options);
@@ -20472,26 +20569,26 @@ var NgwLeaflet = (function () {
20472
20569
  }
20473
20570
  }
20474
20571
 
20475
- var __defProp$M = Object.defineProperty;
20476
- var __defProps$o = Object.defineProperties;
20477
- var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
20478
- var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
20479
- var __hasOwnProp$z = Object.prototype.hasOwnProperty;
20480
- var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
20481
- var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20482
- var __spreadValues$z = (a, b) => {
20572
+ var __defProp$N = Object.defineProperty;
20573
+ var __defProps$q = Object.defineProperties;
20574
+ var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
20575
+ var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
20576
+ var __hasOwnProp$A = Object.prototype.hasOwnProperty;
20577
+ var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
20578
+ var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20579
+ var __spreadValues$A = (a, b) => {
20483
20580
  for (var prop in b || (b = {}))
20484
- if (__hasOwnProp$z.call(b, prop))
20485
- __defNormalProp$M(a, prop, b[prop]);
20486
- if (__getOwnPropSymbols$z)
20487
- for (var prop of __getOwnPropSymbols$z(b)) {
20488
- if (__propIsEnum$z.call(b, prop))
20489
- __defNormalProp$M(a, prop, b[prop]);
20581
+ if (__hasOwnProp$A.call(b, prop))
20582
+ __defNormalProp$N(a, prop, b[prop]);
20583
+ if (__getOwnPropSymbols$A)
20584
+ for (var prop of __getOwnPropSymbols$A(b)) {
20585
+ if (__propIsEnum$A.call(b, prop))
20586
+ __defNormalProp$N(a, prop, b[prop]);
20490
20587
  }
20491
20588
  return a;
20492
20589
  };
20493
- var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
20494
- var __publicField$v = (obj, key, value) => __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
20590
+ var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
20591
+ var __publicField$v = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
20495
20592
  class ImageAdapter extends BaseAdapter {
20496
20593
  constructor() {
20497
20594
  super(...arguments);
@@ -20503,10 +20600,10 @@ var NgwLeaflet = (function () {
20503
20600
  if (url) {
20504
20601
  const updateWmsParamsFromOpt = options.updateWmsParams;
20505
20602
  const request = getLayerRequestOptions(options);
20506
- this.layer = new ImageLayer(url, __spreadProps$o(__spreadValues$z(__spreadValues$z(__spreadValues$z({
20603
+ this.layer = new ImageLayer(url, __spreadProps$q(__spreadValues$A(__spreadValues$A(__spreadValues$A({
20507
20604
  pane: this.pane,
20508
20605
  setViewDelay: options.setViewDelay
20509
- }, __spreadProps$o(__spreadValues$z({
20606
+ }, __spreadProps$q(__spreadValues$A({
20510
20607
  transparent: true
20511
20608
  }, options), {
20512
20609
  opacity: (_a = options.opacity) != null ? _a : void 0
@@ -20594,33 +20691,33 @@ var NgwLeaflet = (function () {
20594
20691
  }
20595
20692
  const TileLayer = makeRemote(TileLayerBase);
20596
20693
 
20597
- var __defProp$L = Object.defineProperty;
20598
- var __defProps$n = Object.defineProperties;
20599
- var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
20600
- var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
20601
- var __hasOwnProp$y = Object.prototype.hasOwnProperty;
20602
- var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
20603
- var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20604
- var __spreadValues$y = (a, b) => {
20694
+ var __defProp$M = Object.defineProperty;
20695
+ var __defProps$p = Object.defineProperties;
20696
+ var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
20697
+ var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
20698
+ var __hasOwnProp$z = Object.prototype.hasOwnProperty;
20699
+ var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
20700
+ var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20701
+ var __spreadValues$z = (a, b) => {
20605
20702
  for (var prop in b || (b = {}))
20606
- if (__hasOwnProp$y.call(b, prop))
20607
- __defNormalProp$L(a, prop, b[prop]);
20608
- if (__getOwnPropSymbols$y)
20609
- for (var prop of __getOwnPropSymbols$y(b)) {
20610
- if (__propIsEnum$y.call(b, prop))
20611
- __defNormalProp$L(a, prop, b[prop]);
20703
+ if (__hasOwnProp$z.call(b, prop))
20704
+ __defNormalProp$M(a, prop, b[prop]);
20705
+ if (__getOwnPropSymbols$z)
20706
+ for (var prop of __getOwnPropSymbols$z(b)) {
20707
+ if (__propIsEnum$z.call(b, prop))
20708
+ __defNormalProp$M(a, prop, b[prop]);
20612
20709
  }
20613
20710
  return a;
20614
20711
  };
20615
- var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
20712
+ var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
20616
20713
  var __objRest$7 = (source, exclude) => {
20617
20714
  var target = {};
20618
20715
  for (var prop in source)
20619
- if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
20716
+ if (__hasOwnProp$z.call(source, prop) && exclude.indexOf(prop) < 0)
20620
20717
  target[prop] = source[prop];
20621
- if (source != null && __getOwnPropSymbols$y)
20622
- for (var prop of __getOwnPropSymbols$y(source)) {
20623
- if (exclude.indexOf(prop) < 0 && __propIsEnum$y.call(source, prop))
20718
+ if (source != null && __getOwnPropSymbols$z)
20719
+ for (var prop of __getOwnPropSymbols$z(source)) {
20720
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$z.call(source, prop))
20624
20721
  target[prop] = source[prop];
20625
20722
  }
20626
20723
  return target;
@@ -20631,7 +20728,7 @@ var NgwLeaflet = (function () {
20631
20728
  if (options) {
20632
20729
  const _a = options, { url } = _a, opt = __objRest$7(_a, ["url"]);
20633
20730
  if (url) {
20634
- const tileLayerOptions = __spreadValues$y({
20731
+ const tileLayerOptions = __spreadValues$z({
20635
20732
  pane: this.pane,
20636
20733
  attribution: opt.attribution,
20637
20734
  minZoom: opt.minZoom,
@@ -20643,7 +20740,7 @@ var NgwLeaflet = (function () {
20643
20740
  let layer;
20644
20741
  const request = getLayerRequestOptions(opt);
20645
20742
  if (request) {
20646
- layer = new TileLayer(url, __spreadProps$n(__spreadValues$y({}, tileLayerOptions), {
20743
+ layer = new TileLayer(url, __spreadProps$p(__spreadValues$z({}, tileLayerOptions), {
20647
20744
  request,
20648
20745
  setViewDelay: opt.setViewDelay
20649
20746
  }));
@@ -20665,29 +20762,29 @@ var NgwLeaflet = (function () {
20665
20762
  }
20666
20763
  }
20667
20764
 
20668
- var __defProp$K = Object.defineProperty;
20669
- var __defProps$m = Object.defineProperties;
20670
- var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
20671
- var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
20672
- var __hasOwnProp$x = Object.prototype.hasOwnProperty;
20673
- var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
20674
- var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20675
- var __spreadValues$x = (a, b) => {
20765
+ var __defProp$L = Object.defineProperty;
20766
+ var __defProps$o = Object.defineProperties;
20767
+ var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
20768
+ var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
20769
+ var __hasOwnProp$y = Object.prototype.hasOwnProperty;
20770
+ var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
20771
+ var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20772
+ var __spreadValues$y = (a, b) => {
20676
20773
  for (var prop in b || (b = {}))
20677
- if (__hasOwnProp$x.call(b, prop))
20678
- __defNormalProp$K(a, prop, b[prop]);
20679
- if (__getOwnPropSymbols$x)
20680
- for (var prop of __getOwnPropSymbols$x(b)) {
20681
- if (__propIsEnum$x.call(b, prop))
20682
- __defNormalProp$K(a, prop, b[prop]);
20774
+ if (__hasOwnProp$y.call(b, prop))
20775
+ __defNormalProp$L(a, prop, b[prop]);
20776
+ if (__getOwnPropSymbols$y)
20777
+ for (var prop of __getOwnPropSymbols$y(b)) {
20778
+ if (__propIsEnum$y.call(b, prop))
20779
+ __defNormalProp$L(a, prop, b[prop]);
20683
20780
  }
20684
20781
  return a;
20685
20782
  };
20686
- var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
20783
+ var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
20687
20784
  class OsmAdapter extends TileAdapter {
20688
20785
  addLayer(options) {
20689
20786
  const url = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
20690
- return super.addLayer(__spreadProps$m(__spreadValues$x({
20787
+ return super.addLayer(__spreadProps$o(__spreadValues$y({
20691
20788
  name: "OpenStreetMap",
20692
20789
  attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
20693
20790
  }, options), {
@@ -20703,33 +20800,33 @@ var NgwLeaflet = (function () {
20703
20800
  }
20704
20801
  const WmsLayer = makeRemote(WmsLayerBase);
20705
20802
 
20706
- var __defProp$J = Object.defineProperty;
20707
- var __defProps$l = Object.defineProperties;
20708
- var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
20709
- var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
20710
- var __hasOwnProp$w = Object.prototype.hasOwnProperty;
20711
- var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
20712
- var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20713
- var __spreadValues$w = (a, b) => {
20803
+ var __defProp$K = Object.defineProperty;
20804
+ var __defProps$n = Object.defineProperties;
20805
+ var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
20806
+ var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
20807
+ var __hasOwnProp$x = Object.prototype.hasOwnProperty;
20808
+ var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
20809
+ var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20810
+ var __spreadValues$x = (a, b) => {
20714
20811
  for (var prop in b || (b = {}))
20715
- if (__hasOwnProp$w.call(b, prop))
20716
- __defNormalProp$J(a, prop, b[prop]);
20717
- if (__getOwnPropSymbols$w)
20718
- for (var prop of __getOwnPropSymbols$w(b)) {
20719
- if (__propIsEnum$w.call(b, prop))
20720
- __defNormalProp$J(a, prop, b[prop]);
20812
+ if (__hasOwnProp$x.call(b, prop))
20813
+ __defNormalProp$K(a, prop, b[prop]);
20814
+ if (__getOwnPropSymbols$x)
20815
+ for (var prop of __getOwnPropSymbols$x(b)) {
20816
+ if (__propIsEnum$x.call(b, prop))
20817
+ __defNormalProp$K(a, prop, b[prop]);
20721
20818
  }
20722
20819
  return a;
20723
20820
  };
20724
- var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
20821
+ var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
20725
20822
  var __objRest$6 = (source, exclude) => {
20726
20823
  var target = {};
20727
20824
  for (var prop in source)
20728
- if (__hasOwnProp$w.call(source, prop) && exclude.indexOf(prop) < 0)
20825
+ if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
20729
20826
  target[prop] = source[prop];
20730
- if (source != null && __getOwnPropSymbols$w)
20731
- for (var prop of __getOwnPropSymbols$w(source)) {
20732
- if (exclude.indexOf(prop) < 0 && __propIsEnum$w.call(source, prop))
20827
+ if (source != null && __getOwnPropSymbols$x)
20828
+ for (var prop of __getOwnPropSymbols$x(source)) {
20829
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
20733
20830
  target[prop] = source[prop];
20734
20831
  }
20735
20832
  return target;
@@ -20740,7 +20837,7 @@ var NgwLeaflet = (function () {
20740
20837
  Object.assign(this.options, options);
20741
20838
  const _a = options, { url } = _a, opt = __objRest$6(_a, ["url"]);
20742
20839
  if (url) {
20743
- const layerOptions = __spreadValues$w(__spreadValues$w({
20840
+ const layerOptions = __spreadValues$x(__spreadValues$x({
20744
20841
  pane: this.pane,
20745
20842
  attribution: opt.attribution,
20746
20843
  minZoom: opt.minZoom,
@@ -20753,7 +20850,7 @@ var NgwLeaflet = (function () {
20753
20850
  let layer;
20754
20851
  const request = getLayerRequestOptions(opt);
20755
20852
  if (request) {
20756
- layer = new WmsLayer(url, __spreadProps$l(__spreadValues$w({}, layerOptions), {
20853
+ layer = new WmsLayer(url, __spreadProps$n(__spreadValues$x({}, layerOptions), {
20757
20854
  request
20758
20855
  }));
20759
20856
  } else {
@@ -20772,23 +20869,23 @@ var NgwLeaflet = (function () {
20772
20869
  ];
20773
20870
  }
20774
20871
 
20775
- var __defProp$I = Object.defineProperty;
20776
- var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
20777
- var __hasOwnProp$v = Object.prototype.hasOwnProperty;
20778
- var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
20779
- var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20780
- var __spreadValues$v = (a, b) => {
20872
+ var __defProp$J = Object.defineProperty;
20873
+ var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
20874
+ var __hasOwnProp$w = Object.prototype.hasOwnProperty;
20875
+ var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
20876
+ var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20877
+ var __spreadValues$w = (a, b) => {
20781
20878
  for (var prop in b || (b = {}))
20782
- if (__hasOwnProp$v.call(b, prop))
20783
- __defNormalProp$I(a, prop, b[prop]);
20784
- if (__getOwnPropSymbols$v)
20785
- for (var prop of __getOwnPropSymbols$v(b)) {
20786
- if (__propIsEnum$v.call(b, prop))
20787
- __defNormalProp$I(a, prop, b[prop]);
20879
+ if (__hasOwnProp$w.call(b, prop))
20880
+ __defNormalProp$J(a, prop, b[prop]);
20881
+ if (__getOwnPropSymbols$w)
20882
+ for (var prop of __getOwnPropSymbols$w(b)) {
20883
+ if (__propIsEnum$w.call(b, prop))
20884
+ __defNormalProp$J(a, prop, b[prop]);
20788
20885
  }
20789
20886
  return a;
20790
20887
  };
20791
- var __publicField$u = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
20888
+ var __publicField$u = (obj, key, value) => __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
20792
20889
  const _LeafletMapAdapter = class _LeafletMapAdapter {
20793
20890
  constructor() {
20794
20891
  __publicField$u(this, "options", { target: "map" });
@@ -20814,7 +20911,7 @@ var NgwLeaflet = (function () {
20814
20911
  ]);
20815
20912
  }
20816
20913
  create(options) {
20817
- this.options = __spreadValues$v({}, options);
20914
+ this.options = __spreadValues$w({}, options);
20818
20915
  if (this.options.target) {
20819
20916
  const {
20820
20917
  zoom,
@@ -20824,7 +20921,7 @@ var NgwLeaflet = (function () {
20824
20921
  maxBounds: mb,
20825
20922
  mapAdapterOptions
20826
20923
  } = this.options;
20827
- this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$v({
20924
+ this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$w({
20828
20925
  attributionControl: false,
20829
20926
  zoomControl: false,
20830
20927
  maxBounds: mb ? arrayToBoundsExpression(mb) : void 0,
@@ -21031,10 +21128,10 @@ var NgwLeaflet = (function () {
21031
21128
  }
21032
21129
  const stop2 = () => {
21033
21130
  if (locationfound !== void 0) {
21034
- map.off("locationfound", locationFound);
21131
+ map.off("locationfound", locationFound, this);
21035
21132
  }
21036
21133
  if (locationerror) {
21037
- map.off("locationerror", locationerror);
21134
+ map.off("locationerror", locationerror, this);
21038
21135
  }
21039
21136
  };
21040
21137
  return { stop: stop2 };
@@ -21217,19 +21314,19 @@ var NgwLeaflet = (function () {
21217
21314
  });
21218
21315
  }
21219
21316
 
21220
- var __defProp$H = Object.defineProperty;
21221
- var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
21222
- var __hasOwnProp$u = Object.prototype.hasOwnProperty;
21223
- var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
21224
- var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21225
- var __spreadValues$u = (a, b) => {
21317
+ var __defProp$I = Object.defineProperty;
21318
+ var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
21319
+ var __hasOwnProp$v = Object.prototype.hasOwnProperty;
21320
+ var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
21321
+ var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21322
+ var __spreadValues$v = (a, b) => {
21226
21323
  for (var prop in b || (b = {}))
21227
- if (__hasOwnProp$u.call(b, prop))
21228
- __defNormalProp$H(a, prop, b[prop]);
21229
- if (__getOwnPropSymbols$u)
21230
- for (var prop of __getOwnPropSymbols$u(b)) {
21231
- if (__propIsEnum$u.call(b, prop))
21232
- __defNormalProp$H(a, prop, b[prop]);
21324
+ if (__hasOwnProp$v.call(b, prop))
21325
+ __defNormalProp$I(a, prop, b[prop]);
21326
+ if (__getOwnPropSymbols$v)
21327
+ for (var prop of __getOwnPropSymbols$v(b)) {
21328
+ if (__propIsEnum$v.call(b, prop))
21329
+ __defNormalProp$I(a, prop, b[prop]);
21233
21330
  }
21234
21331
  return a;
21235
21332
  };
@@ -21292,7 +21389,7 @@ var NgwLeaflet = (function () {
21292
21389
  }
21293
21390
  }
21294
21391
  if (url) {
21295
- return connector.makeQuery(url, params, __spreadValues$u({
21392
+ return connector.makeQuery(url, params, __spreadValues$v({
21296
21393
  cacheName: name
21297
21394
  }, requestOptions));
21298
21395
  } else {
@@ -21304,9 +21401,9 @@ var NgwLeaflet = (function () {
21304
21401
  });
21305
21402
  }
21306
21403
 
21307
- var __defProp$G = Object.defineProperty;
21308
- var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21309
- var __publicField$t = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
21404
+ var __defProp$H = Object.defineProperty;
21405
+ var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21406
+ var __publicField$t = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
21310
21407
  const _Cache = class _Cache {
21311
21408
  constructor(options = {}) {
21312
21409
  __publicField$t(this, "cache", []);
@@ -21444,7 +21541,7 @@ var NgwLeaflet = (function () {
21444
21541
  let Cache = _Cache;
21445
21542
 
21446
21543
  var pkg = {
21447
- version: "4.0.2"};
21544
+ version: "4.1.1"};
21448
21545
 
21449
21546
  class AbortError extends Error {
21450
21547
  constructor(message = "AbortError") {
@@ -21453,9 +21550,9 @@ var NgwLeaflet = (function () {
21453
21550
  }
21454
21551
  }
21455
21552
 
21456
- var __defProp$F = Object.defineProperty;
21457
- var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21458
- var __publicField$s = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
21553
+ var __defProp$G = Object.defineProperty;
21554
+ var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21555
+ var __publicField$s = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
21459
21556
  class NgwError extends Error {
21460
21557
  constructor(er) {
21461
21558
  super();
@@ -21472,9 +21569,9 @@ var NgwLeaflet = (function () {
21472
21569
  }
21473
21570
  }
21474
21571
 
21475
- var __defProp$E = Object.defineProperty;
21476
- var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21477
- var __publicField$r = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
21572
+ var __defProp$F = Object.defineProperty;
21573
+ var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21574
+ var __publicField$r = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
21478
21575
  class InsufficientPermissionsError extends NgwError {
21479
21576
  constructor(obj) {
21480
21577
  super(obj);
@@ -21484,9 +21581,9 @@ var NgwLeaflet = (function () {
21484
21581
  }
21485
21582
  }
21486
21583
 
21487
- var __defProp$D = Object.defineProperty;
21488
- var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21489
- var __publicField$q = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
21584
+ var __defProp$E = Object.defineProperty;
21585
+ var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21586
+ var __publicField$q = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
21490
21587
  let NetworksResponseError$1 = class NetworksResponseError extends NgwError {
21491
21588
  constructor(obj) {
21492
21589
  super(obj);
@@ -21524,14 +21621,14 @@ var NgwLeaflet = (function () {
21524
21621
 
21525
21622
  function isError(error) {
21526
21623
  if (isObject$1(error)) {
21527
- return error.status_code && error.exception && error.title;
21624
+ return Boolean(error.status_code && error.exception && error.title);
21528
21625
  }
21529
21626
  return false;
21530
21627
  }
21531
21628
 
21532
- var __defProp$C = Object.defineProperty;
21533
- var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21534
- var __publicField$p = (obj, key, value) => __defNormalProp$C(obj, key + "" , value);
21629
+ var __defProp$D = Object.defineProperty;
21630
+ var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21631
+ var __publicField$p = (obj, key, value) => __defNormalProp$D(obj, key + "" , value);
21535
21632
  class NetworkError extends Error {
21536
21633
  constructor(url) {
21537
21634
  super();
@@ -21542,9 +21639,9 @@ var NgwLeaflet = (function () {
21542
21639
  }
21543
21640
  }
21544
21641
 
21545
- var __defProp$B = Object.defineProperty;
21546
- var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21547
- var __publicField$o = (obj, key, value) => __defNormalProp$B(obj, typeof key !== "symbol" ? key + "" : key, value);
21642
+ var __defProp$C = Object.defineProperty;
21643
+ var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21644
+ var __publicField$o = (obj, key, value) => __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
21548
21645
  class ResourceNotFoundError extends NgwError {
21549
21646
  constructor(obj) {
21550
21647
  super(obj);
@@ -21566,9 +21663,9 @@ var NgwLeaflet = (function () {
21566
21663
  isError: isError
21567
21664
  });
21568
21665
 
21569
- var __defProp$A = Object.defineProperty;
21570
- var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21571
- var __publicField$n = (obj, key, value) => __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
21666
+ var __defProp$B = Object.defineProperty;
21667
+ var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21668
+ var __publicField$n = (obj, key, value) => __defNormalProp$B(obj, typeof key !== "symbol" ? key + "" : key, value);
21572
21669
  class BaseAPIError extends Error {
21573
21670
  constructor(message) {
21574
21671
  super(message || "Something went wrong.");
@@ -21630,30 +21727,33 @@ var NgwLeaflet = (function () {
21630
21727
  }
21631
21728
  }
21632
21729
 
21633
- var __defProp$z = Object.defineProperty;
21634
- var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
21635
- var __hasOwnProp$t = Object.prototype.hasOwnProperty;
21636
- var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
21637
- var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21638
- var __spreadValues$t = (a, b) => {
21730
+ var __defProp$A = Object.defineProperty;
21731
+ var __defProps$m = Object.defineProperties;
21732
+ var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
21733
+ var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
21734
+ var __hasOwnProp$u = Object.prototype.hasOwnProperty;
21735
+ var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
21736
+ var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21737
+ var __spreadValues$u = (a, b) => {
21639
21738
  for (var prop in b || (b = {}))
21640
- if (__hasOwnProp$t.call(b, prop))
21641
- __defNormalProp$z(a, prop, b[prop]);
21642
- if (__getOwnPropSymbols$t)
21643
- for (var prop of __getOwnPropSymbols$t(b)) {
21644
- if (__propIsEnum$t.call(b, prop))
21645
- __defNormalProp$z(a, prop, b[prop]);
21739
+ if (__hasOwnProp$u.call(b, prop))
21740
+ __defNormalProp$A(a, prop, b[prop]);
21741
+ if (__getOwnPropSymbols$u)
21742
+ for (var prop of __getOwnPropSymbols$u(b)) {
21743
+ if (__propIsEnum$u.call(b, prop))
21744
+ __defNormalProp$A(a, prop, b[prop]);
21646
21745
  }
21647
21746
  return a;
21648
21747
  };
21748
+ var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
21649
21749
  var __objRest$5 = (source, exclude) => {
21650
21750
  var target = {};
21651
21751
  for (var prop in source)
21652
- if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
21752
+ if (__hasOwnProp$u.call(source, prop) && exclude.indexOf(prop) < 0)
21653
21753
  target[prop] = source[prop];
21654
- if (source != null && __getOwnPropSymbols$t)
21655
- for (var prop of __getOwnPropSymbols$t(source)) {
21656
- if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
21754
+ if (source != null && __getOwnPropSymbols$u)
21755
+ for (var prop of __getOwnPropSymbols$u(source)) {
21756
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$u.call(source, prop))
21657
21757
  target[prop] = source[prop];
21658
21758
  }
21659
21759
  return target;
@@ -21685,40 +21785,60 @@ var NgwLeaflet = (function () {
21685
21785
  function responseJson(response) {
21686
21786
  return __async$r(this, null, function* () {
21687
21787
  try {
21688
- return response.json();
21788
+ return yield response.json();
21689
21789
  } catch (e) {
21690
- throw new Error();
21790
+ throw new InvalidResponseError();
21691
21791
  }
21692
21792
  });
21693
21793
  }
21694
- function lunkwillResponseUrl(lwResp) {
21794
+ function lunkwillResponseUrl(lwResp, opt) {
21695
21795
  return __async$r(this, null, function* () {
21796
+ var _a, _b, _c, _d;
21696
21797
  const lwData = yield responseJson(lwResp);
21697
- let delay = lwData.delay_ms;
21698
- const retry = lwData.retry_ms !== void 0 ? lwData.retry_ms : 2e3;
21798
+ if (lwData.id == null) {
21799
+ throw new LunkwillError(void 0, lwData);
21800
+ }
21801
+ let delay = (_a = lwData.delay_ms) != null ? _a : 0;
21802
+ const retry = (_b = lwData.retry_ms) != null ? _b : 2e3;
21699
21803
  const sum = `/api/lunkwill/${lwData.id}/summary`;
21700
21804
  const res = `/api/lunkwill/${lwData.id}/response`;
21701
- const sleep = (msec) => new Promise((resolve) => setTimeout(resolve, msec));
21702
- let failed = false;
21703
- let ready = false;
21704
- while (!ready) {
21705
- yield sleep(failed ? retry : delay);
21706
- failed = false;
21707
- let lwResp2;
21805
+ const sleep = (msec) => new Promise((resolve, reject) => {
21806
+ const signal = opt.signal;
21807
+ const aborted = () => (signal == null ? void 0 : signal.reason) instanceof Error ? signal.reason : new DOMException("Aborted", "AbortError");
21808
+ if (signal == null ? void 0 : signal.aborted) return reject(aborted());
21809
+ const onAbort = () => {
21810
+ clearTimeout(timer);
21811
+ reject(aborted());
21812
+ };
21813
+ const timer = setTimeout(() => {
21814
+ signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
21815
+ resolve();
21816
+ }, msec);
21817
+ signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
21818
+ });
21819
+ let failures = 0;
21820
+ while (true) {
21821
+ yield sleep(failures ? retry : delay);
21708
21822
  let lwData2;
21709
21823
  try {
21710
- lwResp2 = yield fetch(sum, { credentials: "same-origin" });
21711
- lwData2 = yield lwResp2.json();
21712
- } catch (e) {
21713
- failed = true;
21824
+ const response = yield fetch(sum, {
21825
+ credentials: opt.credentials,
21826
+ headers: opt.headers,
21827
+ signal: opt.signal
21828
+ });
21829
+ if (!response.ok) {
21830
+ throw new Error(`Lunkwill HTTP ${response.status}`);
21831
+ }
21832
+ lwData2 = yield responseJson(response);
21833
+ failures = 0;
21834
+ } catch (error) {
21835
+ if ((_c = opt.signal) == null ? void 0 : _c.aborted) throw error;
21836
+ if (++failures >= 5) throw new NetworksResponseError();
21714
21837
  continue;
21715
21838
  }
21716
21839
  switch (lwData2.status) {
21717
- case void 0:
21718
- throw new LunkwillError(void 0, lwData2);
21719
21840
  case "ready":
21720
- ready = true;
21721
- break;
21841
+ return res;
21722
21842
  case "cancelled":
21723
21843
  throw new LunkwillRequestCancelled(lwData2);
21724
21844
  case "failed":
@@ -21726,20 +21846,25 @@ var NgwLeaflet = (function () {
21726
21846
  case "spooled":
21727
21847
  case "processing":
21728
21848
  case "buffering":
21729
- delay = lwData2.delay_ms;
21849
+ delay = (_d = lwData2.delay_ms) != null ? _d : 2e3;
21730
21850
  break;
21731
21851
  default:
21732
21852
  throw new LunkwillError(void 0, lwData2);
21733
21853
  }
21734
21854
  }
21735
- return res;
21736
21855
  });
21737
21856
  }
21738
- function lunkwillFetch(lwRespUrl) {
21857
+ function lunkwillFetch(url, opt) {
21739
21858
  return __async$r(this, null, function* () {
21859
+ var _a;
21740
21860
  try {
21741
- return yield window.fetch(lwRespUrl, { credentials: "same-origin" });
21742
- } catch (e) {
21861
+ return yield fetch(url, {
21862
+ credentials: opt.credentials,
21863
+ headers: opt.headers,
21864
+ signal: opt.signal
21865
+ });
21866
+ } catch (error) {
21867
+ if ((_a = opt.signal) == null ? void 0 : _a.aborted) throw error;
21743
21868
  throw new NetworksResponseError();
21744
21869
  }
21745
21870
  });
@@ -21791,7 +21916,7 @@ var NgwLeaflet = (function () {
21791
21916
  credentials: "same-origin",
21792
21917
  headers: {}
21793
21918
  };
21794
- const _a = __spreadValues$t(__spreadValues$t({}, defaults), options), {
21919
+ const _a = __spreadValues$u(__spreadValues$u({}, defaults), options), {
21795
21920
  withCredentials,
21796
21921
  responseType,
21797
21922
  cacheProps,
@@ -21811,7 +21936,7 @@ var NgwLeaflet = (function () {
21811
21936
  "json"
21812
21937
  ]);
21813
21938
  opt.method = (_b = opt.method) == null ? void 0 : _b.toUpperCase();
21814
- if (withCredentials) {
21939
+ if (withCredentials && (options == null ? void 0 : options.credentials) === void 0) {
21815
21940
  opt.credentials = "include";
21816
21941
  }
21817
21942
  let useLunkwill = false;
@@ -21839,11 +21964,37 @@ var NgwLeaflet = (function () {
21839
21964
  throw new NetworksResponseError();
21840
21965
  }
21841
21966
  if (useLunkwill && lunkwillCheckResponse(response)) {
21842
- const lwRespUrl = yield lunkwillResponseUrl(response);
21967
+ const lwRespUrl = yield lunkwillResponseUrl(response, opt);
21843
21968
  if (lunkwillReturnUrl) {
21844
21969
  return lwRespUrl;
21845
21970
  }
21846
- response = yield lunkwillFetch(lwRespUrl);
21971
+ response = yield lunkwillFetch(lwRespUrl, opt);
21972
+ }
21973
+ if (!response.ok) {
21974
+ let responseText;
21975
+ try {
21976
+ responseText = yield response.text();
21977
+ } catch (e) {
21978
+ if (e.name === "AbortError") throw e;
21979
+ throw new InvalidResponseError();
21980
+ }
21981
+ let errorBody = responseText;
21982
+ if (responseText) {
21983
+ try {
21984
+ errorBody = JSON.parse(responseText);
21985
+ } catch (e) {
21986
+ }
21987
+ }
21988
+ const fallback = response.statusText || `HTTP ${response.status}`;
21989
+ const data = errorBody && typeof errorBody === "object" && !Array.isArray(errorBody) ? __spreadProps$m(__spreadValues$u({}, errorBody), {
21990
+ message: typeof errorBody.message === "string" && errorBody.message ? errorBody.message : fallback
21991
+ }) : {
21992
+ message: typeof errorBody === "string" && errorBody.trim() ? errorBody : fallback
21993
+ };
21994
+ throw new ServerResponseError(data);
21995
+ }
21996
+ if (response.status === 204 || response.status === 205) {
21997
+ return void 0;
21847
21998
  }
21848
21999
  const respCType = response.headers.get("content-type");
21849
22000
  const respJSON = respCType && (respCType.includes("application/json") || respCType.includes("application/vnd.lunkwill.request-summary+json"));
@@ -21863,15 +22014,12 @@ var NgwLeaflet = (function () {
21863
22014
  }
21864
22015
  throw new InvalidResponseError();
21865
22016
  }
21866
- if (400 <= response.status && response.status <= 599) {
21867
- throw new ServerResponseError(body);
21868
- }
21869
22017
  return body;
21870
22018
  });
21871
22019
  if (cacheEngine) {
21872
22020
  if (((_c = opt.method) == null ? void 0 : _c.toUpperCase()) === "GET") {
21873
22021
  if (cache !== false) {
21874
- const props = cacheProps ? cacheProps : __spreadValues$t({}, objectRemoveEmpty({
22022
+ const props = cacheProps ? cacheProps : __spreadValues$u({}, objectRemoveEmpty({
21875
22023
  withCredentials,
21876
22024
  responseType
21877
22025
  }));
@@ -21891,33 +22039,33 @@ var NgwLeaflet = (function () {
21891
22039
  });
21892
22040
  }
21893
22041
 
21894
- var __defProp$y = Object.defineProperty;
21895
- var __defProps$k = Object.defineProperties;
21896
- var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
21897
- var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
21898
- var __hasOwnProp$s = Object.prototype.hasOwnProperty;
21899
- var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
21900
- var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
21901
- var __spreadValues$s = (a, b) => {
22042
+ var __defProp$z = Object.defineProperty;
22043
+ var __defProps$l = Object.defineProperties;
22044
+ var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
22045
+ var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
22046
+ var __hasOwnProp$t = Object.prototype.hasOwnProperty;
22047
+ var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
22048
+ var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
22049
+ var __spreadValues$t = (a, b) => {
21902
22050
  for (var prop in b || (b = {}))
21903
- if (__hasOwnProp$s.call(b, prop))
21904
- __defNormalProp$y(a, prop, b[prop]);
21905
- if (__getOwnPropSymbols$s)
21906
- for (var prop of __getOwnPropSymbols$s(b)) {
21907
- if (__propIsEnum$s.call(b, prop))
21908
- __defNormalProp$y(a, prop, b[prop]);
22051
+ if (__hasOwnProp$t.call(b, prop))
22052
+ __defNormalProp$z(a, prop, b[prop]);
22053
+ if (__getOwnPropSymbols$t)
22054
+ for (var prop of __getOwnPropSymbols$t(b)) {
22055
+ if (__propIsEnum$t.call(b, prop))
22056
+ __defNormalProp$z(a, prop, b[prop]);
21909
22057
  }
21910
22058
  return a;
21911
22059
  };
21912
- var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
22060
+ var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
21913
22061
  var __objRest$4 = (source, exclude) => {
21914
22062
  var target = {};
21915
22063
  for (var prop in source)
21916
- if (__hasOwnProp$s.call(source, prop) && exclude.indexOf(prop) < 0)
22064
+ if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
21917
22065
  target[prop] = source[prop];
21918
- if (source != null && __getOwnPropSymbols$s)
21919
- for (var prop of __getOwnPropSymbols$s(source)) {
21920
- if (exclude.indexOf(prop) < 0 && __propIsEnum$s.call(source, prop))
22066
+ if (source != null && __getOwnPropSymbols$t)
22067
+ for (var prop of __getOwnPropSymbols$t(source)) {
22068
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
21921
22069
  target[prop] = source[prop];
21922
22070
  }
21923
22071
  return target;
@@ -22001,10 +22149,10 @@ var NgwLeaflet = (function () {
22001
22149
  routeData,
22002
22150
  ...rest
22003
22151
  );
22004
- const headers = objectRemoveEmpty(__spreadValues$s(__spreadValues$s({}, connector.getAuthorizationHeaders()), optHeaders != null ? optHeaders : {}));
22152
+ const headers = objectRemoveEmpty(__spreadValues$t(__spreadValues$t({}, connector.getAuthorizationHeaders()), optHeaders != null ? optHeaders : {}));
22005
22153
  return request(
22006
22154
  template,
22007
- __spreadProps$k(__spreadValues$s({
22155
+ __spreadProps$l(__spreadValues$t({
22008
22156
  headers
22009
22157
  }, restOpt), {
22010
22158
  method
@@ -22022,6 +22170,34 @@ var NgwLeaflet = (function () {
22022
22170
  return Object.prototype.toString.call(val) === "[object Object]";
22023
22171
  }
22024
22172
 
22173
+ var __defProp$y = Object.defineProperty;
22174
+ var __defProps$k = Object.defineProperties;
22175
+ var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
22176
+ var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
22177
+ var __hasOwnProp$s = Object.prototype.hasOwnProperty;
22178
+ var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
22179
+ var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
22180
+ var __spreadValues$s = (a, b) => {
22181
+ for (var prop in b || (b = {}))
22182
+ if (__hasOwnProp$s.call(b, prop))
22183
+ __defNormalProp$y(a, prop, b[prop]);
22184
+ if (__getOwnPropSymbols$s)
22185
+ for (var prop of __getOwnPropSymbols$s(b)) {
22186
+ if (__propIsEnum$s.call(b, prop))
22187
+ __defNormalProp$y(a, prop, b[prop]);
22188
+ }
22189
+ return a;
22190
+ };
22191
+ var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
22192
+ function createHttpError(status, statusText, response) {
22193
+ const details = isObject(response) ? response : {};
22194
+ const message = typeof details.message === "string" && details.message ? details.message : typeof response === "string" && response.trim() ? response : statusText || `HTTP ${status}`;
22195
+ return new NgwError(__spreadProps$k(__spreadValues$s({}, details), {
22196
+ status_code: status,
22197
+ title: typeof details.title === "string" && details.title ? details.title : `HTTP ${status}`,
22198
+ message
22199
+ }));
22200
+ }
22025
22201
  let loadData;
22026
22202
  {
22027
22203
  loadData = (url, callback, options = {}, error, onCancel) => {
@@ -22038,23 +22214,21 @@ var NgwLeaflet = (function () {
22038
22214
  return xhr.responseText;
22039
22215
  }
22040
22216
  };
22041
- const processingResponse = (forError = false) => {
22042
- const cb = forError ? error : callback;
22217
+ xhr.onload = () => {
22218
+ if (xhr.status < 200 || xhr.status >= 300) {
22219
+ const response = options.responseType === "blob" || !xhr.responseText ? void 0 : getResponseText();
22220
+ error(createHttpError(xhr.status, xhr.statusText, response));
22221
+ return;
22222
+ }
22223
+ if (xhr.status === 204 || xhr.status === 205) {
22224
+ callback(void 0);
22225
+ return;
22226
+ }
22043
22227
  if (options.responseType === "blob") {
22044
- cb(xhr.response);
22228
+ callback(xhr.response);
22045
22229
  } else {
22046
- if (xhr.responseText) {
22047
- cb(getResponseText());
22048
- } else {
22049
- error({ message: "" });
22050
- }
22051
- }
22052
- };
22053
- xhr.onload = () => {
22054
- if ([401, 403, 404, 422, 500].indexOf(xhr.status) !== -1) {
22055
- error(new NgwError(getResponseText()));
22230
+ callback(xhr.responseText ? getResponseText() : void 0);
22056
22231
  }
22057
- processingResponse();
22058
22232
  };
22059
22233
  xhr.onerror = (er) => {
22060
22234
  if (xhr.status === 0) {
@@ -22089,7 +22263,7 @@ var NgwLeaflet = (function () {
22089
22263
  data.append("file", options.file);
22090
22264
  if (options.data) {
22091
22265
  for (const d in options.data) {
22092
- data.append(d, data[d]);
22266
+ data.append(d, options.data[d]);
22093
22267
  }
22094
22268
  }
22095
22269
  } else {
@@ -22109,16 +22283,15 @@ var NgwLeaflet = (function () {
22109
22283
  CONNECTORS.push(connector);
22110
22284
  }
22111
22285
  function findConnector(options) {
22112
- return CONNECTORS.find((x) => {
22113
- if (x.options.baseUrl === options.baseUrl) {
22114
- if (options.auth) {
22115
- if (x.options.auth) {
22116
- return objectDeepEqual(x.options.auth, options.auth);
22117
- }
22118
- } else {
22119
- return true;
22120
- }
22286
+ return CONNECTORS.find((connector) => {
22287
+ const existing = connector.options;
22288
+ if (existing.baseUrl !== options.baseUrl || existing.route !== options.route || existing.cacheId !== options.cacheId || connector.withCredentials !== options.withCredentials || existing.requestTransform !== options.requestTransform) {
22289
+ return false;
22290
+ }
22291
+ if (!existing.auth || !options.auth) {
22292
+ return !existing.auth && !options.auth;
22121
22293
  }
22294
+ return objectDeepEqual(existing.auth, options.auth);
22122
22295
  });
22123
22296
  }
22124
22297
  function removeConnector(connector) {
@@ -22224,6 +22397,7 @@ var NgwLeaflet = (function () {
22224
22397
  }
22225
22398
  setRequestTransform(requestTransform) {
22226
22399
  this.requestTransform = requestTransform;
22400
+ this.options.requestTransform = requestTransform != null ? requestTransform : void 0;
22227
22401
  }
22228
22402
  /**
22229
22403
  * Fast way to specify the connection address to NextGIS Web.
@@ -22370,23 +22544,31 @@ var NgwLeaflet = (function () {
22370
22544
  responseType,
22371
22545
  withCredentials
22372
22546
  } = options;
22373
- const internalAbortController = new AbortController();
22374
- const internalSignal = internalAbortController.signal;
22375
- if (externalSignal) {
22376
- if (externalSignal.aborted) {
22377
- throw new AbortError();
22378
- }
22379
- externalSignal.addEventListener("abort", () => {
22380
- internalAbortController.abort();
22381
- });
22547
+ if (externalSignal == null ? void 0 : externalSignal.aborted) {
22548
+ throw new AbortError();
22382
22549
  }
22383
- options.signal = internalSignal;
22384
22550
  const createPromise = () => __async$p(this, null, function* () {
22551
+ const internalAbortController = new AbortController();
22552
+ const onExternalAbort = () => internalAbortController.abort();
22553
+ if (externalSignal) {
22554
+ externalSignal.addEventListener("abort", onExternalAbort, {
22555
+ once: true
22556
+ });
22557
+ if (externalSignal.aborted) {
22558
+ internalAbortController.abort();
22559
+ }
22560
+ }
22385
22561
  const id = REQUEST_ID++;
22386
22562
  this.activeRequests[id] = internalAbortController;
22387
22563
  try {
22388
- return this._loadData(url, options);
22564
+ if (internalAbortController.signal.aborted) {
22565
+ throw new AbortError();
22566
+ }
22567
+ return yield this._loadData(url, __spreadProps$j(__spreadValues$r({}, options), {
22568
+ signal: internalAbortController.signal
22569
+ }));
22389
22570
  } finally {
22571
+ externalSignal == null ? void 0 : externalSignal.removeEventListener("abort", onExternalAbort);
22390
22572
  this._cleanActiveRequest(id);
22391
22573
  }
22392
22574
  });
@@ -22806,7 +22988,9 @@ var NgwLeaflet = (function () {
22806
22988
  */
22807
22989
  clearCache() {
22808
22990
  super.clearCache();
22809
- this.resources.cache.clean();
22991
+ if (this.resources.cache !== this.cache) {
22992
+ this.resources.cache.clean();
22993
+ }
22810
22994
  }
22811
22995
  /**
22812
22996
  * Send request to NGW api router.
@@ -23044,11 +23228,12 @@ var NgwLeaflet = (function () {
23044
23228
  signal
23045
23229
  }) {
23046
23230
  return connector.route("layer.extent", { id: Number(resourceId) }).get({ cache, signal }).then((resp) => {
23047
- if (resp) {
23048
- const { maxLat, maxLon, minLat, minLon } = resp.extent;
23049
- const extentArray = [minLon, minLat, maxLon, maxLat];
23050
- return extentArray;
23231
+ if (!(resp == null ? void 0 : resp.extent)) {
23232
+ return void 0;
23051
23233
  }
23234
+ const { maxLat, maxLon, minLat, minLon } = resp.extent;
23235
+ const extentArray = [minLon, minLat, maxLon, maxLat];
23236
+ return extentArray;
23052
23237
  });
23053
23238
  }
23054
23239
  function fetchNgwLayerItemExtent({
@@ -24107,8 +24292,8 @@ var NgwLeaflet = (function () {
24107
24292
  }
24108
24293
  getHierarchyValue() {
24109
24294
  return this.get() && this.getParents().every((x) => {
24110
- const property = x.properties && x.properties.get(this.name);
24111
- return property && property.get();
24295
+ var _a;
24296
+ return Boolean((_a = x.properties) == null ? void 0 : _a.get(this.name));
24112
24297
  });
24113
24298
  }
24114
24299
  block(options) {
@@ -27318,7 +27503,11 @@ var NgwLeaflet = (function () {
27318
27503
  __publicField$1(this, "timer");
27319
27504
  __publicField$1(this, "pending", Promise.resolve());
27320
27505
  __publicField$1(this, "disposed", false);
27506
+ __publicField$1(this, "revision", 0);
27321
27507
  __publicField$1(this, "onLayerChange", (layer) => {
27508
+ if (!this.isVisible(layer)) {
27509
+ this.invalidateGroupsContaining(layer, true);
27510
+ }
27322
27511
  if (this.webMap.allLayers()[String(layer.id)] === layer) {
27323
27512
  this.observe(layer);
27324
27513
  } else {
@@ -27335,12 +27524,14 @@ var NgwLeaflet = (function () {
27335
27524
  this.schedule();
27336
27525
  });
27337
27526
  __publicField$1(this, "onBeforeLayerRemove", (layer) => {
27527
+ this.invalidateGroupsContaining(layer, true);
27338
27528
  const container = layer;
27339
27529
  if (typeof container.getDependLayers !== "function") return;
27340
27530
  for (const item of container.getDependLayers()) {
27341
27531
  const child = item.layer;
27342
27532
  if (!child) continue;
27343
27533
  this.detached.add(child);
27534
+ this.invalidateGroupsContaining(child, true);
27344
27535
  const update = this.originalUpdates.get(child);
27345
27536
  if (update) child.updateLayer = update;
27346
27537
  this.originalUpdates.delete(child);
@@ -27352,6 +27543,7 @@ var NgwLeaflet = (function () {
27352
27543
  for (const layer of this.webMap.orderedLayers()) {
27353
27544
  if (layer.id === (event == null ? void 0 : event.layerId)) {
27354
27545
  this.excluded.add(layer);
27546
+ this.invalidateGroupsContaining(layer);
27355
27547
  this.schedule();
27356
27548
  break;
27357
27549
  }
@@ -27408,6 +27600,7 @@ var NgwLeaflet = (function () {
27408
27600
  /** Re-evaluate grouping after any observed layer state change. */
27409
27601
  schedule() {
27410
27602
  if (this.disposed) return;
27603
+ this.revision++;
27411
27604
  if (this.timer) clearTimeout(this.timer);
27412
27605
  this.timer = setTimeout(() => {
27413
27606
  this.timer = void 0;
@@ -27425,7 +27618,12 @@ var NgwLeaflet = (function () {
27425
27618
  if (this.opacityListeners.has(layer)) return;
27426
27619
  const native = layer.layer;
27427
27620
  if (!(native == null ? void 0 : native.on) || !native.off && !native.un) return;
27428
- const listener = () => this.schedule();
27621
+ const listener = () => {
27622
+ if (this.getOpacity(layer) !== 1) {
27623
+ this.invalidateGroupsContaining(layer);
27624
+ }
27625
+ this.schedule();
27626
+ };
27429
27627
  native.on("change:opacity", listener);
27430
27628
  native.on("opacitychange", listener);
27431
27629
  this.opacityListeners.set(layer, () => {
@@ -27465,6 +27663,7 @@ var NgwLeaflet = (function () {
27465
27663
  this.originalUpdates.set(layer, original);
27466
27664
  layer.updateLayer = (options) => {
27467
27665
  this.excluded.add(layer);
27666
+ this.invalidateGroupsContaining(layer);
27468
27667
  this.schedule();
27469
27668
  return original.call(layer, options);
27470
27669
  };
@@ -27531,7 +27730,6 @@ var NgwLeaflet = (function () {
27531
27730
  /** Render-only IMAGE: exists on the native map, not in WebMap._layers. */
27532
27731
  createNativeGroup(options) {
27533
27732
  return __async$2(this, null, function* () {
27534
- var _a;
27535
27733
  const ImageAdapter = this.webMap.getLayerAdapter("IMAGE");
27536
27734
  if (!ImageAdapter) throw new Error("IMAGE adapter is unavailable");
27537
27735
  const adapter = new ImageAdapter(this.webMap.mapAdapter.map, options);
@@ -27540,13 +27738,6 @@ var NgwLeaflet = (function () {
27540
27738
  if (native === void 0)
27541
27739
  throw new Error("IMAGE adapter returned no layer");
27542
27740
  adapter.layer = native;
27543
- try {
27544
- this.webMap.mapAdapter.showLayer(native);
27545
- this.webMap.mapAdapter.setLayerOrder(native, (_a = options.order) != null ? _a : 0);
27546
- } catch (error) {
27547
- this.webMap.mapAdapter.removeLayer(native);
27548
- throw error;
27549
- }
27550
27741
  return adapter;
27551
27742
  });
27552
27743
  }
@@ -27561,10 +27752,27 @@ var NgwLeaflet = (function () {
27561
27752
  this.webMap.mapAdapter.removeLayer(adapter.layer);
27562
27753
  }
27563
27754
  }
27755
+ /** Remove obsolete composites and restore remaining native members immediately. */
27756
+ invalidateGroupsContaining(layer, skipRestore = false) {
27757
+ for (const [key, group] of this.groups) {
27758
+ if (!group.members.includes(layer)) continue;
27759
+ this.removeGroup(group);
27760
+ this.groups.delete(key);
27761
+ for (const member of group.members) {
27762
+ if (!this.suppressed.delete(member)) continue;
27763
+ if (member === layer && skipRestore) continue;
27764
+ if (this.isVisible(member) && member.layer !== void 0) {
27765
+ this.webMap.mapAdapter.showLayer(member.layer);
27766
+ this.webMap.mapAdapter.setLayerOrder(member.layer, member.order);
27767
+ }
27768
+ }
27769
+ }
27770
+ }
27564
27771
  reconcile() {
27565
27772
  return __async$2(this, null, function* () {
27566
- var _a, _b;
27773
+ var _a, _b, _c;
27567
27774
  if (this.disposed) return;
27775
+ const revision = this.revision;
27568
27776
  const chunks = this.plan();
27569
27777
  const desired = new Map(
27570
27778
  chunks.map((chunk) => [
@@ -27622,10 +27830,21 @@ var NgwLeaflet = (function () {
27622
27830
  visibility: true,
27623
27831
  updateWmsParams: (params) => updateImageParams(params, resources)
27624
27832
  });
27625
- let layer;
27833
+ let layer = void 0;
27626
27834
  try {
27627
27835
  layer = yield this.createNativeGroup(options);
27836
+ if (this.disposed || this.revision !== revision) {
27837
+ this.removeGroup({ layer, members: [] });
27838
+ return;
27839
+ }
27840
+ if (layer.layer !== void 0) {
27841
+ this.webMap.mapAdapter.showLayer(layer.layer);
27842
+ this.webMap.mapAdapter.setLayerOrder(layer.layer, (_c = options.order) != null ? _c : 0);
27843
+ }
27628
27844
  } catch (error) {
27845
+ if (layer) {
27846
+ this.removeGroup({ layer, members: [] });
27847
+ }
27629
27848
  for (const { layer: member } of chunk) {
27630
27849
  this.excluded.add(member);
27631
27850
  if (this.suppressed.has(member)) {
@@ -27797,7 +28016,7 @@ var NgwLeaflet = (function () {
27797
28016
  adapterOpts
27798
28017
  );
27799
28018
  const id = layer && this.getLayerId(layer);
27800
- if (layer && id) {
28019
+ if (layer && id && this.getLayer(id) === layer) {
27801
28020
  this._ngwLayers[id] = { layer, resourceId: layer.resourceId };
27802
28021
  layer.options.name = layer.options.name || layer.item && layer.item.resource.display_name;
27803
28022
  if (layer.options.baselayer) {
@@ -27850,43 +28069,44 @@ var NgwLeaflet = (function () {
27850
28069
  }, options));
27851
28070
  }
27852
28071
  fetchIdentifyItem(identify, requestOptions) {
27853
- const abortController = new AbortController();
27854
- const abortSignal = abortController.signal;
27855
- if (requestOptions == null ? void 0 : requestOptions.signal) {
27856
- requestOptions.signal.addEventListener("abort", abortController.abort);
27857
- }
27858
- requestOptions = requestOptions || {};
27859
- requestOptions.signal = abortSignal;
27860
- const promise = fetchIdentifyItem({
27861
- identify,
27862
- connector: this.connector,
27863
- requestOptions
27864
- // multiple,
28072
+ return __async$1(this, null, function* () {
28073
+ const abortSignal = requestOptions == null ? void 0 : requestOptions.signal;
28074
+ if (abortSignal == null ? void 0 : abortSignal.aborted) throw new NgwConnectorExtended.errors.AbortError();
28075
+ const abortController = new AbortController();
28076
+ const onAbort = () => abortController.abort();
28077
+ abortSignal == null ? void 0 : abortSignal.addEventListener("abort", onAbort, { once: true });
28078
+ try {
28079
+ const promise = fetchIdentifyItem({
28080
+ identify,
28081
+ connector: this.connector,
28082
+ requestOptions: __spreadProps$1(__spreadValues$1({}, requestOptions), { signal: abortController.signal })
28083
+ });
28084
+ this._addPromise("identify", promise, abortController);
28085
+ return yield promise;
28086
+ } finally {
28087
+ abortSignal == null ? void 0 : abortSignal.removeEventListener("abort", onAbort);
28088
+ }
27865
28089
  });
27866
- this._addPromise("identify", promise, abortController);
27867
- return promise;
27868
28090
  }
27869
- fetchIdentifyGeoJson(identify, { multiple, signal } = {}) {
27870
- const abortController = new AbortController();
27871
- if (signal) {
27872
- if (signal.aborted) {
27873
- return Promise.reject(new NgwConnectorExtended.errors.AbortError());
28091
+ fetchIdentifyGeoJson(_0) {
28092
+ return __async$1(this, arguments, function* (identify, { multiple, signal } = {}) {
28093
+ if (signal == null ? void 0 : signal.aborted) throw new NgwConnectorExtended.errors.AbortError();
28094
+ const abortController = new AbortController();
28095
+ const onAbort = () => abortController.abort();
28096
+ signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
28097
+ try {
28098
+ const promise = fetchIdentifyGeoJson({
28099
+ identify,
28100
+ connector: this.connector,
28101
+ multiple,
28102
+ requestOptions: { signal: abortController.signal }
28103
+ });
28104
+ this._addPromise("identify", promise, abortController);
28105
+ return yield promise;
28106
+ } finally {
28107
+ signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
27874
28108
  }
27875
- signal.addEventListener("abort", () => {
27876
- abortController.abort("AbortError");
27877
- });
27878
- }
27879
- const promise = fetchIdentifyGeoJson({
27880
- identify,
27881
- connector: this.connector,
27882
- requestOptions: { signal: abortController.signal }
27883
28109
  });
27884
- if (promise && "then" in promise) {
27885
- this._addPromise("identify", promise, abortController);
27886
- return promise;
27887
- } else {
27888
- return Promise.resolve(promise);
27889
- }
27890
28110
  }
27891
28111
  /**
27892
28112
  * @deprecated use {@link fetchIdentifyGeoJson} instead
@@ -27938,7 +28158,7 @@ var NgwLeaflet = (function () {
27938
28158
  return __async$1(this, null, function* () {
27939
28159
  let id;
27940
28160
  if (typeof layerDef === "string" || typeof layerDef === "number") {
27941
- id = String(id);
28161
+ id = String(layerDef);
27942
28162
  } else {
27943
28163
  id = layerDef.id;
27944
28164
  }
@@ -27958,11 +28178,11 @@ var NgwLeaflet = (function () {
27958
28178
  item = yield this.connector.getResource(resourceId);
27959
28179
  }
27960
28180
  if (item) {
27961
- this.fitResource(item.resource.id);
28181
+ yield this.fitResource(item.resource.id);
27962
28182
  }
27963
28183
  }
27964
28184
  } else {
27965
- __superGet(_NgwMap.prototype, this, "fitLayer").call(
28185
+ yield __superGet(_NgwMap.prototype, this, "fitLayer").call(
27966
28186
  this,
27967
28187
  typeof layerDef === "number" ? String(layerDef) : layerDef,
27968
28188
  options
@@ -27992,10 +28212,11 @@ var NgwLeaflet = (function () {
27992
28212
  return super.onLoad(event);
27993
28213
  }
27994
28214
  removeLayer(layerDef) {
28215
+ var _a;
27995
28216
  const layer = this.getLayer(layerDef);
27996
28217
  if (layer) {
27997
28218
  const layerId = this.getLayerId(layer);
27998
- if (layerId) {
28219
+ if (layerId && ((_a = this._ngwLayers[layerId]) == null ? void 0 : _a.layer) === layer) {
27999
28220
  delete this._ngwLayers[layerId];
28000
28221
  }
28001
28222
  super.removeLayer(layer);