maplibre-gl-layer-control 0.10.0 → 0.11.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.
package/dist/index.cjs CHANGED
@@ -2209,6 +2209,17 @@ class LayerControl {
2209
2209
  e.stopPropagation();
2210
2210
  this.resetLayerStyle(layerId);
2211
2211
  });
2212
+ const removeBtn = document.createElement("button");
2213
+ removeBtn.className = "style-editor-button style-editor-button-remove";
2214
+ removeBtn.textContent = "Remove";
2215
+ removeBtn.title = "Remove layer from map";
2216
+ removeBtn.addEventListener("click", (e) => {
2217
+ e.stopPropagation();
2218
+ if (confirm("Are you sure you want to remove this layer?")) {
2219
+ this.closeStyleEditor(layerId);
2220
+ this.removeLayer(layerId);
2221
+ }
2222
+ });
2212
2223
  const closeActionBtn = document.createElement("button");
2213
2224
  closeActionBtn.className = "style-editor-button style-editor-button-close";
2214
2225
  closeActionBtn.textContent = "Close";
@@ -2217,6 +2228,7 @@ class LayerControl {
2217
2228
  this.closeStyleEditor(layerId);
2218
2229
  });
2219
2230
  actions.appendChild(resetBtn);
2231
+ actions.appendChild(removeBtn);
2220
2232
  actions.appendChild(closeActionBtn);
2221
2233
  editor.appendChild(header);
2222
2234
  editor.appendChild(controls);