maplibre-gl-layer-control 0.18.0 → 0.18.2

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.
@@ -282,6 +282,23 @@ export declare function getLayerColorFromSpec(layer: LayerSpecification): string
282
282
  */
283
283
  export declare function getLayerOpacity(map: Map_2, layerId: string, layerType: string): number;
284
284
 
285
+ /**
286
+ * Get additional symbol styles from runtime paint properties, falling back to
287
+ * the layer definition when a runtime property is unavailable
288
+ * @param map The MapLibre map instance
289
+ * @param layerId The layer ID
290
+ * @param layerType The layer type
291
+ * @returns The resolved dash pattern or circle border style
292
+ */
293
+ export declare function getLayerSymbolStyle(map: Map_2, layerId: string, layerType: string): LayerSymbolStyle;
294
+
295
+ /**
296
+ * Get additional symbol styles directly from a layer specification
297
+ * @param layer The layer specification
298
+ * @returns The resolved dash pattern or circle border style
299
+ */
300
+ export declare function getLayerSymbolStyleFromSpec(layer: LayerSpecification): LayerSymbolStyle;
301
+
285
302
  /**
286
303
  * Get layer type from map
287
304
  * @param map MapLibre map instance
@@ -1109,12 +1126,23 @@ export declare interface LayerStates {
1109
1126
  }
1110
1127
 
1111
1128
  /**
1112
- * Normalize a color value to hex format
1113
- * Handles hex strings, RGB strings, and RGB arrays
1114
- * @param value Color value in various formats
1115
- * @returns Normalized hex color string (always 6 digits)
1129
+ * Additional paint properties that affect a layer's preview symbol.
1130
+ */
1131
+ export declare interface LayerSymbolStyle {
1132
+ /** line-dasharray in line-width units. */
1133
+ dasharray?: number[];
1134
+ /** Circle border colour; null disables the border. */
1135
+ strokeColor?: string | null;
1136
+ }
1137
+
1138
+ /**
1139
+ * Normalize a color value to six-digit RGB hex.
1140
+ * String values are parsed as CSS colors; numeric arrays use RGB byte channels.
1141
+ * Alpha channels are ignored.
1142
+ * @param value Color value in CSS string or RGB(A) array format
1143
+ * @returns Normalized hex color string, or null when the value is invalid
1116
1144
  */
1117
- export declare function normalizeColor(value: any): string;
1145
+ export declare function normalizeColor(value: unknown): string | null;
1118
1146
 
1119
1147
  /**
1120
1148
  * Paint properties for different layer types
@@ -1191,6 +1219,10 @@ export declare interface SymbolOptions {
1191
1219
  size?: number;
1192
1220
  /** Stroke width for line symbols (default: 2) */
1193
1221
  strokeWidth?: number;
1222
+ /** line-dasharray in line-width units; rendered to fit the line swatch. */
1223
+ dasharray?: number[];
1224
+ /** Circle border colour; null disables the border. */
1225
+ strokeColor?: string | null;
1194
1226
  }
1195
1227
 
1196
1228
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maplibre-gl-layer-control",
3
- "version": "0.18.0",
3
+ "version": "0.18.2",
4
4
  "description": "A comprehensive layer control for MapLibre GL with advanced styling capabilities",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -89,5 +89,8 @@
89
89
  "vite": "^6.0.0",
90
90
  "vite-plugin-dts": "^4.3.0",
91
91
  "vitest": "^4.0.17"
92
+ },
93
+ "dependencies": {
94
+ "colord": "2.10.0"
92
95
  }
93
96
  }