@classic-homes/maps-core 0.1.1

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.
@@ -0,0 +1,758 @@
1
+ import { L as LngLat, a as GeoJSONFeature, M as MapBounds, B as BoundsArray, k as MapSourceData, G as GeoJSONFeatureCollection, C as ClusterConfig } from '../data-DDS6ok7I.js';
2
+ export { E as ExtrusionData, e as GeoJSONGeometry, h as GeoJSONLineString, i as GeoJSONMultiLineString, g as GeoJSONMultiPoint, j as GeoJSONMultiPolygon, f as GeoJSONPoint, c as GeoJSONPolygon, H as HeatmapPoint, d as MapViewport, b as MarkerData } from '../data-DDS6ok7I.js';
3
+
4
+ /**
5
+ * Map event types
6
+ */
7
+
8
+ /**
9
+ * Base event parameters shared across all map events
10
+ */
11
+ interface BaseMapEventParams {
12
+ /** Event type identifier */
13
+ type: string;
14
+ /** Original native event (if available) */
15
+ originalEvent?: MouseEvent | TouchEvent;
16
+ /** Whether the event was prevented */
17
+ defaultPrevented?: boolean;
18
+ }
19
+ /**
20
+ * Map click event parameters
21
+ */
22
+ interface MapClickEventParams extends BaseMapEventParams {
23
+ type: 'click' | 'dblclick' | 'contextmenu';
24
+ /** Click coordinates [lng, lat] */
25
+ lngLat: LngLat;
26
+ /** Click position in pixels [x, y] */
27
+ point: [number, number];
28
+ /** Features at the click location (if any) */
29
+ features?: GeoJSONFeature[];
30
+ }
31
+ /**
32
+ * Map hover/move event parameters
33
+ */
34
+ interface MapHoverEventParams extends BaseMapEventParams {
35
+ type: 'mousemove' | 'mouseenter' | 'mouseleave';
36
+ /** Cursor coordinates [lng, lat] */
37
+ lngLat: LngLat;
38
+ /** Cursor position in pixels [x, y] */
39
+ point: [number, number];
40
+ /** Features at the cursor location (if any) */
41
+ features?: GeoJSONFeature[];
42
+ }
43
+ /**
44
+ * Feature click event parameters
45
+ */
46
+ interface FeatureClickEventParams extends BaseMapEventParams {
47
+ type: 'click' | 'dblclick' | 'contextmenu';
48
+ /** Clicked feature */
49
+ feature: GeoJSONFeature;
50
+ /** Feature ID */
51
+ featureId?: string | number;
52
+ /** Layer ID containing the feature */
53
+ layerId: string;
54
+ /** Source ID */
55
+ sourceId: string;
56
+ /** Click coordinates [lng, lat] */
57
+ lngLat: LngLat;
58
+ /** Click position in pixels [x, y] */
59
+ point: [number, number];
60
+ }
61
+ /**
62
+ * Feature hover event parameters
63
+ */
64
+ interface FeatureHoverEventParams extends BaseMapEventParams {
65
+ type: 'mouseenter' | 'mousemove' | 'mouseleave';
66
+ /** Hovered feature (null on mouseleave) */
67
+ feature: GeoJSONFeature | null;
68
+ /** Feature ID */
69
+ featureId?: string | number;
70
+ /** Layer ID containing the feature */
71
+ layerId: string;
72
+ /** Source ID */
73
+ sourceId: string;
74
+ /** Cursor coordinates [lng, lat] */
75
+ lngLat: LngLat;
76
+ /** Cursor position in pixels [x, y] */
77
+ point: [number, number];
78
+ }
79
+ /**
80
+ * Marker click event parameters
81
+ */
82
+ interface MarkerClickEventParams extends BaseMapEventParams {
83
+ type: 'click';
84
+ /** Marker ID */
85
+ markerId: string;
86
+ /** Marker coordinates [lng, lat] */
87
+ lngLat: LngLat;
88
+ /** Marker properties */
89
+ properties?: Record<string, unknown>;
90
+ }
91
+ /**
92
+ * Marker drag event parameters
93
+ */
94
+ interface MarkerDragEventParams extends BaseMapEventParams {
95
+ type: 'dragstart' | 'drag' | 'dragend';
96
+ /** Marker ID */
97
+ markerId: string;
98
+ /** Current marker coordinates [lng, lat] */
99
+ lngLat: LngLat;
100
+ /** Original marker coordinates (at drag start) [lng, lat] */
101
+ originalLngLat?: LngLat;
102
+ }
103
+ /**
104
+ * Map load event parameters
105
+ */
106
+ interface MapLoadEventParams {
107
+ type: 'load' | 'style.load' | 'idle';
108
+ /** Whether the map is fully loaded */
109
+ loaded: boolean;
110
+ }
111
+ /**
112
+ * Map move/zoom event parameters
113
+ */
114
+ interface MapMoveEventParams extends BaseMapEventParams {
115
+ type: 'move' | 'movestart' | 'moveend' | 'zoom' | 'zoomstart' | 'zoomend' | 'pitch' | 'rotate';
116
+ /** Current center [lng, lat] */
117
+ center: LngLat;
118
+ /** Current zoom level */
119
+ zoom: number;
120
+ /** Current bearing in degrees */
121
+ bearing: number;
122
+ /** Current pitch in degrees */
123
+ pitch: number;
124
+ /** Whether the movement was user-initiated */
125
+ isUserInteraction?: boolean;
126
+ /** Current viewport bounds */
127
+ bounds?: MapBounds;
128
+ }
129
+ /**
130
+ * Popup event parameters
131
+ */
132
+ interface PopupEventParams {
133
+ type: 'open' | 'close';
134
+ /** Popup coordinates [lng, lat] */
135
+ lngLat: LngLat;
136
+ }
137
+ /**
138
+ * Error event parameters
139
+ */
140
+ interface MapErrorEventParams {
141
+ type: 'error';
142
+ /** Error message */
143
+ message: string;
144
+ /** Error source (e.g., 'tile', 'source', 'layer') */
145
+ source?: string;
146
+ /** Original error object */
147
+ error?: Error;
148
+ }
149
+
150
+ /**
151
+ * Map component prop types
152
+ */
153
+ /**
154
+ * Position for map controls
155
+ */
156
+ type ControlPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
157
+
158
+ /**
159
+ * Base map props shared across all map components
160
+ */
161
+ interface BaseMapProps {
162
+ /** Map title - required for accessibility (used as aria-label) */
163
+ title: string;
164
+ /** Optional description for screen readers */
165
+ description?: string;
166
+ /** Map width (CSS value or number in pixels) */
167
+ width?: number | string;
168
+ /** Map height (CSS value or number in pixels) */
169
+ height?: number | string;
170
+ /** Minimum height constraint */
171
+ minHeight?: number;
172
+ /** Maximum height constraint */
173
+ maxHeight?: number;
174
+ /** Show loading skeleton */
175
+ loading?: boolean;
176
+ /** Error message to display */
177
+ error?: string | null;
178
+ /** Message shown when no data/features */
179
+ emptyMessage?: string;
180
+ /** Theme preference */
181
+ theme?: 'light' | 'dark' | 'auto';
182
+ /** Enable/disable animations (respects prefers-reduced-motion) */
183
+ animation?: boolean;
184
+ /** Custom CSS class */
185
+ class?: string;
186
+ }
187
+ /**
188
+ * Map style specification
189
+ */
190
+ interface MapStyleSpec {
191
+ version: 8;
192
+ name?: string;
193
+ sources: Record<string, unknown>;
194
+ layers: unknown[];
195
+ [key: string]: unknown;
196
+ }
197
+ /**
198
+ * Main Map component props
199
+ */
200
+ interface MapProps extends BaseMapProps {
201
+ /** Map style URL or style spec object */
202
+ style?: string | MapStyleSpec;
203
+ /** Initial center coordinates [lng, lat] */
204
+ center?: LngLat;
205
+ /** Initial zoom level (0-24) */
206
+ zoom?: number;
207
+ /** Initial bearing/rotation in degrees */
208
+ bearing?: number;
209
+ /** Initial pitch/tilt in degrees */
210
+ pitch?: number;
211
+ /** Fit map to these bounds on load */
212
+ bounds?: BoundsArray;
213
+ /** Padding when fitting to bounds */
214
+ boundsPadding?: number | {
215
+ top: number;
216
+ right: number;
217
+ bottom: number;
218
+ left: number;
219
+ };
220
+ /** Minimum zoom level */
221
+ minZoom?: number;
222
+ /** Maximum zoom level */
223
+ maxZoom?: number;
224
+ /** Maximum bounds the map can pan to */
225
+ maxBounds?: BoundsArray;
226
+ /** Enable map interactions (scroll zoom, drag, etc.) */
227
+ interactive?: boolean;
228
+ /** Enable scroll zoom */
229
+ scrollZoom?: boolean;
230
+ /** Enable drag pan */
231
+ dragPan?: boolean;
232
+ /** Enable drag rotate */
233
+ dragRotate?: boolean;
234
+ /** Enable double click zoom */
235
+ doubleClickZoom?: boolean;
236
+ /** Enable touch zoom/rotate */
237
+ touchZoomRotate?: boolean;
238
+ /** Enable keyboard navigation */
239
+ keyboard?: boolean;
240
+ /** Show attribution control */
241
+ attributionControl?: boolean;
242
+ /** Custom attribution text */
243
+ customAttribution?: string;
244
+ /** Show navigation control */
245
+ navigationControl?: boolean;
246
+ /** Navigation control position */
247
+ navigationControlPosition?: ControlPosition;
248
+ /** Show scale control */
249
+ scaleControl?: boolean;
250
+ /** Scale control position */
251
+ scaleControlPosition?: ControlPosition;
252
+ /** Show fullscreen control */
253
+ fullscreenControl?: boolean;
254
+ /** Fullscreen control position */
255
+ fullscreenControlPosition?: ControlPosition;
256
+ /** Show geolocate control */
257
+ geolocateControl?: boolean;
258
+ /** Geolocate control position */
259
+ geolocateControlPosition?: ControlPosition;
260
+ /** Callback when map loads */
261
+ onLoad?: (params: MapLoadEventParams) => void;
262
+ /** Callback for map click */
263
+ onClick?: (params: MapClickEventParams) => void;
264
+ /** Callback for map double click */
265
+ onDblClick?: (params: MapClickEventParams) => void;
266
+ /** Callback for map right click */
267
+ onContextMenu?: (params: MapClickEventParams) => void;
268
+ /** Callback for mouse move */
269
+ onMouseMove?: (params: MapHoverEventParams) => void;
270
+ /** Callback for map move/pan */
271
+ onMove?: (params: MapMoveEventParams) => void;
272
+ /** Callback when move starts */
273
+ onMoveStart?: (params: MapMoveEventParams) => void;
274
+ /** Callback when move ends */
275
+ onMoveEnd?: (params: MapMoveEventParams) => void;
276
+ /** Callback for zoom change */
277
+ onZoom?: (params: MapMoveEventParams) => void;
278
+ /** Callback for map errors */
279
+ onError?: (params: MapErrorEventParams) => void;
280
+ }
281
+ /**
282
+ * Source component props
283
+ */
284
+ interface SourceProps {
285
+ /** Unique source ID */
286
+ id: string;
287
+ /** Source type */
288
+ type: 'geojson' | 'vector' | 'raster' | 'raster-dem' | 'image' | 'video';
289
+ /** Source data (for GeoJSON sources) */
290
+ data?: MapSourceData | GeoJSONFeatureCollection | string;
291
+ /** Tile URL template (for vector/raster sources) */
292
+ tiles?: string[];
293
+ /** TileJSON URL */
294
+ url?: string;
295
+ /** Tile size (default: 512) */
296
+ tileSize?: number;
297
+ /** Attribution text */
298
+ attribution?: string;
299
+ /** Enable clustering (GeoJSON only) */
300
+ cluster?: boolean | ClusterConfig;
301
+ /** Cluster radius (GeoJSON only) */
302
+ clusterRadius?: number;
303
+ /** Max zoom for clustering (GeoJSON only) */
304
+ clusterMaxZoom?: number;
305
+ /** Generate feature IDs (GeoJSON only) */
306
+ generateId?: boolean;
307
+ /** Promote feature ID to property (GeoJSON only) */
308
+ promoteId?: string;
309
+ /** Fit map to this source's bounds when data is loaded (GeoJSON only) */
310
+ fitBounds?: boolean;
311
+ /** Padding when fitting to bounds (pixels) */
312
+ fitBoundsPadding?: number | {
313
+ top: number;
314
+ right: number;
315
+ bottom: number;
316
+ left: number;
317
+ };
318
+ /** Maximum zoom level when fitting (prevents over-zoom on sparse data) */
319
+ fitBoundsMaxZoom?: number;
320
+ /** Animate when fitting (default: true, respects prefers-reduced-motion) */
321
+ fitBoundsAnimate?: boolean;
322
+ }
323
+ /**
324
+ * Base layer props
325
+ */
326
+ interface BaseLayerProps {
327
+ /** Unique layer ID */
328
+ id: string;
329
+ /** Source ID this layer uses */
330
+ source: string;
331
+ /** Source layer (for vector tile sources) */
332
+ sourceLayer?: string;
333
+ /** Layer visibility */
334
+ visible?: boolean;
335
+ /** Layer opacity (0-1) */
336
+ opacity?: number;
337
+ /** Minimum zoom level for this layer */
338
+ minZoom?: number;
339
+ /** Maximum zoom level for this layer */
340
+ maxZoom?: number;
341
+ /** Filter expression for features */
342
+ filter?: unknown[];
343
+ /** Insert this layer before another layer */
344
+ beforeId?: string;
345
+ /** Callback for feature click */
346
+ onClick?: (params: FeatureClickEventParams) => void;
347
+ /** Callback for feature hover */
348
+ onHover?: (params: FeatureHoverEventParams) => void;
349
+ /**
350
+ * Throttle interval for onHover callback in milliseconds.
351
+ * Set to 0 (default) for no throttling.
352
+ * Feature-state updates for visual hover effects remain immediate.
353
+ * Only the callback invocation is throttled.
354
+ *
355
+ * @example
356
+ * // Throttle hover callbacks to max 10 per second
357
+ * hoverThrottleMs={100}
358
+ */
359
+ hoverThrottleMs?: number;
360
+ }
361
+ /**
362
+ * Fill layer props (for polygons)
363
+ */
364
+ interface FillLayerProps extends BaseLayerProps {
365
+ /** Fill color */
366
+ fillColor?: string | unknown[];
367
+ /** Fill opacity (0-1) */
368
+ fillOpacity?: number | unknown[];
369
+ /** Fill outline color */
370
+ fillOutlineColor?: string | unknown[];
371
+ /** Fill pattern (sprite image name) */
372
+ fillPattern?: string;
373
+ /** Translate fill geometry */
374
+ fillTranslate?: [number, number];
375
+ /** Fill antialias */
376
+ fillAntialias?: boolean;
377
+ }
378
+ /**
379
+ * Line layer props
380
+ */
381
+ interface LineLayerProps extends BaseLayerProps {
382
+ /** Line color */
383
+ lineColor?: string | unknown[];
384
+ /** Line width in pixels */
385
+ lineWidth?: number | unknown[];
386
+ /** Line opacity (0-1) */
387
+ lineOpacity?: number | unknown[];
388
+ /** Line blur */
389
+ lineBlur?: number;
390
+ /** Line cap style */
391
+ lineCap?: 'butt' | 'round' | 'square';
392
+ /** Line join style */
393
+ lineJoin?: 'bevel' | 'round' | 'miter';
394
+ /** Line dash pattern */
395
+ lineDasharray?: number[];
396
+ /** Line gap width */
397
+ lineGapWidth?: number;
398
+ /** Line offset */
399
+ lineOffset?: number;
400
+ /** Line gradient (for line-gradient property) */
401
+ lineGradient?: unknown[];
402
+ }
403
+ /**
404
+ * Circle layer props (for points)
405
+ */
406
+ interface CircleLayerProps extends BaseLayerProps {
407
+ /** Circle radius in pixels */
408
+ circleRadius?: number | unknown[];
409
+ /** Circle color */
410
+ circleColor?: string | unknown[];
411
+ /** Circle opacity (0-1) */
412
+ circleOpacity?: number | unknown[];
413
+ /** Circle stroke width */
414
+ circleStrokeWidth?: number | unknown[];
415
+ /** Circle stroke color */
416
+ circleStrokeColor?: string | unknown[];
417
+ /** Circle stroke opacity */
418
+ circleStrokeOpacity?: number | unknown[];
419
+ /** Circle blur */
420
+ circleBlur?: number;
421
+ /** Circle pitch alignment */
422
+ circlePitchAlignment?: 'map' | 'viewport';
423
+ /** Circle pitch scale */
424
+ circlePitchScale?: 'map' | 'viewport';
425
+ /** Circle translate */
426
+ circleTranslate?: [number, number];
427
+ }
428
+ /**
429
+ * Symbol layer props (for icons and text)
430
+ */
431
+ interface SymbolLayerProps extends BaseLayerProps {
432
+ /** Icon image name (from sprite) */
433
+ iconImage?: string | unknown[];
434
+ /** Icon size */
435
+ iconSize?: number | unknown[];
436
+ /** Icon rotation angle */
437
+ iconRotate?: number | unknown[];
438
+ /** Icon offset */
439
+ iconOffset?: [number, number];
440
+ /** Icon anchor */
441
+ iconAnchor?: 'center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
442
+ /** Icon opacity */
443
+ iconOpacity?: number | unknown[];
444
+ /** Icon color (for SDF icons) */
445
+ iconColor?: string | unknown[];
446
+ /** Icon halo color */
447
+ iconHaloColor?: string;
448
+ /** Icon halo width */
449
+ iconHaloWidth?: number;
450
+ /** Allow icon overlap */
451
+ iconAllowOverlap?: boolean;
452
+ /** Ignore icon placement */
453
+ iconIgnorePlacement?: boolean;
454
+ /** Text field content */
455
+ textField?: string | unknown[];
456
+ /** Text font */
457
+ textFont?: string[];
458
+ /** Text size */
459
+ textSize?: number | unknown[];
460
+ /** Text color */
461
+ textColor?: string | unknown[];
462
+ /** Text opacity */
463
+ textOpacity?: number | unknown[];
464
+ /** Text halo color */
465
+ textHaloColor?: string;
466
+ /** Text halo width */
467
+ textHaloWidth?: number;
468
+ /** Text anchor */
469
+ textAnchor?: 'center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
470
+ /** Text offset */
471
+ textOffset?: [number, number];
472
+ /** Text rotation angle */
473
+ textRotate?: number;
474
+ /** Allow text overlap */
475
+ textAllowOverlap?: boolean;
476
+ /** Ignore text placement */
477
+ textIgnorePlacement?: boolean;
478
+ /** Symbol placement */
479
+ symbolPlacement?: 'point' | 'line' | 'line-center';
480
+ /** Symbol spacing */
481
+ symbolSpacing?: number;
482
+ /** Symbol sort key */
483
+ symbolSortKey?: number | unknown[];
484
+ }
485
+ /**
486
+ * Fill extrusion layer props (for 3D buildings)
487
+ */
488
+ interface FillExtrusionLayerProps extends BaseLayerProps {
489
+ /** Extrusion height in meters */
490
+ fillExtrusionHeight?: number | unknown[];
491
+ /** Extrusion base height in meters */
492
+ fillExtrusionBase?: number | unknown[];
493
+ /** Extrusion color */
494
+ fillExtrusionColor?: string | unknown[];
495
+ /** Extrusion opacity (0-1) */
496
+ fillExtrusionOpacity?: number;
497
+ /** Extrusion pattern */
498
+ fillExtrusionPattern?: string;
499
+ /** Translate extrusion geometry */
500
+ fillExtrusionTranslate?: [number, number];
501
+ /** Enable vertical gradient */
502
+ fillExtrusionVerticalGradient?: boolean;
503
+ }
504
+ /**
505
+ * Heatmap layer props
506
+ */
507
+ interface HeatmapLayerProps extends BaseLayerProps {
508
+ /** Heatmap intensity */
509
+ heatmapIntensity?: number | unknown[];
510
+ /** Heatmap weight */
511
+ heatmapWeight?: number | unknown[];
512
+ /** Heatmap color ramp */
513
+ heatmapColor?: unknown[];
514
+ /** Heatmap radius in pixels */
515
+ heatmapRadius?: number | unknown[];
516
+ /** Heatmap opacity */
517
+ heatmapOpacity?: number | unknown[];
518
+ }
519
+ /**
520
+ * Raster layer props
521
+ */
522
+ interface RasterLayerProps extends BaseLayerProps {
523
+ /** Raster opacity */
524
+ rasterOpacity?: number;
525
+ /** Raster hue rotate */
526
+ rasterHueRotate?: number;
527
+ /** Raster brightness min */
528
+ rasterBrightnessMin?: number;
529
+ /** Raster brightness max */
530
+ rasterBrightnessMax?: number;
531
+ /** Raster saturation */
532
+ rasterSaturation?: number;
533
+ /** Raster contrast */
534
+ rasterContrast?: number;
535
+ /** Raster resampling */
536
+ rasterResampling?: 'linear' | 'nearest';
537
+ /** Raster fade duration */
538
+ rasterFadeDuration?: number;
539
+ }
540
+ /**
541
+ * Marker component props
542
+ */
543
+ interface MarkerProps {
544
+ /** Unique marker ID */
545
+ id?: string;
546
+ /** Marker coordinates [lng, lat] */
547
+ coordinates: LngLat;
548
+ /** Marker color */
549
+ color?: string;
550
+ /** Custom anchor point */
551
+ anchor?: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
552
+ /** Offset from coordinates [x, y] in pixels */
553
+ offset?: [number, number];
554
+ /** Marker rotation angle */
555
+ rotation?: number;
556
+ /** Enable dragging */
557
+ draggable?: boolean;
558
+ /** Marker scale */
559
+ scale?: number;
560
+ /** Popup offset */
561
+ popupOffset?: number | [number, number];
562
+ /** Callback for marker click */
563
+ onClick?: (params: MarkerClickEventParams) => void;
564
+ /** Callback for marker drag */
565
+ onDrag?: (params: MarkerDragEventParams) => void;
566
+ /** Callback when drag ends */
567
+ onDragEnd?: (params: MarkerDragEventParams) => void;
568
+ }
569
+ /**
570
+ * Popup component props
571
+ */
572
+ interface PopupProps {
573
+ /** Popup coordinates [lng, lat] */
574
+ coordinates: LngLat;
575
+ /** Show close button */
576
+ closeButton?: boolean;
577
+ /** Close popup on click outside */
578
+ closeOnClick?: boolean;
579
+ /** Close popup when map moves */
580
+ closeOnMove?: boolean;
581
+ /** Popup anchor */
582
+ anchor?: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
583
+ /** Popup offset */
584
+ offset?: number | [number, number];
585
+ /** Maximum width */
586
+ maxWidth?: string;
587
+ /** Focus popup when opened */
588
+ focusAfterOpen?: boolean;
589
+ /** Auto-pan the map to ensure popup is fully visible (default: true) */
590
+ autoPan?: boolean;
591
+ /** Padding around popup when auto-panning (default: 50) */
592
+ autoPanPadding?: number | {
593
+ top: number;
594
+ right: number;
595
+ bottom: number;
596
+ left: number;
597
+ };
598
+ /** Callback when popup opens */
599
+ onOpen?: (params: PopupEventParams) => void;
600
+ /** Callback when popup closes */
601
+ onClose?: (params: PopupEventParams) => void;
602
+ }
603
+ /**
604
+ * Control props shared by all controls
605
+ */
606
+ interface BaseControlProps {
607
+ /** Control position on the map */
608
+ position?: ControlPosition;
609
+ }
610
+ /**
611
+ * Navigation control props
612
+ */
613
+ interface NavigationControlProps extends BaseControlProps {
614
+ /** Show compass */
615
+ showCompass?: boolean;
616
+ /** Show zoom buttons */
617
+ showZoom?: boolean;
618
+ /** Visualize pitch with compass */
619
+ visualizePitch?: boolean;
620
+ }
621
+ /**
622
+ * Scale control props
623
+ */
624
+ interface ScaleControlProps extends BaseControlProps {
625
+ /** Maximum width of scale */
626
+ maxWidth?: number;
627
+ /** Unit system */
628
+ unit?: 'imperial' | 'metric' | 'nautical';
629
+ }
630
+ /**
631
+ * Geolocate control props
632
+ */
633
+ interface GeolocateControlProps extends BaseControlProps {
634
+ /** Track user location */
635
+ trackUserLocation?: boolean;
636
+ /** Show accuracy circle */
637
+ showAccuracyCircle?: boolean;
638
+ /** Show user heading */
639
+ showUserHeading?: boolean;
640
+ /** Position options */
641
+ positionOptions?: {
642
+ enableHighAccuracy?: boolean;
643
+ timeout?: number;
644
+ maximumAge?: number;
645
+ };
646
+ }
647
+ /**
648
+ * Legend item for categorical legends
649
+ */
650
+ interface LegendItem {
651
+ /** Item label */
652
+ label: string;
653
+ /** Item color */
654
+ color: string;
655
+ /** Optional icon name */
656
+ icon?: string;
657
+ /** Optional value (for display) */
658
+ value?: string | number;
659
+ /** Whether the item is active/visible */
660
+ active?: boolean;
661
+ }
662
+ /**
663
+ * Gradient stop for continuous legends
664
+ */
665
+ interface GradientStop {
666
+ /** Position in gradient (0-1) */
667
+ position: number;
668
+ /** Color at this position */
669
+ color: string;
670
+ /** Optional label at this position */
671
+ label?: string;
672
+ }
673
+ /**
674
+ * Legend component props
675
+ */
676
+ interface LegendProps {
677
+ /** Legend title */
678
+ title?: string;
679
+ /** Legend position on the map */
680
+ position?: ControlPosition;
681
+ /** Legend type */
682
+ type?: 'categorical' | 'gradient';
683
+ /** Items for categorical legends */
684
+ items?: LegendItem[];
685
+ /** Gradient stops for continuous legends */
686
+ gradient?: GradientStop[];
687
+ /** Min value label for gradient */
688
+ minLabel?: string;
689
+ /** Max value label for gradient */
690
+ maxLabel?: string;
691
+ /** Whether legend is collapsible */
692
+ collapsible?: boolean;
693
+ /** Whether legend is initially collapsed */
694
+ collapsed?: boolean;
695
+ /** Custom CSS class */
696
+ class?: string;
697
+ /** Callback when item is clicked (for toggling visibility) */
698
+ onItemClick?: (item: LegendItem, index: number) => void;
699
+ }
700
+ /**
701
+ * Coordinate display component props
702
+ */
703
+ interface CoordinateDisplayProps {
704
+ /** Display position on the map */
705
+ position?: ControlPosition;
706
+ /** Coordinate format */
707
+ format?: 'decimal' | 'dms' | 'dd';
708
+ /** Number of decimal places for decimal format */
709
+ precision?: number;
710
+ /** Show zoom level */
711
+ showZoom?: boolean;
712
+ /** Show bearing */
713
+ showBearing?: boolean;
714
+ /** Custom CSS class */
715
+ class?: string;
716
+ }
717
+ /**
718
+ * Legend configuration for use within a LegendGroup
719
+ */
720
+ interface LegendConfig {
721
+ /** Unique identifier for accordion state */
722
+ id: string;
723
+ /** Title displayed in accordion header */
724
+ title: string;
725
+ /** Legend type */
726
+ type?: 'categorical' | 'gradient';
727
+ /** Items for categorical legends */
728
+ items?: LegendItem[];
729
+ /** Gradient stops for continuous legends */
730
+ gradient?: GradientStop[];
731
+ /** Min value label for gradient */
732
+ minLabel?: string;
733
+ /** Max value label for gradient */
734
+ maxLabel?: string;
735
+ /** Callback when item is clicked (for toggling visibility) */
736
+ onItemClick?: (item: LegendItem, index: number) => void;
737
+ }
738
+ /**
739
+ * LegendGroup component props - accordion-style legend container
740
+ */
741
+ interface LegendGroupProps {
742
+ /** Array of legend configurations */
743
+ legends: LegendConfig[];
744
+ /** Position on the map */
745
+ position?: ControlPosition;
746
+ /** ID of initially expanded legend (defaults to first) */
747
+ defaultExpanded?: string;
748
+ /** Controlled expanded state (null means none expanded) */
749
+ expanded?: string | null;
750
+ /** Callback when expanded legend changes */
751
+ onExpandedChange?: (id: string | null) => void;
752
+ /** Allow collapsing all (default: false - one always open) */
753
+ allowCollapseAll?: boolean;
754
+ /** Custom CSS class */
755
+ class?: string;
756
+ }
757
+
758
+ export { type BaseControlProps, type BaseLayerProps, type BaseMapEventParams, type BaseMapProps, BoundsArray, type CircleLayerProps, ClusterConfig, type ControlPosition, type CoordinateDisplayProps, type FeatureClickEventParams, type FeatureHoverEventParams, type FillExtrusionLayerProps, type FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, type GeolocateControlProps, type GradientStop, type HeatmapLayerProps, type LegendConfig, type LegendGroupProps, type LegendItem, type LegendProps, type LineLayerProps, LngLat, MapBounds, type MapClickEventParams, type MapErrorEventParams, type MapHoverEventParams, type MapLoadEventParams, type MapMoveEventParams, type MapProps, MapSourceData, type MapStyleSpec, type MarkerClickEventParams, type MarkerDragEventParams, type MarkerProps, type NavigationControlProps, type PopupEventParams, type PopupProps, type RasterLayerProps, type ScaleControlProps, type SourceProps, type SymbolLayerProps };