@nextgis/leaflet-map-adapter 4.0.0-rc.2 → 4.0.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Leaflet Map Adapter
2
2
 
3
- ![size](https://img.shields.io/bundlephobia/minzip/@nextgis/leaflet-map-adapter) ![version](https://img.shields.io/npm/v/@nextgis/leaflet-map-adapter)
3
+ ![version](https://img.shields.io/npm/v/@nextgis/leaflet-map-adapter)
4
4
 
5
5
  WebMap adapter to use [Leaflet](https://leafletjs.com/) GIS framework.
6
6
 
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/leaflet-map-adapter; version: 4.0.0-rc.2; author: NextGIS */
1
+ /** Bundle of @nextgis/leaflet-map-adapter; version: 4.0.1; author: NextGIS */
2
2
  function getElement(el) {
3
3
  if (typeof el === "string") {
4
4
  let el_ = document.getElementById(el);
@@ -15494,13 +15494,22 @@ class BaseAdapter {
15494
15494
  __publicField$8(this, "options", options);
15495
15495
  __publicField$8(this, "layer");
15496
15496
  __publicField$8(this, "pane", "order-0");
15497
+ var _a, _b;
15497
15498
  if (options.order !== void 0) {
15498
- const pane = "order-" + options.order;
15499
+ const order = options.order;
15500
+ const pane = "order-" + order;
15499
15501
  let exist = map.getPane(pane);
15500
15502
  if (!exist) {
15501
15503
  exist = map.createPane(pane);
15504
+ const nextPane = (_a = Object.entries(map.getPanes()).filter(([name]) => name.startsWith("order-")).map(([name, element]) => ({
15505
+ element,
15506
+ order: Number(name.slice("order-".length))
15507
+ })).filter((candidate) => candidate.order > order).sort((a, b) => a.order - b.order)[0]) == null ? void 0 : _a.element;
15508
+ if (nextPane) {
15509
+ (_b = exist.parentElement) == null ? void 0 : _b.insertBefore(exist, nextPane);
15510
+ }
15502
15511
  }
15503
- exist.style.zIndex = String(Math.round(options.order * 100));
15512
+ exist.style.zIndex = String(Math.round(order * 100));
15504
15513
  this.pane = pane;
15505
15514
  }
15506
15515
  }