maplibre-gl-layer-control 0.16.0 → 0.17.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/README.md +5 -5
- package/dist/index.cjs +38 -175
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +38 -175
- package/dist/index.mjs.map +1 -1
- package/dist/maplibre-gl-layer-control.css +0 -57
- package/dist/types/index.d.ts +10 -26
- package/package.json +1 -1
|
@@ -61,63 +61,6 @@
|
|
|
61
61
|
font-size: 13px;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
/* Width control */
|
|
65
|
-
.layer-control-width-control {
|
|
66
|
-
display: flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
gap: 6px;
|
|
69
|
-
font-weight: 500;
|
|
70
|
-
font-size: 11px;
|
|
71
|
-
color: #5c6a7d;
|
|
72
|
-
flex-shrink: 0;
|
|
73
|
-
margin-left: auto;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.layer-control-width-slider {
|
|
77
|
-
position: relative;
|
|
78
|
-
width: 130px;
|
|
79
|
-
height: 16px;
|
|
80
|
-
border-radius: 8px;
|
|
81
|
-
cursor: ew-resize;
|
|
82
|
-
display: flex;
|
|
83
|
-
align-items: center;
|
|
84
|
-
justify-content: center;
|
|
85
|
-
touch-action: none;
|
|
86
|
-
background: transparent;
|
|
87
|
-
padding: 0 8px;
|
|
88
|
-
box-sizing: border-box;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.layer-control-width-value {
|
|
92
|
-
min-width: 44px;
|
|
93
|
-
text-align: right;
|
|
94
|
-
font-feature-settings: "tnum";
|
|
95
|
-
color: #3a4756;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.layer-control-width-track {
|
|
99
|
-
position: absolute;
|
|
100
|
-
left: 8px;
|
|
101
|
-
right: 8px;
|
|
102
|
-
height: 4px;
|
|
103
|
-
border-radius: 2px;
|
|
104
|
-
background: linear-gradient(90deg, #d0d7e2, #2f6fed);
|
|
105
|
-
pointer-events: none;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.layer-control-width-thumb {
|
|
109
|
-
position: absolute;
|
|
110
|
-
top: 50%;
|
|
111
|
-
width: 14px;
|
|
112
|
-
height: 14px;
|
|
113
|
-
border-radius: 50%;
|
|
114
|
-
background: #fff;
|
|
115
|
-
border: 2px solid #2f6fed;
|
|
116
|
-
transform: translateY(-50%);
|
|
117
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
|
|
118
|
-
pointer-events: none;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
64
|
/* Edge resize handle — drag the panel edge to resize its width */
|
|
122
65
|
.layer-control-resize-handle {
|
|
123
66
|
position: absolute;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -250,6 +250,7 @@ export declare class LayerControl implements IControl {
|
|
|
250
250
|
private minPanelWidth;
|
|
251
251
|
private maxPanelWidth;
|
|
252
252
|
private initialPanelWidth;
|
|
253
|
+
/** Explicit max panel height; null means fill available vertical space */
|
|
253
254
|
private maxPanelHeight;
|
|
254
255
|
private showStyleEditor;
|
|
255
256
|
private showOpacitySlider;
|
|
@@ -262,13 +263,6 @@ export declare class LayerControl implements IControl {
|
|
|
262
263
|
private nativeLayerGroups;
|
|
263
264
|
private basemapStyleUrl;
|
|
264
265
|
private basemapLayerIds;
|
|
265
|
-
private widthSliderEl;
|
|
266
|
-
private widthThumbEl;
|
|
267
|
-
private widthValueEl;
|
|
268
|
-
private isWidthSliderActive;
|
|
269
|
-
private widthDragRectWidth;
|
|
270
|
-
private widthDragStartX;
|
|
271
|
-
private widthDragStartWidth;
|
|
272
266
|
private widthFrame;
|
|
273
267
|
private opacityInputEl;
|
|
274
268
|
private resizeHandleEls;
|
|
@@ -399,29 +393,14 @@ export declare class LayerControl implements IControl {
|
|
|
399
393
|
*/
|
|
400
394
|
private setAllLayersVisibility;
|
|
401
395
|
/**
|
|
402
|
-
* Create the panel header with title
|
|
396
|
+
* Create the panel header with the title. Panel width is adjusted by
|
|
397
|
+
* dragging either edge of the panel (see createResizeHandle).
|
|
403
398
|
*/
|
|
404
399
|
private createPanelHeader;
|
|
405
|
-
/**
|
|
406
|
-
* Create the width control slider
|
|
407
|
-
*/
|
|
408
|
-
private createWidthControl;
|
|
409
|
-
/**
|
|
410
|
-
* Setup event listeners for width slider
|
|
411
|
-
*/
|
|
412
|
-
private setupWidthSliderEvents;
|
|
413
|
-
/**
|
|
414
|
-
* Update panel width from pointer event
|
|
415
|
-
*/
|
|
416
|
-
private updateWidthFromPointer;
|
|
417
400
|
/**
|
|
418
401
|
* Apply panel width (clamped to min/max)
|
|
419
402
|
*/
|
|
420
403
|
private applyPanelWidth;
|
|
421
|
-
/**
|
|
422
|
-
* Update width display (value label and thumb position)
|
|
423
|
-
*/
|
|
424
|
-
private updateWidthDisplay;
|
|
425
404
|
/**
|
|
426
405
|
* Setup main event listeners
|
|
427
406
|
*/
|
|
@@ -801,7 +780,7 @@ export declare interface LayerControlOptions {
|
|
|
801
780
|
panelWidth?: number;
|
|
802
781
|
/** Minimum panel width in pixels (default: 240) */
|
|
803
782
|
panelMinWidth?: number;
|
|
804
|
-
/** Maximum panel width in pixels (default:
|
|
783
|
+
/** Maximum panel width in pixels (default: 960) */
|
|
805
784
|
panelMaxWidth?: number;
|
|
806
785
|
/** Whether to show the style editor button (gear icon) for layers (default: true) */
|
|
807
786
|
showStyleEditor?: boolean;
|
|
@@ -809,7 +788,12 @@ export declare interface LayerControlOptions {
|
|
|
809
788
|
showOpacitySlider?: boolean;
|
|
810
789
|
/** Whether to show layer type symbols/icons next to layer names (default: true) */
|
|
811
790
|
showLayerSymbol?: boolean;
|
|
812
|
-
/**
|
|
791
|
+
/**
|
|
792
|
+
* Maximum panel height in pixels. When omitted, the panel grows to fill the
|
|
793
|
+
* available vertical space in the map container and only becomes scrollable
|
|
794
|
+
* once the layer list is taller than that space. Set an explicit value to
|
|
795
|
+
* cap the height instead.
|
|
796
|
+
*/
|
|
813
797
|
panelMaxHeight?: number;
|
|
814
798
|
/** Whether to exclude drawn layers from drawing libraries like Geoman, Mapbox GL Draw, etc. (default: true) */
|
|
815
799
|
excludeDrawnLayers?: boolean;
|