maplibre-gl-layer-control-tidop 0.0.14 → 0.0.16

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/dist/index.cjs CHANGED
@@ -1272,6 +1272,10 @@ class LayerControl {
1272
1272
  title.className = "layer-control-panel-title";
1273
1273
  title.textContent = "Layers";
1274
1274
  header.appendChild(title);
1275
+ const span = document.createElement("span");
1276
+ span.id = "layer-control-panel-layer-id";
1277
+ span.className = "layer-control-panel-layer-id";
1278
+ header.appendChild(span);
1275
1279
  const widthControl = this.createWidthControl();
1276
1280
  header.appendChild(widthControl);
1277
1281
  return header;
@@ -2130,12 +2134,18 @@ class LayerControl {
2130
2134
  */
2131
2135
  toggleStyleEditor(layerId) {
2132
2136
  if (this.state.activeStyleEditor === layerId) {
2137
+ var el = this.panel.querySelector(".layer-control-panel-title");
2138
+ if (el)
2139
+ el.innerHTML = "";
2133
2140
  this.closeStyleEditor(layerId);
2134
2141
  return;
2135
2142
  }
2136
2143
  if (this.state.activeStyleEditor) {
2137
2144
  this.closeStyleEditor(this.state.activeStyleEditor);
2138
2145
  }
2146
+ var el = this.panel.querySelector(".layer-control-panel-title");
2147
+ if (el)
2148
+ el.innerHTML = layerId;
2139
2149
  this.openStyleEditor(layerId);
2140
2150
  }
2141
2151
  /**