@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
  import LeafletMapAdapter from '@nextgis/leaflet-map-adapter';
3
3
  import { NgwMap } from '@nextgis/ngw-map';
4
4
  import { Icon } from 'leaflet';
@@ -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
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -15781,13 +15781,22 @@ var NgwLeaflet = (function () {
15781
15781
  __publicField$K(this, "options", options);
15782
15782
  __publicField$K(this, "layer");
15783
15783
  __publicField$K(this, "pane", "order-0");
15784
+ var _a, _b;
15784
15785
  if (options.order !== void 0) {
15785
- const pane = "order-" + options.order;
15786
+ const order = options.order;
15787
+ const pane = "order-" + order;
15786
15788
  let exist = map.getPane(pane);
15787
15789
  if (!exist) {
15788
15790
  exist = map.createPane(pane);
15791
+ const nextPane = (_a = Object.entries(map.getPanes()).filter(([name]) => name.startsWith("order-")).map(([name, element]) => ({
15792
+ element,
15793
+ order: Number(name.slice("order-".length))
15794
+ })).filter((candidate) => candidate.order > order).sort((a, b) => a.order - b.order)[0]) == null ? void 0 : _a.element;
15795
+ if (nextPane) {
15796
+ (_b = exist.parentElement) == null ? void 0 : _b.insertBefore(exist, nextPane);
15797
+ }
15789
15798
  }
15790
- exist.style.zIndex = String(Math.round(options.order * 100));
15799
+ exist.style.zIndex = String(Math.round(order * 100));
15791
15800
  this.pane = pane;
15792
15801
  }
15793
15802
  }
@@ -21266,7 +21275,7 @@ var NgwLeaflet = (function () {
21266
21275
  let Cache = _Cache;
21267
21276
 
21268
21277
  var pkg = {
21269
- version: "4.0.0-rc.2"};
21278
+ version: "4.0.0"};
21270
21279
 
21271
21280
  class AbortError extends Error {
21272
21281
  constructor(message = "AbortError") {