maplibre-gl-layer-control-tidop 0.0.15 → 0.0.17

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,10 +1272,11 @@ 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
+ const input = document.createElement("input");
1276
+ input.id = "layer-control-panel-layer-id";
1277
+ input.className = "layer-control-panel-layer-id";
1278
+ input.value = "";
1279
+ header.appendChild(input);
1279
1280
  const widthControl = this.createWidthControl();
1280
1281
  header.appendChild(widthControl);
1281
1282
  return header;
@@ -2134,16 +2135,18 @@ class LayerControl {
2134
2135
  */
2135
2136
  toggleStyleEditor(layerId) {
2136
2137
  if (this.state.activeStyleEditor === layerId) {
2137
- var el = document.getElementById("layer-control-panel-layer-id");
2138
- console.log(el);
2138
+ var el = this.panel.querySelector(".layer-control-panel-layer-id");
2139
+ if (el)
2140
+ el.textContent = "";
2139
2141
  this.closeStyleEditor(layerId);
2140
2142
  return;
2141
2143
  }
2142
2144
  if (this.state.activeStyleEditor) {
2143
2145
  this.closeStyleEditor(this.state.activeStyleEditor);
2144
2146
  }
2145
- var el = document.getElementById("layer-control-panel-layer-id");
2146
- console.log(el);
2147
+ var el = this.panel.querySelector(".layer-control-panel-layer-id");
2148
+ if (el)
2149
+ el.textContent = layerId;
2147
2150
  this.openStyleEditor(layerId);
2148
2151
  }
2149
2152
  /**