@nextgis/ngw-leaflet 4.0.0-rc.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 4.0.0-rc.2; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 4.0.0; author: NextGIS */
2
2
  function getElement(el) {
3
3
  if (typeof el === "string") {
4
4
  let el_ = document.getElementById(el);
@@ -15778,13 +15778,22 @@ class BaseAdapter {
15778
15778
  __publicField$K(this, "options", options);
15779
15779
  __publicField$K(this, "layer");
15780
15780
  __publicField$K(this, "pane", "order-0");
15781
+ var _a, _b;
15781
15782
  if (options.order !== void 0) {
15782
- const pane = "order-" + options.order;
15783
+ const order = options.order;
15784
+ const pane = "order-" + order;
15783
15785
  let exist = map.getPane(pane);
15784
15786
  if (!exist) {
15785
15787
  exist = map.createPane(pane);
15788
+ const nextPane = (_a = Object.entries(map.getPanes()).filter(([name]) => name.startsWith("order-")).map(([name, element]) => ({
15789
+ element,
15790
+ order: Number(name.slice("order-".length))
15791
+ })).filter((candidate) => candidate.order > order).sort((a, b) => a.order - b.order)[0]) == null ? void 0 : _a.element;
15792
+ if (nextPane) {
15793
+ (_b = exist.parentElement) == null ? void 0 : _b.insertBefore(exist, nextPane);
15794
+ }
15786
15795
  }
15787
- exist.style.zIndex = String(Math.round(options.order * 100));
15796
+ exist.style.zIndex = String(Math.round(order * 100));
15788
15797
  this.pane = pane;
15789
15798
  }
15790
15799
  }
@@ -21263,7 +21272,7 @@ __publicField$s(_Cache, "instance", {});
21263
21272
  let Cache = _Cache;
21264
21273
 
21265
21274
  var pkg = {
21266
- version: "4.0.0-rc.2"};
21275
+ version: "4.0.0"};
21267
21276
 
21268
21277
  class AbortError extends Error {
21269
21278
  constructor(message = "AbortError") {