maplibre-gl-layer-control 0.3.0 → 0.4.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.
@@ -56,6 +56,8 @@ export declare class LayerControl implements IControl {
56
56
  private styleEditors;
57
57
  private minPanelWidth;
58
58
  private maxPanelWidth;
59
+ private showStyleEditor;
60
+ private showOpacitySlider;
59
61
  private widthSliderEl;
60
62
  private widthThumbEl;
61
63
  private widthValueEl;
@@ -77,6 +79,11 @@ export declare class LayerControl implements IControl {
77
79
  * Auto-detect layers from the map and populate layerStates
78
80
  */
79
81
  private autoDetectLayers;
82
+ /**
83
+ * Get the source IDs that were part of the original style (from the style URL)
84
+ * Sources added via map.addSource() are considered user-added
85
+ */
86
+ private getOriginalStyleSourceIds;
80
87
  /**
81
88
  * Generate a friendly display name from a layer ID
82
89
  */
@@ -93,6 +100,14 @@ export declare class LayerControl implements IControl {
93
100
  * Create the panel element
94
101
  */
95
102
  private createPanel;
103
+ /**
104
+ * Create action buttons for Show All / Hide All
105
+ */
106
+ private createActionButtons;
107
+ /**
108
+ * Set visibility of all layers
109
+ */
110
+ private setAllLayersVisibility;
96
111
  /**
97
112
  * Create the panel header with title and width control
98
113
  */
@@ -270,7 +285,7 @@ export declare class LayerControl implements IControl {
270
285
  */
271
286
  private updateUIForLayer;
272
287
  /**
273
- * Check for new layers and add them to the control
288
+ * Check for new layers and add them to the control, remove deleted layers
274
289
  */
275
290
  private checkForNewLayers;
276
291
  }
@@ -291,6 +306,10 @@ export declare interface LayerControlOptions {
291
306
  panelMinWidth?: number;
292
307
  /** Maximum panel width in pixels (default: 420) */
293
308
  panelMaxWidth?: number;
309
+ /** Whether to show the style editor button (gear icon) for layers (default: true) */
310
+ showStyleEditor?: boolean;
311
+ /** Whether to show the opacity slider for layers (default: true) */
312
+ showOpacitySlider?: boolean;
294
313
  }
295
314
 
296
315
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maplibre-gl-layer-control",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "A comprehensive layer control for MapLibre GL with advanced styling capabilities",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",