@gisfun/maplibre-gl-components 0.15.0-alpha.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.
Files changed (196) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1960 -0
  3. package/dist/ControlGrid-DN5md8hp.cjs +19636 -0
  4. package/dist/ControlGrid-rVNG7B9O.js +170422 -0
  5. package/dist/DuckDBConverter-B98M0DFs.cjs +23 -0
  6. package/dist/DuckDBConverter-RPq48-t0.js +434 -0
  7. package/dist/ShapefileConverter-AjbEjEyq.cjs +1 -0
  8. package/dist/ShapefileConverter-trvt8J3z.js +125 -0
  9. package/dist/decoder-CLokFc0V.js +8 -0
  10. package/dist/decoder-D9LU4bUo.cjs +1 -0
  11. package/dist/deflate-BA1jZeSX.js +10 -0
  12. package/dist/deflate-DEdCz12a.cjs +1 -0
  13. package/dist/geojson-BQSVgKFt.cjs +1 -0
  14. package/dist/geojson-BSUuDj5k.js +2551 -0
  15. package/dist/geotiff-De1w1lBy.cjs +8 -0
  16. package/dist/geotiff-o_Fq1Na4.js +3108 -0
  17. package/dist/index-8ZZtuDTp.js +705 -0
  18. package/dist/index-B-Nr9y7J.cjs +84 -0
  19. package/dist/index-B5NoFrpY.js +8892 -0
  20. package/dist/index-Bi1MMPUx.js +4163 -0
  21. package/dist/index-C9fk_HKR.js +167 -0
  22. package/dist/index-CBBRBJvR.cjs +274 -0
  23. package/dist/index-CZxPF1qt.js +4 -0
  24. package/dist/index-CiDPSJ9T.cjs +1 -0
  25. package/dist/index-CjM_nbxd.cjs +107 -0
  26. package/dist/index-DQXdX5y1.js +4666 -0
  27. package/dist/index-Dh1kpCb6.cjs +1 -0
  28. package/dist/index-IrsIiQNM.cjs +4 -0
  29. package/dist/index.cjs +3819 -0
  30. package/dist/index.mjs +19580 -0
  31. package/dist/jpeg-CF9OGQg_.js +533 -0
  32. package/dist/jpeg-JSQOxGHy.cjs +1 -0
  33. package/dist/lerc-7LlQoT6u.js +1032 -0
  34. package/dist/lerc-BIsodce9.cjs +1 -0
  35. package/dist/lzw-BZniWIYG.js +84 -0
  36. package/dist/lzw-BhML-BvT.cjs +1 -0
  37. package/dist/main-dist-Bymiy5aM.cjs +2 -0
  38. package/dist/main-dist-Cv8AKwrY.js +629 -0
  39. package/dist/maplibre-geoman.es-Bxdg-2EU.cjs +129 -0
  40. package/dist/maplibre-geoman.es-CFgM2ajb.js +22827 -0
  41. package/dist/maplibre-gl-components.css +1 -0
  42. package/dist/packbits-B9b7gX2c.cjs +1 -0
  43. package/dist/packbits-DWY5O-FG.js +24 -0
  44. package/dist/pako.esm-Bx5X36Wo.js +1074 -0
  45. package/dist/pako.esm-DZC2QrbJ.cjs +1 -0
  46. package/dist/raw-C3ARbSFo.cjs +1 -0
  47. package/dist/raw-DUslI1gr.js +9 -0
  48. package/dist/react.cjs +1 -0
  49. package/dist/react.mjs +1306 -0
  50. package/dist/types/index.d.ts +44 -0
  51. package/dist/types/index.d.ts.map +1 -0
  52. package/dist/types/lib/adapters/AddVectorAdapter.d.ts +66 -0
  53. package/dist/types/lib/adapters/AddVectorAdapter.d.ts.map +1 -0
  54. package/dist/types/lib/adapters/CogLayerAdapter.d.ts +126 -0
  55. package/dist/types/lib/adapters/CogLayerAdapter.d.ts.map +1 -0
  56. package/dist/types/lib/adapters/PMTilesLayerAdapter.d.ts +78 -0
  57. package/dist/types/lib/adapters/PMTilesLayerAdapter.d.ts.map +1 -0
  58. package/dist/types/lib/adapters/StacLayerAdapter.d.ts +71 -0
  59. package/dist/types/lib/adapters/StacLayerAdapter.d.ts.map +1 -0
  60. package/dist/types/lib/adapters/ZarrLayerAdapter.d.ts +72 -0
  61. package/dist/types/lib/adapters/ZarrLayerAdapter.d.ts.map +1 -0
  62. package/dist/types/lib/adapters/index.d.ts +7 -0
  63. package/dist/types/lib/adapters/index.d.ts.map +1 -0
  64. package/dist/types/lib/addControlGrid.d.ts +80 -0
  65. package/dist/types/lib/addControlGrid.d.ts.map +1 -0
  66. package/dist/types/lib/colormaps/diverging.d.ts +30 -0
  67. package/dist/types/lib/colormaps/diverging.d.ts.map +1 -0
  68. package/dist/types/lib/colormaps/index.d.ts +32 -0
  69. package/dist/types/lib/colormaps/index.d.ts.map +1 -0
  70. package/dist/types/lib/colormaps/misc.d.ts +38 -0
  71. package/dist/types/lib/colormaps/misc.d.ts.map +1 -0
  72. package/dist/types/lib/colormaps/sequential.d.ts +22 -0
  73. package/dist/types/lib/colormaps/sequential.d.ts.map +1 -0
  74. package/dist/types/lib/converters/DuckDBConverter.d.ts +112 -0
  75. package/dist/types/lib/converters/DuckDBConverter.d.ts.map +1 -0
  76. package/dist/types/lib/converters/ShapefileConverter.d.ts +56 -0
  77. package/dist/types/lib/converters/ShapefileConverter.d.ts.map +1 -0
  78. package/dist/types/lib/converters/index.d.ts +8 -0
  79. package/dist/types/lib/converters/index.d.ts.map +1 -0
  80. package/dist/types/lib/converters/types.d.ts +75 -0
  81. package/dist/types/lib/converters/types.d.ts.map +1 -0
  82. package/dist/types/lib/core/AddVector.d.ts +116 -0
  83. package/dist/types/lib/core/AddVector.d.ts.map +1 -0
  84. package/dist/types/lib/core/Basemap.d.ts +206 -0
  85. package/dist/types/lib/core/Basemap.d.ts.map +1 -0
  86. package/dist/types/lib/core/BasemapReact.d.ts +32 -0
  87. package/dist/types/lib/core/BasemapReact.d.ts.map +1 -0
  88. package/dist/types/lib/core/BookmarkControl.d.ts +180 -0
  89. package/dist/types/lib/core/BookmarkControl.d.ts.map +1 -0
  90. package/dist/types/lib/core/ChoroplethControl.d.ts +105 -0
  91. package/dist/types/lib/core/ChoroplethControl.d.ts.map +1 -0
  92. package/dist/types/lib/core/CogLayer.d.ts +139 -0
  93. package/dist/types/lib/core/CogLayer.d.ts.map +1 -0
  94. package/dist/types/lib/core/CogLayerReact.d.ts +32 -0
  95. package/dist/types/lib/core/CogLayerReact.d.ts.map +1 -0
  96. package/dist/types/lib/core/Colorbar.d.ts +133 -0
  97. package/dist/types/lib/core/Colorbar.d.ts.map +1 -0
  98. package/dist/types/lib/core/ColorbarGuiControl.d.ts +79 -0
  99. package/dist/types/lib/core/ColorbarGuiControl.d.ts.map +1 -0
  100. package/dist/types/lib/core/ColorbarReact.d.ts +34 -0
  101. package/dist/types/lib/core/ColorbarReact.d.ts.map +1 -0
  102. package/dist/types/lib/core/ControlGrid.d.ts +125 -0
  103. package/dist/types/lib/core/ControlGrid.d.ts.map +1 -0
  104. package/dist/types/lib/core/ControlGridReact.d.ts +32 -0
  105. package/dist/types/lib/core/ControlGridReact.d.ts.map +1 -0
  106. package/dist/types/lib/core/HtmlControl.d.ts +140 -0
  107. package/dist/types/lib/core/HtmlControl.d.ts.map +1 -0
  108. package/dist/types/lib/core/HtmlControlReact.d.ts +32 -0
  109. package/dist/types/lib/core/HtmlControlReact.d.ts.map +1 -0
  110. package/dist/types/lib/core/HtmlGuiControl.d.ts +68 -0
  111. package/dist/types/lib/core/HtmlGuiControl.d.ts.map +1 -0
  112. package/dist/types/lib/core/InspectControl.d.ts +202 -0
  113. package/dist/types/lib/core/InspectControl.d.ts.map +1 -0
  114. package/dist/types/lib/core/InspectControlReact.d.ts +32 -0
  115. package/dist/types/lib/core/InspectControlReact.d.ts.map +1 -0
  116. package/dist/types/lib/core/Legend.d.ts +142 -0
  117. package/dist/types/lib/core/Legend.d.ts.map +1 -0
  118. package/dist/types/lib/core/LegendGuiControl.d.ts +69 -0
  119. package/dist/types/lib/core/LegendGuiControl.d.ts.map +1 -0
  120. package/dist/types/lib/core/LegendReact.d.ts +34 -0
  121. package/dist/types/lib/core/LegendReact.d.ts.map +1 -0
  122. package/dist/types/lib/core/MeasureControl.d.ts +211 -0
  123. package/dist/types/lib/core/MeasureControl.d.ts.map +1 -0
  124. package/dist/types/lib/core/MinimapControl.d.ts +77 -0
  125. package/dist/types/lib/core/MinimapControl.d.ts.map +1 -0
  126. package/dist/types/lib/core/MinimapControlReact.d.ts +32 -0
  127. package/dist/types/lib/core/MinimapControlReact.d.ts.map +1 -0
  128. package/dist/types/lib/core/PMTilesLayer.d.ts +119 -0
  129. package/dist/types/lib/core/PMTilesLayer.d.ts.map +1 -0
  130. package/dist/types/lib/core/PrintControl.d.ts +226 -0
  131. package/dist/types/lib/core/PrintControl.d.ts.map +1 -0
  132. package/dist/types/lib/core/SearchControl.d.ts +172 -0
  133. package/dist/types/lib/core/SearchControl.d.ts.map +1 -0
  134. package/dist/types/lib/core/SearchControlReact.d.ts +32 -0
  135. package/dist/types/lib/core/SearchControlReact.d.ts.map +1 -0
  136. package/dist/types/lib/core/StacLayer.d.ts +107 -0
  137. package/dist/types/lib/core/StacLayer.d.ts.map +1 -0
  138. package/dist/types/lib/core/StacSearch.d.ts +109 -0
  139. package/dist/types/lib/core/StacSearch.d.ts.map +1 -0
  140. package/dist/types/lib/core/Terrain.d.ts +165 -0
  141. package/dist/types/lib/core/Terrain.d.ts.map +1 -0
  142. package/dist/types/lib/core/TerrainReact.d.ts +32 -0
  143. package/dist/types/lib/core/TerrainReact.d.ts.map +1 -0
  144. package/dist/types/lib/core/VectorDataset.d.ts +228 -0
  145. package/dist/types/lib/core/VectorDataset.d.ts.map +1 -0
  146. package/dist/types/lib/core/VectorDatasetReact.d.ts +31 -0
  147. package/dist/types/lib/core/VectorDatasetReact.d.ts.map +1 -0
  148. package/dist/types/lib/core/ViewStateControl.d.ts +205 -0
  149. package/dist/types/lib/core/ViewStateControl.d.ts.map +1 -0
  150. package/dist/types/lib/core/ViewStateControlReact.d.ts +32 -0
  151. package/dist/types/lib/core/ViewStateControlReact.d.ts.map +1 -0
  152. package/dist/types/lib/core/ZarrLayer.d.ts +110 -0
  153. package/dist/types/lib/core/ZarrLayer.d.ts.map +1 -0
  154. package/dist/types/lib/core/types.d.ts +2793 -0
  155. package/dist/types/lib/core/types.d.ts.map +1 -0
  156. package/dist/types/lib/hooks/index.d.ts +13 -0
  157. package/dist/types/lib/hooks/index.d.ts.map +1 -0
  158. package/dist/types/lib/hooks/useBasemap.d.ts +43 -0
  159. package/dist/types/lib/hooks/useBasemap.d.ts.map +1 -0
  160. package/dist/types/lib/hooks/useCogLayer.d.ts +44 -0
  161. package/dist/types/lib/hooks/useCogLayer.d.ts.map +1 -0
  162. package/dist/types/lib/hooks/useColorbar.d.ts +36 -0
  163. package/dist/types/lib/hooks/useColorbar.d.ts.map +1 -0
  164. package/dist/types/lib/hooks/useControlGrid.d.ts +41 -0
  165. package/dist/types/lib/hooks/useControlGrid.d.ts.map +1 -0
  166. package/dist/types/lib/hooks/useHtmlControl.d.ts +39 -0
  167. package/dist/types/lib/hooks/useHtmlControl.d.ts.map +1 -0
  168. package/dist/types/lib/hooks/useInspectControl.d.ts +49 -0
  169. package/dist/types/lib/hooks/useInspectControl.d.ts.map +1 -0
  170. package/dist/types/lib/hooks/useLegend.d.ts +41 -0
  171. package/dist/types/lib/hooks/useLegend.d.ts.map +1 -0
  172. package/dist/types/lib/hooks/useMinimapControl.d.ts +35 -0
  173. package/dist/types/lib/hooks/useMinimapControl.d.ts.map +1 -0
  174. package/dist/types/lib/hooks/useSearchControl.d.ts +43 -0
  175. package/dist/types/lib/hooks/useSearchControl.d.ts.map +1 -0
  176. package/dist/types/lib/hooks/useTerrain.d.ts +43 -0
  177. package/dist/types/lib/hooks/useTerrain.d.ts.map +1 -0
  178. package/dist/types/lib/hooks/useVectorDataset.d.ts +35 -0
  179. package/dist/types/lib/hooks/useVectorDataset.d.ts.map +1 -0
  180. package/dist/types/lib/hooks/useViewState.d.ts +43 -0
  181. package/dist/types/lib/hooks/useViewState.d.ts.map +1 -0
  182. package/dist/types/lib/utils/color.d.ts +47 -0
  183. package/dist/types/lib/utils/color.d.ts.map +1 -0
  184. package/dist/types/lib/utils/fileHelpers.d.ts +207 -0
  185. package/dist/types/lib/utils/fileHelpers.d.ts.map +1 -0
  186. package/dist/types/lib/utils/helpers.d.ts +48 -0
  187. package/dist/types/lib/utils/helpers.d.ts.map +1 -0
  188. package/dist/types/lib/utils/index.d.ts +4 -0
  189. package/dist/types/lib/utils/index.d.ts.map +1 -0
  190. package/dist/types/lib/utils/providers.d.ts +46 -0
  191. package/dist/types/lib/utils/providers.d.ts.map +1 -0
  192. package/dist/types/react.d.ts +15 -0
  193. package/dist/types/react.d.ts.map +1 -0
  194. package/dist/webimage-CBRffWZD.cjs +1 -0
  195. package/dist/webimage-ibSPOLHJ.js +19 -0
  196. package/package.json +137 -0
@@ -0,0 +1,2793 @@
1
+ import { IControl, Map } from 'maplibre-gl';
2
+ import { StreetViewControlOptions } from 'maplibre-gl-streetview';
3
+ /**
4
+ * Position options for legend controls.
5
+ */
6
+ export type ControlPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
7
+ /**
8
+ * Orientation for colorbar display.
9
+ */
10
+ export type ColorbarOrientation = "horizontal" | "vertical";
11
+ /**
12
+ * Built-in colormap names (matplotlib-compatible).
13
+ */
14
+ export type ColormapName = "viridis" | "plasma" | "inferno" | "magma" | "cividis" | "coolwarm" | "bwr" | "seismic" | "RdBu" | "RdYlBu" | "RdYlGn" | "spectral" | "jet" | "rainbow" | "turbo" | "terrain" | "ocean" | "hot" | "cool" | "gray" | "bone";
15
+ /**
16
+ * Color stop definition for custom gradients.
17
+ */
18
+ export interface ColorStop {
19
+ /** Position from 0 to 1. */
20
+ position: number;
21
+ /** CSS color string (hex, rgb, rgba, hsl). */
22
+ color: string;
23
+ }
24
+ /**
25
+ * Tick mark configuration for colorbar.
26
+ */
27
+ export interface TickConfig {
28
+ /** Values at which to display ticks. */
29
+ values?: number[];
30
+ /** Number of auto-generated ticks (ignored if values provided). */
31
+ count?: number;
32
+ /** Format function for tick labels. */
33
+ format?: (value: number) => string;
34
+ /** Tick mark length in pixels. */
35
+ length?: number;
36
+ }
37
+ /**
38
+ * Options for configuring the Colorbar control.
39
+ */
40
+ export interface ColorbarOptions {
41
+ /** Colormap name or custom color array. */
42
+ colormap?: ColormapName | string[];
43
+ /** Custom color stops for fine-grained control. */
44
+ colorStops?: ColorStop[];
45
+ /** Minimum value for the colorbar. */
46
+ vmin?: number;
47
+ /** Maximum value for the colorbar. */
48
+ vmax?: number;
49
+ /** Title/label displayed above or beside the colorbar. */
50
+ label?: string;
51
+ /** Units to display after values. */
52
+ units?: string;
53
+ /** Orientation of the colorbar. */
54
+ orientation?: ColorbarOrientation;
55
+ /** Position on the map. */
56
+ position?: ControlPosition;
57
+ /** Width in pixels (for vertical) or height (for horizontal) of the gradient bar. */
58
+ barThickness?: number;
59
+ /** Length of the colorbar in pixels. */
60
+ barLength?: number;
61
+ /** Tick configuration. */
62
+ ticks?: TickConfig;
63
+ /** Custom CSS class name. */
64
+ className?: string;
65
+ /** Whether the colorbar is initially visible. */
66
+ visible?: boolean;
67
+ /** Opacity of the colorbar container (0-1). */
68
+ opacity?: number;
69
+ /** Background color of the container. */
70
+ backgroundColor?: string;
71
+ /** Font size for labels in pixels. */
72
+ fontSize?: number;
73
+ /** Font color for labels. */
74
+ fontColor?: string;
75
+ /** Border radius for container. */
76
+ borderRadius?: number;
77
+ /** Padding inside the container. */
78
+ padding?: number;
79
+ /** Minimum zoom level at which the colorbar is visible. */
80
+ minzoom?: number;
81
+ /** Maximum zoom level at which the colorbar is visible. */
82
+ maxzoom?: number;
83
+ }
84
+ /**
85
+ * Internal state of the Colorbar control.
86
+ */
87
+ export interface ColorbarState {
88
+ /** Whether the colorbar is visible. */
89
+ visible: boolean;
90
+ /** Current vmin value. */
91
+ vmin: number;
92
+ /** Current vmax value. */
93
+ vmax: number;
94
+ /** Current colormap. */
95
+ colormap: ColormapName | string[];
96
+ }
97
+ /**
98
+ * Props for the React Colorbar wrapper component.
99
+ */
100
+ export interface ColorbarReactProps extends ColorbarOptions {
101
+ /** MapLibre GL map instance. */
102
+ map: Map;
103
+ /** Callback fired when state changes. */
104
+ onStateChange?: (state: ColorbarState) => void;
105
+ }
106
+ /**
107
+ * Legend item definition.
108
+ */
109
+ export interface LegendItem {
110
+ /** Display label for the legend item. */
111
+ label: string;
112
+ /** Color for the swatch (CSS color string). */
113
+ color: string;
114
+ /** Optional outline/stroke color. */
115
+ strokeColor?: string;
116
+ /** Shape of the swatch. */
117
+ shape?: "square" | "circle" | "line";
118
+ /** Optional icon URL to display instead of color swatch. */
119
+ icon?: string;
120
+ }
121
+ /**
122
+ * Options for configuring the Legend control.
123
+ */
124
+ export interface LegendOptions {
125
+ /** Legend title. */
126
+ title?: string;
127
+ /** Legend items to display. */
128
+ items?: LegendItem[];
129
+ /** Position on the map. */
130
+ position?: ControlPosition;
131
+ /** Custom CSS class name. */
132
+ className?: string;
133
+ /** Whether the legend is initially visible. */
134
+ visible?: boolean;
135
+ /** Whether the legend is collapsible. */
136
+ collapsible?: boolean;
137
+ /** Whether the legend starts collapsed. */
138
+ collapsed?: boolean;
139
+ /** Width of the legend panel in pixels. */
140
+ width?: number;
141
+ /** Maximum height before scrolling. */
142
+ maxHeight?: number;
143
+ /** Opacity of the legend container (0-1). */
144
+ opacity?: number;
145
+ /** Background color of the container. */
146
+ backgroundColor?: string;
147
+ /** Font size for labels in pixels. */
148
+ fontSize?: number;
149
+ /** Font color for labels. */
150
+ fontColor?: string;
151
+ /** Size of color swatches in pixels. */
152
+ swatchSize?: number;
153
+ /** Border radius for container. */
154
+ borderRadius?: number;
155
+ /** Padding inside the container. */
156
+ padding?: number;
157
+ /** Minimum zoom level at which the legend is visible. */
158
+ minzoom?: number;
159
+ /** Maximum zoom level at which the legend is visible. */
160
+ maxzoom?: number;
161
+ }
162
+ /**
163
+ * Internal state of the Legend control.
164
+ */
165
+ export interface LegendState {
166
+ /** Whether the legend is visible. */
167
+ visible: boolean;
168
+ /** Whether the legend is collapsed. */
169
+ collapsed: boolean;
170
+ /** Current legend items. */
171
+ items: LegendItem[];
172
+ }
173
+ /**
174
+ * Props for the React Legend wrapper component.
175
+ */
176
+ export interface LegendReactProps extends LegendOptions {
177
+ /** MapLibre GL map instance. */
178
+ map: Map;
179
+ /** Callback fired when state changes. */
180
+ onStateChange?: (state: LegendState) => void;
181
+ }
182
+ /**
183
+ * Options for configuring the HtmlControl.
184
+ */
185
+ export interface HtmlControlOptions {
186
+ /** HTML content string. */
187
+ html?: string;
188
+ /** Or provide an element directly. */
189
+ element?: HTMLElement;
190
+ /** Title for the control header (shown when collapsible). */
191
+ title?: string;
192
+ /** Position on the map. */
193
+ position?: ControlPosition;
194
+ /** Custom CSS class name. */
195
+ className?: string;
196
+ /** Whether the control is initially visible. */
197
+ visible?: boolean;
198
+ /** Whether the control is collapsible. */
199
+ collapsible?: boolean;
200
+ /** Whether the control starts collapsed. */
201
+ collapsed?: boolean;
202
+ /** Background color of the container. */
203
+ backgroundColor?: string;
204
+ /** Padding inside the container in pixels. */
205
+ padding?: number;
206
+ /** Border radius for container. */
207
+ borderRadius?: number;
208
+ /** Opacity of the container (0-1). */
209
+ opacity?: number;
210
+ /** Maximum width of the container. */
211
+ maxWidth?: number;
212
+ /** Maximum height of the container. */
213
+ maxHeight?: number;
214
+ /** Font size for labels in pixels. */
215
+ fontSize?: number;
216
+ /** Font color for labels. */
217
+ fontColor?: string;
218
+ /** Minimum zoom level at which the control is visible. */
219
+ minzoom?: number;
220
+ /** Maximum zoom level at which the control is visible. */
221
+ maxzoom?: number;
222
+ }
223
+ /**
224
+ * Internal state of the HtmlControl.
225
+ */
226
+ export interface HtmlControlState {
227
+ /** Whether the control is visible. */
228
+ visible: boolean;
229
+ /** Whether the control is collapsed. */
230
+ collapsed: boolean;
231
+ /** Current HTML content. */
232
+ html: string;
233
+ }
234
+ /**
235
+ * Props for the React HtmlControl wrapper component.
236
+ */
237
+ export interface HtmlControlReactProps extends HtmlControlOptions {
238
+ /** MapLibre GL map instance. */
239
+ map: Map;
240
+ /** Callback fired when state changes. */
241
+ onStateChange?: (state: HtmlControlState) => void;
242
+ }
243
+ /**
244
+ * Event types emitted by legend/colorbar controls.
245
+ */
246
+ export type ComponentEvent = "show" | "hide" | "update" | "collapse" | "expand";
247
+ /**
248
+ * Event handler function type.
249
+ */
250
+ export type ComponentEventHandler<T> = (event: {
251
+ type: ComponentEvent;
252
+ state: T;
253
+ }) => void;
254
+ /**
255
+ * Colormap definition with color stops.
256
+ */
257
+ export interface ColormapDefinition {
258
+ /** Name of the colormap. */
259
+ name: string;
260
+ /** Array of color stops from 0 to 1. */
261
+ colors: ColorStop[];
262
+ }
263
+ /**
264
+ * Display mode for the basemap control.
265
+ */
266
+ export type BasemapDisplayMode = "dropdown" | "gallery" | "list";
267
+ /**
268
+ * Basemap item definition.
269
+ */
270
+ export interface BasemapItem {
271
+ /** Unique identifier for the basemap. */
272
+ id: string;
273
+ /** Display name. */
274
+ name: string;
275
+ /** Optional group/category for organization. */
276
+ group?: string;
277
+ /** Tile URL template for XYZ sources (with {z}, {x}, {y} placeholders). */
278
+ url?: string;
279
+ /** MapLibre style URL for vector styles. */
280
+ style?: string;
281
+ /** Attribution text. */
282
+ attribution?: string;
283
+ /** Optional thumbnail URL for preview. */
284
+ thumbnail?: string;
285
+ /** Maximum zoom level. */
286
+ maxZoom?: number;
287
+ /** Minimum zoom level. */
288
+ minZoom?: number;
289
+ /** Whether this basemap requires an API key. */
290
+ requiresApiKey?: boolean;
291
+ /** API key if required. */
292
+ apiKey?: string;
293
+ /** Variant name for URL template (e.g., 'light_all' for CartoDB). */
294
+ variant?: string;
295
+ /** File extension for URL template (e.g., 'png', 'jpg'). */
296
+ ext?: string;
297
+ }
298
+ /**
299
+ * Options for configuring the BasemapControl.
300
+ */
301
+ export interface BasemapControlOptions {
302
+ /** Array of basemap items to display. */
303
+ basemaps?: BasemapItem[];
304
+ /** URL to fetch providers.json from xyzservices. Defaults to xyzservices URL. */
305
+ providersUrl?: string;
306
+ /** Initial/default basemap ID. */
307
+ defaultBasemap?: string;
308
+ /** Position on the map. */
309
+ position?: ControlPosition;
310
+ /** Custom CSS class name. */
311
+ className?: string;
312
+ /** Whether the control is initially visible. */
313
+ visible?: boolean;
314
+ /** Whether the control is collapsible. */
315
+ collapsible?: boolean;
316
+ /** Whether the control starts collapsed. */
317
+ collapsed?: boolean;
318
+ /** UI display mode: 'dropdown', 'gallery', or 'list'. */
319
+ displayMode?: BasemapDisplayMode;
320
+ /** Whether to show search/filter input. */
321
+ showSearch?: boolean;
322
+ /** Filter providers by group names (only include these groups). */
323
+ filterGroups?: string[];
324
+ /** Exclude specific provider groups. */
325
+ excludeGroups?: string[];
326
+ /** Exclude broken providers (status: "broken"). Default: true. */
327
+ excludeBroken?: boolean;
328
+ /** Background color of the container. */
329
+ backgroundColor?: string;
330
+ /** Padding inside the container in pixels. */
331
+ padding?: number;
332
+ /** Border radius for container. */
333
+ borderRadius?: number;
334
+ /** Opacity of the container (0-1). */
335
+ opacity?: number;
336
+ /** Maximum width of the container. */
337
+ maxWidth?: number;
338
+ /** Maximum height of the container. */
339
+ maxHeight?: number;
340
+ /** Font size for labels in pixels. */
341
+ fontSize?: number;
342
+ /** Font color for labels. */
343
+ fontColor?: string;
344
+ /** Minimum zoom level at which the control is visible. */
345
+ minzoom?: number;
346
+ /** Maximum zoom level at which the control is visible. */
347
+ maxzoom?: number;
348
+ /** Layer ID to insert the basemap layer before (for layer ordering). */
349
+ beforeId?: string;
350
+ /** Whether to place basemap below labels (before first symbol layer). Default: false. */
351
+ belowLabels?: boolean;
352
+ }
353
+ /**
354
+ * Internal state of the BasemapControl.
355
+ */
356
+ export interface BasemapControlState {
357
+ /** Whether the control is visible. */
358
+ visible: boolean;
359
+ /** Whether the control is collapsed. */
360
+ collapsed: boolean;
361
+ /** Currently selected basemap ID. */
362
+ selectedBasemap: string | null;
363
+ /** Search/filter text. */
364
+ searchText: string;
365
+ /** Loading state for async operations. */
366
+ loading: boolean;
367
+ /** Error message if any. */
368
+ error: string | null;
369
+ /** Whether basemap is placed below labels. */
370
+ belowLabels: boolean;
371
+ }
372
+ /**
373
+ * Props for the React BasemapControl wrapper component.
374
+ */
375
+ export interface BasemapControlReactProps extends BasemapControlOptions {
376
+ /** MapLibre GL map instance. */
377
+ map: Map;
378
+ /** Callback fired when basemap changes. */
379
+ onBasemapChange?: (basemap: BasemapItem) => void;
380
+ /** Callback fired when state changes. */
381
+ onStateChange?: (state: BasemapControlState) => void;
382
+ }
383
+ /**
384
+ * Basemap-specific event types.
385
+ */
386
+ export type BasemapEvent = ComponentEvent | "basemapchange";
387
+ /**
388
+ * Terrain encoding format.
389
+ */
390
+ export type TerrainEncoding = "terrarium" | "mapbox";
391
+ /**
392
+ * Options for configuring the TerrainControl.
393
+ */
394
+ export interface TerrainControlOptions {
395
+ /** Terrain tile source URL template. Defaults to AWS Terrarium tiles. */
396
+ sourceUrl?: string;
397
+ /** Terrain encoding format. Default: 'terrarium'. */
398
+ encoding?: TerrainEncoding;
399
+ /** Vertical exaggeration factor for terrain. Default: 1.0. */
400
+ exaggeration?: number;
401
+ /** Whether terrain is enabled by default. Default: false. */
402
+ enabled?: boolean;
403
+ /** Whether to add hillshade layer for better visualization. Default: true. */
404
+ hillshade?: boolean;
405
+ /** Hillshade exaggeration factor (0-1). Default: 0.5. */
406
+ hillshadeExaggeration?: number;
407
+ /** Minimum source zoom level for terrain tiles. Default: 0. */
408
+ sourceMinzoom?: number;
409
+ /** Maximum source zoom level for terrain tiles. Default: 15. */
410
+ sourceMaxzoom?: number;
411
+ /** Tile size for raster-dem source. Default: 256. */
412
+ tileSize?: number;
413
+ /** Position on the map. */
414
+ position?: ControlPosition;
415
+ /** Custom CSS class name. */
416
+ className?: string;
417
+ /** Whether the control is initially visible. Default: true. */
418
+ visible?: boolean;
419
+ /** Background color of the control button. */
420
+ backgroundColor?: string;
421
+ /** Border radius for container. */
422
+ borderRadius?: number;
423
+ /** Opacity of the container (0-1). */
424
+ opacity?: number;
425
+ /** Minimum zoom level at which the control is visible. */
426
+ minzoom?: number;
427
+ /** Maximum zoom level at which the control is visible. */
428
+ maxzoom?: number;
429
+ }
430
+ /**
431
+ * Internal state of the TerrainControl.
432
+ */
433
+ export interface TerrainControlState {
434
+ /** Whether the control is visible. */
435
+ visible: boolean;
436
+ /** Whether terrain is currently enabled. */
437
+ enabled: boolean;
438
+ /** Current exaggeration value. */
439
+ exaggeration: number;
440
+ /** Whether hillshade is enabled. */
441
+ hillshade: boolean;
442
+ }
443
+ /**
444
+ * Props for the React TerrainControl wrapper component.
445
+ */
446
+ export interface TerrainControlReactProps extends TerrainControlOptions {
447
+ /** MapLibre GL map instance. */
448
+ map: Map;
449
+ /** Callback fired when terrain is toggled. */
450
+ onTerrainChange?: (enabled: boolean) => void;
451
+ /** Callback fired when state changes. */
452
+ onStateChange?: (state: TerrainControlState) => void;
453
+ }
454
+ /**
455
+ * Terrain-specific event types.
456
+ */
457
+ export type TerrainEvent = ComponentEvent | "terrainchange";
458
+ /**
459
+ * Terrain event handler function type.
460
+ */
461
+ export type TerrainEventHandler = (event: {
462
+ type: TerrainEvent;
463
+ state: TerrainControlState;
464
+ }) => void;
465
+ /**
466
+ * Search result item from geocoding service.
467
+ */
468
+ export interface SearchResult {
469
+ /** Unique identifier for the result. */
470
+ id: string;
471
+ /** Display name of the place. */
472
+ name: string;
473
+ /** Full display name with address details. */
474
+ displayName: string;
475
+ /** Longitude coordinate. */
476
+ lng: number;
477
+ /** Latitude coordinate. */
478
+ lat: number;
479
+ /** Bounding box [west, south, east, north]. */
480
+ bbox?: [number, number, number, number];
481
+ /** Type of place (city, street, etc.). */
482
+ type?: string;
483
+ /** Importance/relevance score. */
484
+ importance?: number;
485
+ }
486
+ /**
487
+ * Options for configuring the SearchControl.
488
+ */
489
+ export interface SearchControlOptions {
490
+ /** Position on the map. */
491
+ position?: ControlPosition;
492
+ /** Custom CSS class name. */
493
+ className?: string;
494
+ /** Whether the control is initially visible. Default: true. */
495
+ visible?: boolean;
496
+ /** Whether the control starts collapsed (icon only). Default: true. */
497
+ collapsed?: boolean;
498
+ /** Placeholder text for the search input. Default: 'Search places...'. */
499
+ placeholder?: string;
500
+ /** Geocoding service URL. Defaults to Nominatim. */
501
+ geocoderUrl?: string;
502
+ /** Maximum number of results to display. Default: 5. */
503
+ maxResults?: number;
504
+ /** Debounce delay in ms for search requests. Default: 300. */
505
+ debounceMs?: number;
506
+ /** Zoom level to fly to when selecting a result. Default: 14. */
507
+ flyToZoom?: number;
508
+ /** Whether to add a marker at the selected location. Default: true. */
509
+ showMarker?: boolean;
510
+ /** Color for the result marker. Default: '#4264fb'. */
511
+ markerColor?: string;
512
+ /** Whether to collapse after selecting a result. Default: true. */
513
+ collapseOnSelect?: boolean;
514
+ /** Whether to clear results after selecting. Default: true. */
515
+ clearOnSelect?: boolean;
516
+ /** Custom geocoder function (overrides geocoderUrl). */
517
+ geocoder?: (query: string) => Promise<SearchResult[]>;
518
+ /** Background color of the container. */
519
+ backgroundColor?: string;
520
+ /** Border radius for container. */
521
+ borderRadius?: number;
522
+ /** Opacity of the container (0-1). */
523
+ opacity?: number;
524
+ /** Width of the expanded search panel. Default: 280. */
525
+ width?: number;
526
+ /** Font size in pixels. */
527
+ fontSize?: number;
528
+ /** Font color. */
529
+ fontColor?: string;
530
+ /** Minimum zoom level at which the control is visible. */
531
+ minzoom?: number;
532
+ /** Maximum zoom level at which the control is visible. */
533
+ maxzoom?: number;
534
+ }
535
+ /**
536
+ * Internal state of the SearchControl.
537
+ */
538
+ export interface SearchControlState {
539
+ /** Whether the control is visible. */
540
+ visible: boolean;
541
+ /** Whether the control is collapsed. */
542
+ collapsed: boolean;
543
+ /** Current search query. */
544
+ query: string;
545
+ /** Current search results. */
546
+ results: SearchResult[];
547
+ /** Whether a search is in progress. */
548
+ loading: boolean;
549
+ /** Selected result. */
550
+ selectedResult: SearchResult | null;
551
+ /** Error message if any. */
552
+ error: string | null;
553
+ }
554
+ /**
555
+ * Props for the React SearchControl wrapper component.
556
+ */
557
+ export interface SearchControlReactProps extends SearchControlOptions {
558
+ /** MapLibre GL map instance. */
559
+ map: Map;
560
+ /** Callback fired when a search result is selected. */
561
+ onResultSelect?: (result: SearchResult) => void;
562
+ /** Callback fired when state changes. */
563
+ onStateChange?: (state: SearchControlState) => void;
564
+ }
565
+ /**
566
+ * Search-specific event types.
567
+ */
568
+ export type SearchEvent = ComponentEvent | "resultselect" | "search" | "clear";
569
+ /**
570
+ * Search event handler function type.
571
+ */
572
+ export type SearchEventHandler = (event: {
573
+ type: SearchEvent;
574
+ state: SearchControlState;
575
+ result?: SearchResult;
576
+ }) => void;
577
+ /**
578
+ * Supported vector file formats.
579
+ *
580
+ * DuckDB's spatial extension uses GDAL under the hood, enabling support
581
+ * for many common geospatial formats via ST_Read().
582
+ */
583
+ export type VectorFormat = "geojson" | "shapefile" | "geopackage" | "geoparquet" | "kml" | "kmz" | "gpx" | "flatgeobuf" | "gml" | "topojson" | "csv" | "xlsx" | "dxf" | "unknown";
584
+ /**
585
+ * Progress information for file conversion operations.
586
+ */
587
+ export interface ConversionProgress {
588
+ /** Current stage of the conversion. */
589
+ stage: "loading" | "initializing" | "converting" | "complete" | "error";
590
+ /** Progress percentage (0-100). */
591
+ percent?: number;
592
+ /** Human-readable progress message. */
593
+ message?: string;
594
+ }
595
+ /**
596
+ * Callback type for conversion progress updates.
597
+ */
598
+ export type ConversionProgressCallback = (progress: ConversionProgress) => void;
599
+ /**
600
+ * Loaded vector dataset information.
601
+ */
602
+ export interface LoadedDataset {
603
+ /** Unique identifier for the dataset. */
604
+ id: string;
605
+ /** Original filename. */
606
+ filename: string;
607
+ /** Source ID in MapLibre. */
608
+ sourceId: string;
609
+ /** Array of layer IDs created for this dataset. */
610
+ layerIds: string[];
611
+ /** GeoJSON feature count. */
612
+ featureCount: number;
613
+ /** Geometry types present in the dataset. */
614
+ geometryTypes: ("Point" | "LineString" | "Polygon" | "MultiPoint" | "MultiLineString" | "MultiPolygon")[];
615
+ /** Timestamp when loaded. */
616
+ loadedAt: Date;
617
+ /** Original file format (geojson, shapefile, geopackage). */
618
+ originalFormat?: VectorFormat;
619
+ }
620
+ /**
621
+ * Default styling options for vector layers.
622
+ */
623
+ export interface VectorLayerStyle {
624
+ /** Fill color for polygons. */
625
+ fillColor?: string;
626
+ /** Fill opacity for polygons (0-1). */
627
+ fillOpacity?: number;
628
+ /** Stroke/line color. */
629
+ strokeColor?: string;
630
+ /** Stroke/line width in pixels. */
631
+ strokeWidth?: number;
632
+ /** Stroke opacity (0-1). */
633
+ strokeOpacity?: number;
634
+ /** Circle radius for points in pixels. */
635
+ circleRadius?: number;
636
+ /** Circle color for points. */
637
+ circleColor?: string;
638
+ /** Circle stroke color for points. */
639
+ circleStrokeColor?: string;
640
+ /** Circle stroke width for points. */
641
+ circleStrokeWidth?: number;
642
+ }
643
+ /**
644
+ * Options for configuring the VectorDatasetControl.
645
+ */
646
+ export interface VectorDatasetControlOptions {
647
+ /** Position on the map. */
648
+ position?: ControlPosition;
649
+ /** Custom CSS class name. */
650
+ className?: string;
651
+ /** Whether the control is initially visible. Default: true. */
652
+ visible?: boolean;
653
+ /** Whether to show a drop zone overlay when dragging files. Default: true. */
654
+ showDropZone?: boolean;
655
+ /** Accepted file extensions. Default: ['.geojson', '.json']. */
656
+ acceptedExtensions?: string[];
657
+ /** Whether to allow multiple file uploads. Default: true. */
658
+ multiple?: boolean;
659
+ /** Default styling for loaded layers. */
660
+ defaultStyle?: VectorLayerStyle;
661
+ /** Whether to fit map bounds to loaded data. Default: true. */
662
+ fitBounds?: boolean;
663
+ /** Padding for fitBounds in pixels. Default: 50. */
664
+ fitBoundsPadding?: number;
665
+ /** Maximum file size in bytes. Default: 50MB (52428800). */
666
+ maxFileSize?: number;
667
+ /** Background color of the control button. */
668
+ backgroundColor?: string;
669
+ /** Border radius for container. */
670
+ borderRadius?: number;
671
+ /** Opacity of the container (0-1). */
672
+ opacity?: number;
673
+ /** Minimum zoom level at which the control is visible. */
674
+ minzoom?: number;
675
+ /** Maximum zoom level at which the control is visible. */
676
+ maxzoom?: number;
677
+ /**
678
+ * Enable support for advanced formats (Shapefile, GeoPackage).
679
+ * When enabled, DuckDB WASM will be lazy-loaded when processing these formats.
680
+ * Default: false.
681
+ */
682
+ enableAdvancedFormats?: boolean;
683
+ /**
684
+ * Custom URL for DuckDB WASM bundles.
685
+ * Useful for self-hosting the WASM files or using a different CDN.
686
+ */
687
+ duckdbBundleUrl?: string;
688
+ /**
689
+ * Callback for conversion progress updates.
690
+ * Called during file conversion with progress information.
691
+ */
692
+ onConversionProgress?: ConversionProgressCallback;
693
+ }
694
+ /**
695
+ * Internal state of the VectorDatasetControl.
696
+ */
697
+ export interface VectorDatasetControlState {
698
+ /** Whether the control is visible. */
699
+ visible: boolean;
700
+ /** Whether a file is being dragged over the map. */
701
+ isDragging: boolean;
702
+ /** Whether files are currently being loaded. */
703
+ isLoading: boolean;
704
+ /** Array of loaded datasets. */
705
+ loadedDatasets: LoadedDataset[];
706
+ /** Error message if any. */
707
+ error: string | null;
708
+ }
709
+ /**
710
+ * Props for the React VectorDatasetControl wrapper component.
711
+ */
712
+ export interface VectorDatasetControlReactProps extends VectorDatasetControlOptions {
713
+ /** MapLibre GL map instance. */
714
+ map: Map;
715
+ /** Callback fired when a dataset is loaded. */
716
+ onDatasetLoad?: (dataset: LoadedDataset) => void;
717
+ /** Callback fired when an error occurs. */
718
+ onError?: (error: string, filename?: string) => void;
719
+ /** Callback fired when state changes. */
720
+ onStateChange?: (state: VectorDatasetControlState) => void;
721
+ }
722
+ /**
723
+ * VectorDataset-specific event types.
724
+ */
725
+ export type VectorDatasetEvent = ComponentEvent | "load" | "error" | "dragenter" | "dragleave";
726
+ /**
727
+ * VectorDataset event handler function type.
728
+ */
729
+ export type VectorDatasetEventHandler = (event: {
730
+ type: VectorDatasetEvent;
731
+ state: VectorDatasetControlState;
732
+ dataset?: LoadedDataset;
733
+ error?: string;
734
+ filename?: string;
735
+ }) => void;
736
+ /**
737
+ * Highlight style configuration for inspected features.
738
+ */
739
+ export interface InspectHighlightStyle {
740
+ /** Fill color for polygons (CSS color string). Default: '#ffff00'. */
741
+ fillColor?: string;
742
+ /** Fill opacity for polygons (0-1). Default: 0.3. */
743
+ fillOpacity?: number;
744
+ /** Stroke/line color for all geometry types. Default: '#ffff00'. */
745
+ strokeColor?: string;
746
+ /** Stroke/line width in pixels. Default: 3. */
747
+ strokeWidth?: number;
748
+ /** Circle radius for points in pixels. Default: 10. */
749
+ circleRadius?: number;
750
+ /** Circle stroke width for points in pixels. Default: 3. */
751
+ circleStrokeWidth?: number;
752
+ }
753
+ /**
754
+ * Inspected feature information.
755
+ */
756
+ export interface InspectedFeature {
757
+ /** Unique identifier for this inspection instance. */
758
+ id: string;
759
+ /** The GeoJSON feature object with geometry and properties. */
760
+ feature: GeoJSON.Feature;
761
+ /** Layer ID the feature belongs to. */
762
+ layerId: string;
763
+ /** Source ID the feature belongs to. */
764
+ sourceId: string;
765
+ /** Source layer (for vector tile sources). */
766
+ sourceLayer?: string;
767
+ /** Feature ID from the source, if available. */
768
+ featureId?: string | number;
769
+ /** Click coordinates [lng, lat]. */
770
+ lngLat: [number, number];
771
+ }
772
+ /**
773
+ * Options for configuring the InspectControl.
774
+ */
775
+ export interface InspectControlOptions {
776
+ /** Position on the map. Default: 'top-right'. */
777
+ position?: ControlPosition;
778
+ /** Custom CSS class name. */
779
+ className?: string;
780
+ /** Whether the control is initially visible. Default: true. */
781
+ visible?: boolean;
782
+ /** Whether inspect mode is enabled by default. Default: false. */
783
+ enabled?: boolean;
784
+ /** Maximum number of features to show when multiple at same point. Default: 10. */
785
+ maxFeatures?: number;
786
+ /** Only inspect features from these layers. If empty, inspect all. */
787
+ includeLayers?: string[];
788
+ /** Skip features from these layers. */
789
+ excludeLayers?: string[];
790
+ /** Highlight style for selected features. */
791
+ highlightStyle?: InspectHighlightStyle;
792
+ /** Properties to always exclude from display (e.g., internal IDs). */
793
+ excludeProperties?: string[];
794
+ /** Whether to show geometry type in the popup. Default: true. */
795
+ showGeometryType?: boolean;
796
+ /** Whether to show layer name in the popup. Default: true. */
797
+ showLayerName?: boolean;
798
+ /** Maximum width of popup in pixels. Default: 320. */
799
+ maxWidth?: number;
800
+ /** Maximum height of popup content in pixels. Default: 300. */
801
+ maxHeight?: number;
802
+ /** Background color of the container. */
803
+ backgroundColor?: string;
804
+ /** Border radius for container. */
805
+ borderRadius?: number;
806
+ /** Opacity of the container (0-1). */
807
+ opacity?: number;
808
+ /** Font size in pixels. */
809
+ fontSize?: number;
810
+ /** Font color. */
811
+ fontColor?: string;
812
+ /** Minimum zoom level at which the control is visible. */
813
+ minzoom?: number;
814
+ /** Maximum zoom level at which the control is visible. */
815
+ maxzoom?: number;
816
+ }
817
+ /**
818
+ * Internal state of the InspectControl.
819
+ */
820
+ export interface InspectControlState {
821
+ /** Whether the control is visible. */
822
+ visible: boolean;
823
+ /** Whether inspect mode is enabled. */
824
+ enabled: boolean;
825
+ /** Currently inspected features. */
826
+ inspectedFeatures: InspectedFeature[];
827
+ /** Index of currently selected feature (when multiple). */
828
+ selectedIndex: number;
829
+ /** Error message if any. */
830
+ error: string | null;
831
+ }
832
+ /**
833
+ * Props for the React InspectControl wrapper component.
834
+ */
835
+ export interface InspectControlReactProps extends InspectControlOptions {
836
+ /** MapLibre GL map instance. */
837
+ map: Map;
838
+ /** Callback fired when a feature is selected/clicked. */
839
+ onFeatureSelect?: (feature: InspectedFeature | null) => void;
840
+ /** Callback fired when features are inspected (may be multiple). */
841
+ onInspect?: (features: InspectedFeature[]) => void;
842
+ /** Callback fired when inspect mode is toggled. */
843
+ onToggle?: (enabled: boolean) => void;
844
+ /** Callback fired when state changes. */
845
+ onStateChange?: (state: InspectControlState) => void;
846
+ }
847
+ /**
848
+ * Inspect-specific event types.
849
+ */
850
+ export type InspectEvent = ComponentEvent | "enable" | "disable" | "featureselect" | "clear";
851
+ /**
852
+ * Inspect event handler function type.
853
+ */
854
+ export type InspectEventHandler = (event: {
855
+ type: InspectEvent;
856
+ state: InspectControlState;
857
+ feature?: InspectedFeature;
858
+ features?: InspectedFeature[];
859
+ }) => void;
860
+ /**
861
+ * Options for configuring the ViewStateControl.
862
+ */
863
+ export interface ViewStateControlOptions {
864
+ /** Position on the map. Default: 'bottom-left'. */
865
+ position?: ControlPosition;
866
+ /** Custom CSS class name. */
867
+ className?: string;
868
+ /** Whether the control is initially visible. Default: true. */
869
+ visible?: boolean;
870
+ /** Whether the panel starts collapsed (button only). Default: true. */
871
+ collapsed?: boolean;
872
+ /** Decimal precision for coordinate values. Default: 4. */
873
+ precision?: number;
874
+ /** Whether to show center coordinates. Default: true. */
875
+ showCenter?: boolean;
876
+ /** Whether to show map bounds. Default: true. */
877
+ showBounds?: boolean;
878
+ /** Whether to show zoom level. Default: true. */
879
+ showZoom?: boolean;
880
+ /** Whether to show pitch value. Default: true. */
881
+ showPitch?: boolean;
882
+ /** Whether to show bearing value. Default: true. */
883
+ showBearing?: boolean;
884
+ /** Whether to enable bounding box drawing. Default: false. */
885
+ enableBBox?: boolean;
886
+ /** Fill color for drawn bounding box. Default: 'rgba(0, 120, 215, 0.1)'. */
887
+ bboxFillColor?: string;
888
+ /** Stroke color for drawn bounding box. Default: '#0078d7'. */
889
+ bboxStrokeColor?: string;
890
+ /** Stroke width for drawn bounding box. Default: 2. */
891
+ bboxStrokeWidth?: number;
892
+ /** Width of the info panel in pixels. Default: 280. */
893
+ panelWidth?: number;
894
+ /** Maximum height of the panel in pixels before scrolling. Default: 500. */
895
+ maxHeight?: number;
896
+ /** Background color of the container. */
897
+ backgroundColor?: string;
898
+ /** Border radius for container. */
899
+ borderRadius?: number;
900
+ /** Opacity of the container (0-1). */
901
+ opacity?: number;
902
+ /** Font size in pixels. */
903
+ fontSize?: number;
904
+ /** Font color. */
905
+ fontColor?: string;
906
+ /** Minimum zoom level at which the control is visible. */
907
+ minzoom?: number;
908
+ /** Maximum zoom level at which the control is visible. */
909
+ maxzoom?: number;
910
+ }
911
+ /**
912
+ * Internal state of the ViewStateControl.
913
+ */
914
+ export interface ViewStateControlState {
915
+ /** Whether the control is visible. */
916
+ visible: boolean;
917
+ /** Whether the panel is collapsed. */
918
+ collapsed: boolean;
919
+ /** Current map center [lng, lat]. */
920
+ center: [number, number];
921
+ /** Current map bounds [west, south, east, north]. */
922
+ bounds: [number, number, number, number];
923
+ /** Current zoom level. */
924
+ zoom: number;
925
+ /** Current pitch in degrees. */
926
+ pitch: number;
927
+ /** Current bearing in degrees. */
928
+ bearing: number;
929
+ /** Whether bbox drawing mode is active. */
930
+ drawingBBox: boolean;
931
+ /** Drawn bounding box [west, south, east, north], or null if none. */
932
+ drawnBBox: [number, number, number, number] | null;
933
+ }
934
+ /**
935
+ * Props for the React ViewStateControl wrapper component.
936
+ */
937
+ export interface ViewStateControlReactProps extends ViewStateControlOptions {
938
+ /** MapLibre GL map instance. */
939
+ map: Map;
940
+ /** Callback fired when a bounding box is drawn. */
941
+ onBBoxDraw?: (bbox: [number, number, number, number]) => void;
942
+ /** Callback fired when bbox drawing mode is toggled. */
943
+ onDrawingToggle?: (drawing: boolean) => void;
944
+ /** Callback fired when state changes. */
945
+ onStateChange?: (state: ViewStateControlState) => void;
946
+ }
947
+ /**
948
+ * ViewState-specific event types.
949
+ */
950
+ export type ViewStateEvent = ComponentEvent | "viewchange" | "bboxdraw" | "bboxclear" | "drawstart" | "drawend";
951
+ /**
952
+ * ViewState event handler function type.
953
+ */
954
+ export type ViewStateEventHandler = (event: {
955
+ type: ViewStateEvent;
956
+ state: ViewStateControlState;
957
+ bbox?: [number, number, number, number];
958
+ }) => void;
959
+ /**
960
+ * Options for the ColorbarGuiControl (GUI wrapper for adding colorbars).
961
+ */
962
+ export interface ColorbarGuiControlOptions {
963
+ /** Position on the map. Default: 'top-right'. */
964
+ position?: ControlPosition;
965
+ /** Custom CSS class name. */
966
+ className?: string;
967
+ /** Whether the control is initially visible. Default: true. */
968
+ visible?: boolean;
969
+ /** Whether the panel starts collapsed (button only). Default: true. */
970
+ collapsed?: boolean;
971
+ /** Panel width in pixels. Default: 280. */
972
+ panelWidth?: number;
973
+ /** Maximum height of the panel. Default: 500. */
974
+ maxHeight?: number;
975
+ /** Background color. */
976
+ backgroundColor?: string;
977
+ /** Border radius. */
978
+ borderRadius?: number;
979
+ /** Opacity (0-1). */
980
+ opacity?: number;
981
+ /** Font size in pixels. */
982
+ fontSize?: number;
983
+ /** Font color. */
984
+ fontColor?: string;
985
+ /** Minimum zoom. */
986
+ minzoom?: number;
987
+ /** Maximum zoom. */
988
+ maxzoom?: number;
989
+ }
990
+ /**
991
+ * Internal state of the ColorbarGuiControl.
992
+ */
993
+ export interface ColorbarGuiControlState {
994
+ /** Whether the control is visible. */
995
+ visible: boolean;
996
+ /** Whether the panel is collapsed. */
997
+ collapsed: boolean;
998
+ /** Colorbar mode: 'named' for predefined colormaps, 'custom' for user-defined colors. */
999
+ mode: "named" | "custom";
1000
+ /** Selected colormap name (used when mode is 'named'). */
1001
+ colormap: ColormapName;
1002
+ /** Custom color list as comma-separated color names or hex codes (used when mode is 'custom'). */
1003
+ customColors: string;
1004
+ /** Minimum value. */
1005
+ vmin: number;
1006
+ /** Maximum value. */
1007
+ vmax: number;
1008
+ /** Label text. */
1009
+ label: string;
1010
+ /** Units text. */
1011
+ units: string;
1012
+ /** Orientation. */
1013
+ orientation: ColorbarOrientation;
1014
+ /** Position of the colorbar on the map. */
1015
+ colorbarPosition: ControlPosition;
1016
+ /** Whether a colorbar is currently active on the map. */
1017
+ hasColorbar: boolean;
1018
+ }
1019
+ /**
1020
+ * ColorbarGuiControl event types.
1021
+ */
1022
+ export type ColorbarGuiEvent = ComponentEvent | "colorbaradd" | "colorbarremove" | "colorbarupdate";
1023
+ /**
1024
+ * ColorbarGuiControl event handler function type.
1025
+ */
1026
+ export type ColorbarGuiEventHandler = (event: {
1027
+ type: ColorbarGuiEvent;
1028
+ state: ColorbarGuiControlState;
1029
+ }) => void;
1030
+ /**
1031
+ * Options for the LegendGuiControl (GUI wrapper for adding legends).
1032
+ */
1033
+ export interface LegendGuiControlOptions {
1034
+ /** Position on the map. Default: 'top-right'. */
1035
+ position?: ControlPosition;
1036
+ /** Custom CSS class name. */
1037
+ className?: string;
1038
+ /** Whether the control is initially visible. Default: true. */
1039
+ visible?: boolean;
1040
+ /** Whether the panel starts collapsed (button only). Default: true. */
1041
+ collapsed?: boolean;
1042
+ /** Panel width in pixels. Default: 280. */
1043
+ panelWidth?: number;
1044
+ /** Maximum height of the panel. Default: 500. */
1045
+ maxHeight?: number;
1046
+ /** Background color. */
1047
+ backgroundColor?: string;
1048
+ /** Border radius. */
1049
+ borderRadius?: number;
1050
+ /** Opacity (0-1). */
1051
+ opacity?: number;
1052
+ /** Font size in pixels. */
1053
+ fontSize?: number;
1054
+ /** Font color. */
1055
+ fontColor?: string;
1056
+ /** Minimum zoom. */
1057
+ minzoom?: number;
1058
+ /** Maximum zoom. */
1059
+ maxzoom?: number;
1060
+ }
1061
+ /**
1062
+ * Internal state of the LegendGuiControl.
1063
+ */
1064
+ export interface LegendGuiControlState {
1065
+ /** Whether the control is visible. */
1066
+ visible: boolean;
1067
+ /** Whether the panel is collapsed. */
1068
+ collapsed: boolean;
1069
+ /** Legend title. */
1070
+ title: string;
1071
+ /** Current legend items. */
1072
+ items: LegendItem[];
1073
+ /** Position of the legend on the map. */
1074
+ legendPosition: ControlPosition;
1075
+ /** Whether a legend is currently active on the map. */
1076
+ hasLegend: boolean;
1077
+ }
1078
+ /**
1079
+ * LegendGuiControl event types.
1080
+ */
1081
+ export type LegendGuiEvent = ComponentEvent | "legendadd" | "legendremove" | "legendupdate";
1082
+ /**
1083
+ * LegendGuiControl event handler function type.
1084
+ */
1085
+ export type LegendGuiEventHandler = (event: {
1086
+ type: LegendGuiEvent;
1087
+ state: LegendGuiControlState;
1088
+ }) => void;
1089
+ /**
1090
+ * Options for the HtmlGuiControl (GUI wrapper for adding HTML content controls).
1091
+ */
1092
+ export interface HtmlGuiControlOptions {
1093
+ /** Position on the map. Default: 'top-right'. */
1094
+ position?: ControlPosition;
1095
+ /** Custom CSS class name. */
1096
+ className?: string;
1097
+ /** Whether the control is initially visible. Default: true. */
1098
+ visible?: boolean;
1099
+ /** Whether the panel starts collapsed (button only). Default: true. */
1100
+ collapsed?: boolean;
1101
+ /** Panel width in pixels. Default: 280. */
1102
+ panelWidth?: number;
1103
+ /** Maximum height of the panel. Default: 500. */
1104
+ maxHeight?: number;
1105
+ /** Background color. */
1106
+ backgroundColor?: string;
1107
+ /** Border radius. */
1108
+ borderRadius?: number;
1109
+ /** Opacity (0-1). */
1110
+ opacity?: number;
1111
+ /** Font size in pixels. */
1112
+ fontSize?: number;
1113
+ /** Font color. */
1114
+ fontColor?: string;
1115
+ /** Minimum zoom. */
1116
+ minzoom?: number;
1117
+ /** Maximum zoom. */
1118
+ maxzoom?: number;
1119
+ }
1120
+ /**
1121
+ * Internal state of the HtmlGuiControl.
1122
+ */
1123
+ export interface HtmlGuiControlState {
1124
+ /** Whether the control is visible. */
1125
+ visible: boolean;
1126
+ /** Whether the panel is collapsed. */
1127
+ collapsed: boolean;
1128
+ /** Title for the HTML control. */
1129
+ title: string;
1130
+ /** Current HTML content. */
1131
+ html: string;
1132
+ /** Position of the HTML control on the map. */
1133
+ htmlPosition: ControlPosition;
1134
+ /** Whether the HTML control is collapsible. */
1135
+ collapsible: boolean;
1136
+ /** Whether an HTML control is currently active on the map. */
1137
+ hasHtmlControl: boolean;
1138
+ }
1139
+ /**
1140
+ * HtmlGuiControl event types.
1141
+ */
1142
+ export type HtmlGuiEvent = ComponentEvent | "htmladd" | "htmlremove" | "htmlupdate";
1143
+ /**
1144
+ * HtmlGuiControl event handler function type.
1145
+ */
1146
+ export type HtmlGuiEventHandler = (event: {
1147
+ type: HtmlGuiEvent;
1148
+ state: HtmlGuiControlState;
1149
+ }) => void;
1150
+ /**
1151
+ * Names of built-in controls that can be added to a ControlGrid via `defaultControls`.
1152
+ */
1153
+ export type DefaultControlName = "fullscreen" | "globe" | "north" | "terrain" | "search" | "viewState" | "inspect" | "vectorDataset" | "basemap" | "cogLayer" | "minimap" | "measure" | "bookmark" | "print" | "zarrLayer" | "pmtilesLayer" | "stacLayer" | "stacSearch" | "addVector" | "choropleth" | "geoEditor" | "lidar" | "planetaryComputer" | "gaussianSplat" | "streetView" | "swipe" | "usgsLidar" | "colorbarGui" | "legendGui" | "htmlGui";
1154
+ /**
1155
+ * Options for configuring the ControlGrid.
1156
+ */
1157
+ export interface ControlGridOptions {
1158
+ /** Title for the control header. */
1159
+ title?: string;
1160
+ /** Position on the map. */
1161
+ position?: ControlPosition;
1162
+ /** Custom CSS class name. */
1163
+ className?: string;
1164
+ /** Whether the control is initially visible. */
1165
+ visible?: boolean;
1166
+ /** Whether the control is collapsible. */
1167
+ collapsible?: boolean;
1168
+ /** Whether the control starts collapsed. */
1169
+ collapsed?: boolean;
1170
+ /** Number of rows in the grid. */
1171
+ rows?: number;
1172
+ /** Number of columns in the grid. */
1173
+ columns?: number;
1174
+ /** Show row/column number inputs in the UI. */
1175
+ showRowColumnControls?: boolean;
1176
+ /** Initial controls to display in the grid (IControl instances). */
1177
+ controls?: IControl[];
1178
+ /** Built-in controls to create and add automatically (e.g. ['globe', 'terrain', 'search']). */
1179
+ defaultControls?: DefaultControlName[];
1180
+ /** Background color of the container. */
1181
+ backgroundColor?: string;
1182
+ /** Padding inside the container in pixels. */
1183
+ padding?: number;
1184
+ /** Border radius for container. */
1185
+ borderRadius?: number;
1186
+ /** Opacity of the container (0-1). */
1187
+ opacity?: number;
1188
+ /** Gap between grid cells in pixels. */
1189
+ gap?: number;
1190
+ /** Minimum zoom level at which the control is visible. */
1191
+ minzoom?: number;
1192
+ /** Maximum zoom level at which the control is visible. */
1193
+ maxzoom?: number;
1194
+ /** URL of the basemap style JSON. Used by SwipeControl to group basemap layers. */
1195
+ basemapStyleUrl?: string;
1196
+ /**
1197
+ * Layer ID patterns to exclude from SwipeControl layer list.
1198
+ * Supports glob-style wildcards (e.g., 'measure-*', 'gl-draw-*').
1199
+ */
1200
+ excludeLayers?: string[];
1201
+ /**
1202
+ * Optional StreetView control options.
1203
+ *
1204
+ * If omitted, ControlGrid auto-loads `googleApiKey` and `mapillaryAccessToken`
1205
+ * from Vite env vars (`VITE_GOOGLE_MAPS_API_KEY`, `VITE_MAPILLARY_ACCESS_TOKEN`).
1206
+ */
1207
+ streetViewOptions?: Partial<StreetViewControlOptions>;
1208
+ }
1209
+ /**
1210
+ * Internal state of the ControlGrid.
1211
+ */
1212
+ export interface ControlGridState {
1213
+ /** Whether the control is visible. */
1214
+ visible: boolean;
1215
+ /** Whether the control is collapsed. */
1216
+ collapsed: boolean;
1217
+ /** Current number of rows. */
1218
+ rows: number;
1219
+ /** Current number of columns. */
1220
+ columns: number;
1221
+ }
1222
+ /**
1223
+ * Props for the React ControlGrid wrapper component.
1224
+ */
1225
+ export interface ControlGridReactProps extends ControlGridOptions {
1226
+ /** MapLibre GL map instance. */
1227
+ map: Map;
1228
+ /** Callback fired when state changes. */
1229
+ onStateChange?: (state: ControlGridState) => void;
1230
+ }
1231
+ /**
1232
+ * ControlGrid-specific event types.
1233
+ */
1234
+ export type ControlGridEvent = ComponentEvent | "controladd" | "controlremove";
1235
+ /**
1236
+ * ControlGrid event handler function type.
1237
+ */
1238
+ export type ControlGridEventHandler = (event: {
1239
+ type: ControlGridEvent;
1240
+ state: ControlGridState;
1241
+ control?: IControl;
1242
+ }) => void;
1243
+ /**
1244
+ * Information about a single added COG layer.
1245
+ */
1246
+ export interface CogLayerInfo {
1247
+ /** Unique layer identifier. */
1248
+ id: string;
1249
+ /** Optional custom display name. */
1250
+ name?: string;
1251
+ /** COG URL. */
1252
+ url: string;
1253
+ /** Bands string. */
1254
+ bands: string;
1255
+ /** Colormap name. */
1256
+ colormap: ColormapName | "none";
1257
+ /** Rescale minimum. */
1258
+ rescaleMin: number;
1259
+ /** Rescale maximum. */
1260
+ rescaleMax: number;
1261
+ /** Nodata value. */
1262
+ nodata: number | undefined;
1263
+ /** Layer opacity. */
1264
+ opacity: number;
1265
+ }
1266
+ /**
1267
+ * Options for configuring the CogLayerControl.
1268
+ */
1269
+ export interface CogLayerControlOptions {
1270
+ /** Position on the map. Default: 'top-right'. */
1271
+ position?: ControlPosition;
1272
+ /** Custom CSS class name. */
1273
+ className?: string;
1274
+ /** Whether the control is initially visible. Default: true. */
1275
+ visible?: boolean;
1276
+ /** Whether the panel starts collapsed (button only). Default: true. */
1277
+ collapsed?: boolean;
1278
+ /** Layer ID to insert COG layers before. If not specified, layers are added on top. */
1279
+ beforeId?: string;
1280
+ /** Default COG URL to pre-fill. */
1281
+ defaultUrl?: string;
1282
+ /** Whether to automatically load the defaultUrl when control is added. Default: false. */
1283
+ loadDefaultUrl?: boolean;
1284
+ /** Default bands (comma-separated, e.g. '1' or '1,2,3'). Default: '1'. */
1285
+ defaultBands?: string;
1286
+ /** Default colormap name. Default: 'viridis'. */
1287
+ defaultColormap?: ColormapName | "none";
1288
+ /** Default rescale minimum. Default: 0. */
1289
+ defaultRescaleMin?: number;
1290
+ /** Default rescale maximum. Default: 255. */
1291
+ defaultRescaleMax?: number;
1292
+ /** Default nodata value. */
1293
+ defaultNodata?: number;
1294
+ /** Default opacity (0-1). Default: 1. */
1295
+ defaultOpacity?: number;
1296
+ /** Default layer name to pre-fill. If not specified, name is auto-generated. */
1297
+ defaultLayerName?: string;
1298
+ /** Whether COG layers are pickable (clickable to show pixel values). Default: true. */
1299
+ defaultPickable?: boolean;
1300
+ /** Width of the panel in pixels. Default: 300. */
1301
+ panelWidth?: number;
1302
+ /** Maximum height of the panel in pixels before scrolling. Default: 500. */
1303
+ maxHeight?: number;
1304
+ /** Background color of the container. */
1305
+ backgroundColor?: string;
1306
+ /** Border radius for container. */
1307
+ borderRadius?: number;
1308
+ /** Opacity of the container (0-1). */
1309
+ opacity?: number;
1310
+ /** Font size in pixels. */
1311
+ fontSize?: number;
1312
+ /** Font color. */
1313
+ fontColor?: string;
1314
+ /** Minimum zoom level at which the control is visible. */
1315
+ minzoom?: number;
1316
+ /** Maximum zoom level at which the control is visible. */
1317
+ maxzoom?: number;
1318
+ }
1319
+ /**
1320
+ * Internal state of the CogLayerControl.
1321
+ */
1322
+ export interface CogLayerControlState {
1323
+ /** Whether the control is visible. */
1324
+ visible: boolean;
1325
+ /** Whether the panel is collapsed. */
1326
+ collapsed: boolean;
1327
+ /** Current COG URL. */
1328
+ url: string;
1329
+ /** Current bands. */
1330
+ bands: string;
1331
+ /** Current colormap. */
1332
+ colormap: ColormapName | "none";
1333
+ /** Current rescale min. */
1334
+ rescaleMin: number;
1335
+ /** Current rescale max. */
1336
+ rescaleMax: number;
1337
+ /** Current nodata value. */
1338
+ nodata: number | undefined;
1339
+ /** Current layer name (optional, auto-generated if empty). */
1340
+ layerName: string;
1341
+ /** Current opacity (0-1). */
1342
+ layerOpacity: number;
1343
+ /** Whether layers are pickable (clickable). */
1344
+ pickable: boolean;
1345
+ /** Whether any COG layer is currently active. */
1346
+ hasLayer: boolean;
1347
+ /** Number of active COG layers. */
1348
+ layerCount: number;
1349
+ /** Information about all active COG layers. */
1350
+ layers: CogLayerInfo[];
1351
+ /** Whether the layer is loading. */
1352
+ loading: boolean;
1353
+ /** Error message if any. */
1354
+ error: string | null;
1355
+ /** Status message. */
1356
+ status: string | null;
1357
+ }
1358
+ /**
1359
+ * Props for the React CogLayerControl wrapper component.
1360
+ */
1361
+ export interface CogLayerControlReactProps extends CogLayerControlOptions {
1362
+ /** MapLibre GL map instance. */
1363
+ map: Map;
1364
+ /** Callback fired when a layer is added. */
1365
+ onLayerAdd?: (url: string) => void;
1366
+ /** Callback fired when a layer is removed. */
1367
+ onLayerRemove?: () => void;
1368
+ /** Callback fired when a layer is updated. */
1369
+ onLayerUpdate?: (url: string) => void;
1370
+ /** Callback fired when an error occurs. */
1371
+ onError?: (error: string) => void;
1372
+ /** Callback fired when state changes. */
1373
+ onStateChange?: (state: CogLayerControlState) => void;
1374
+ }
1375
+ /**
1376
+ * CogLayer-specific event types.
1377
+ */
1378
+ export type CogLayerEvent = ComponentEvent | "layeradd" | "layerremove" | "layerupdate" | "error";
1379
+ /**
1380
+ * CogLayer event handler function type.
1381
+ */
1382
+ export type CogLayerEventHandler = (event: {
1383
+ type: CogLayerEvent;
1384
+ state: CogLayerControlState;
1385
+ url?: string;
1386
+ error?: string;
1387
+ layerId?: string;
1388
+ }) => void;
1389
+ /**
1390
+ * Information about a single added Zarr layer.
1391
+ */
1392
+ export interface ZarrLayerInfo {
1393
+ /** Unique layer identifier. */
1394
+ id: string;
1395
+ /** Optional custom display name. */
1396
+ name?: string;
1397
+ /** Zarr URL. */
1398
+ url: string;
1399
+ /** Variable name. */
1400
+ variable: string;
1401
+ /** Colormap (array of hex colors). */
1402
+ colormap: string[];
1403
+ /** Color limits [min, max]. */
1404
+ clim: [number, number];
1405
+ /** Selector for dimensions (e.g., { time: 0, band: 'prec' }). */
1406
+ selector?: Record<string, number | string>;
1407
+ /** Layer opacity. */
1408
+ opacity: number;
1409
+ }
1410
+ /**
1411
+ * Options for configuring the ZarrLayerControl.
1412
+ */
1413
+ export interface ZarrLayerControlOptions {
1414
+ /** Position on the map. Default: 'top-right'. */
1415
+ position?: ControlPosition;
1416
+ /** Custom CSS class name. */
1417
+ className?: string;
1418
+ /** Whether the control is initially visible. Default: true. */
1419
+ visible?: boolean;
1420
+ /** Whether the panel starts collapsed (button only). Default: true. */
1421
+ collapsed?: boolean;
1422
+ /** Layer ID to insert Zarr layers before. If not specified, layers are added on top. */
1423
+ beforeId?: string;
1424
+ /** Default Zarr URL to pre-fill. */
1425
+ defaultUrl?: string;
1426
+ /** Whether to automatically load the defaultUrl when control is added. Default: false. */
1427
+ loadDefaultUrl?: boolean;
1428
+ /** Default variable name. Default: ''. */
1429
+ defaultVariable?: string;
1430
+ /** Default colormap (array of hex colors). */
1431
+ defaultColormap?: string[];
1432
+ /** Default color limits. Default: [0, 1]. */
1433
+ defaultClim?: [number, number];
1434
+ /** Default selector for dimensions. */
1435
+ defaultSelector?: Record<string, number | string>;
1436
+ /** Default opacity (0-1). Default: 1. */
1437
+ defaultOpacity?: number;
1438
+ /** Default layer name to pre-fill. If not specified, name is auto-generated. */
1439
+ defaultLayerName?: string;
1440
+ /** Whether Zarr layers are pickable (clickable to show info). Default: true. */
1441
+ defaultPickable?: boolean;
1442
+ /** Width of the panel in pixels. Default: 300. */
1443
+ panelWidth?: number;
1444
+ /** Maximum height of the panel in pixels before scrolling. Default: 500. */
1445
+ maxHeight?: number;
1446
+ /** Background color of the container. */
1447
+ backgroundColor?: string;
1448
+ /** Border radius for container. */
1449
+ borderRadius?: number;
1450
+ /** Opacity of the container (0-1). */
1451
+ opacity?: number;
1452
+ /** Font size in pixels. */
1453
+ fontSize?: number;
1454
+ /** Font color. */
1455
+ fontColor?: string;
1456
+ /** Minimum zoom level at which the control is visible. */
1457
+ minzoom?: number;
1458
+ /** Maximum zoom level at which the control is visible. */
1459
+ maxzoom?: number;
1460
+ }
1461
+ /**
1462
+ * Internal state of the ZarrLayerControl.
1463
+ */
1464
+ export interface ZarrLayerControlState {
1465
+ /** Whether the control is visible. */
1466
+ visible: boolean;
1467
+ /** Whether the panel is collapsed. */
1468
+ collapsed: boolean;
1469
+ /** Current Zarr URL. */
1470
+ url: string;
1471
+ /** Current variable name. */
1472
+ variable: string;
1473
+ /** Current colormap. */
1474
+ colormap: string[];
1475
+ /** Current color limits. */
1476
+ clim: [number, number];
1477
+ /** Current selector. */
1478
+ selector?: Record<string, number | string>;
1479
+ /** Current layer name (optional, auto-generated if empty). */
1480
+ layerName: string;
1481
+ /** Current opacity (0-1). */
1482
+ layerOpacity: number;
1483
+ /** Whether layers are pickable (clickable). */
1484
+ pickable: boolean;
1485
+ /** Whether any Zarr layer is currently active. */
1486
+ hasLayer: boolean;
1487
+ /** Number of active Zarr layers. */
1488
+ layerCount: number;
1489
+ /** Information about all active Zarr layers. */
1490
+ layers: ZarrLayerInfo[];
1491
+ /** Whether the layer is loading. */
1492
+ loading: boolean;
1493
+ /** Error message if any. */
1494
+ error: string | null;
1495
+ /** Status message. */
1496
+ status: string | null;
1497
+ }
1498
+ /**
1499
+ * Props for the React ZarrLayerControl wrapper component.
1500
+ */
1501
+ export interface ZarrLayerControlReactProps extends ZarrLayerControlOptions {
1502
+ /** MapLibre GL map instance. */
1503
+ map: Map;
1504
+ /** Callback fired when a layer is added. */
1505
+ onLayerAdd?: (url: string) => void;
1506
+ /** Callback fired when a layer is removed. */
1507
+ onLayerRemove?: () => void;
1508
+ /** Callback fired when a layer is updated. */
1509
+ onLayerUpdate?: (url: string) => void;
1510
+ /** Callback fired when an error occurs. */
1511
+ onError?: (error: string) => void;
1512
+ /** Callback fired when state changes. */
1513
+ onStateChange?: (state: ZarrLayerControlState) => void;
1514
+ }
1515
+ /**
1516
+ * ZarrLayer-specific event types.
1517
+ */
1518
+ export type ZarrLayerEvent = ComponentEvent | "layeradd" | "layerremove" | "layerupdate" | "error";
1519
+ /**
1520
+ * ZarrLayer event handler function type.
1521
+ */
1522
+ export type ZarrLayerEventHandler = (event: {
1523
+ type: ZarrLayerEvent;
1524
+ state: ZarrLayerControlState;
1525
+ url?: string;
1526
+ error?: string;
1527
+ layerId?: string;
1528
+ }) => void;
1529
+ /**
1530
+ * PMTiles tile type.
1531
+ */
1532
+ export type PMTilesTileType = "vector" | "raster" | "unknown";
1533
+ /**
1534
+ * Information about a single added PMTiles layer.
1535
+ */
1536
+ export interface PMTilesLayerInfo {
1537
+ /** Unique layer identifier. */
1538
+ id: string;
1539
+ /** Optional custom display name. */
1540
+ name?: string;
1541
+ /** PMTiles URL. */
1542
+ url: string;
1543
+ /** Tile type (vector or raster). */
1544
+ tileType: PMTilesTileType;
1545
+ /** Source layers available (for vector tiles). */
1546
+ sourceLayers: string[];
1547
+ /** MapLibre layer IDs created for this source. */
1548
+ layerIds: string[];
1549
+ /** Layer opacity. */
1550
+ opacity: number;
1551
+ /** Whether features are pickable (clickable). */
1552
+ pickable: boolean;
1553
+ }
1554
+ /**
1555
+ * Options for configuring the PMTilesLayerControl.
1556
+ */
1557
+ export interface PMTilesLayerControlOptions {
1558
+ /** Position on the map. Default: 'top-right'. */
1559
+ position?: ControlPosition;
1560
+ /** Custom CSS class name. */
1561
+ className?: string;
1562
+ /** Whether the control is initially visible. Default: true. */
1563
+ visible?: boolean;
1564
+ /** Whether the panel starts collapsed (button only). Default: true. */
1565
+ collapsed?: boolean;
1566
+ /** Layer ID to insert PMTiles layers before. If not specified, layers are added on top. */
1567
+ beforeId?: string;
1568
+ /** Default PMTiles URL to pre-fill. */
1569
+ defaultUrl?: string;
1570
+ /** Whether to automatically load the defaultUrl when control is added. Default: false. */
1571
+ loadDefaultUrl?: boolean;
1572
+ /** Default opacity (0-1). Default: 1. */
1573
+ defaultOpacity?: number;
1574
+ /** Default fill color for vector polygons. Default: 'steelblue'. */
1575
+ defaultFillColor?: string;
1576
+ /** Default line color for vector lines. Default: '#333'. */
1577
+ defaultLineColor?: string;
1578
+ /** Default circle color for vector points. Default: 'steelblue'. */
1579
+ defaultCircleColor?: string;
1580
+ /** Default layer name to pre-fill. If not specified, name is auto-generated. */
1581
+ defaultLayerName?: string;
1582
+ /** Whether features are pickable (clickable) by default. Default: true. */
1583
+ defaultPickable?: boolean;
1584
+ /** Width of the panel in pixels. Default: 300. */
1585
+ panelWidth?: number;
1586
+ /** Maximum height of the panel in pixels before scrolling. Default: 500. */
1587
+ maxHeight?: number;
1588
+ /** Background color of the container. */
1589
+ backgroundColor?: string;
1590
+ /** Border radius for container. */
1591
+ borderRadius?: number;
1592
+ /** Opacity of the container (0-1). */
1593
+ opacity?: number;
1594
+ /** Font size in pixels. */
1595
+ fontSize?: number;
1596
+ /** Font color. */
1597
+ fontColor?: string;
1598
+ /** Minimum zoom level at which the control is visible. */
1599
+ minzoom?: number;
1600
+ /** Maximum zoom level at which the control is visible. */
1601
+ maxzoom?: number;
1602
+ }
1603
+ /**
1604
+ * Internal state of the PMTilesLayerControl.
1605
+ */
1606
+ export interface PMTilesLayerControlState {
1607
+ /** Whether the control is visible. */
1608
+ visible: boolean;
1609
+ /** Whether the panel is collapsed. */
1610
+ collapsed: boolean;
1611
+ /** Current PMTiles URL. */
1612
+ url: string;
1613
+ /** Current layer name (optional, auto-generated if empty). */
1614
+ layerName: string;
1615
+ /** Current opacity (0-1). */
1616
+ layerOpacity: number;
1617
+ /** Available source layers (fetched from metadata). */
1618
+ availableSourceLayers: string[];
1619
+ /** Selected source layers to render. */
1620
+ selectedSourceLayers: string[];
1621
+ /** Whether features are pickable (clickable). */
1622
+ pickable: boolean;
1623
+ /** Whether any PMTiles layer is currently active. */
1624
+ hasLayer: boolean;
1625
+ /** Number of active PMTiles layers. */
1626
+ layerCount: number;
1627
+ /** Information about all active PMTiles layers. */
1628
+ layers: PMTilesLayerInfo[];
1629
+ /** Whether the layer is loading. */
1630
+ loading: boolean;
1631
+ /** Error message if any. */
1632
+ error: string | null;
1633
+ /** Status message. */
1634
+ status: string | null;
1635
+ }
1636
+ /**
1637
+ * Props for the React PMTilesLayerControl wrapper component.
1638
+ */
1639
+ export interface PMTilesLayerControlReactProps extends PMTilesLayerControlOptions {
1640
+ /** MapLibre GL map instance. */
1641
+ map: Map;
1642
+ /** Callback fired when a layer is added. */
1643
+ onLayerAdd?: (url: string) => void;
1644
+ /** Callback fired when a layer is removed. */
1645
+ onLayerRemove?: () => void;
1646
+ /** Callback fired when an error occurs. */
1647
+ onError?: (error: string) => void;
1648
+ /** Callback fired when state changes. */
1649
+ onStateChange?: (state: PMTilesLayerControlState) => void;
1650
+ }
1651
+ /**
1652
+ * PMTilesLayer-specific event types.
1653
+ */
1654
+ export type PMTilesLayerEvent = ComponentEvent | "layeradd" | "layerremove" | "error";
1655
+ /**
1656
+ * PMTilesLayer event handler function type.
1657
+ */
1658
+ export type PMTilesLayerEventHandler = (event: {
1659
+ type: PMTilesLayerEvent;
1660
+ state: PMTilesLayerControlState;
1661
+ url?: string;
1662
+ error?: string;
1663
+ layerId?: string;
1664
+ }) => void;
1665
+ /**
1666
+ * Supported remote vector format types for AddVectorControl.
1667
+ */
1668
+ export type RemoteVectorFormat = "geojson" | "geoparquet" | "flatgeobuf" | "auto";
1669
+ /**
1670
+ * Information about a single added vector layer from URL.
1671
+ */
1672
+ export interface AddVectorLayerInfo {
1673
+ /** Unique layer identifier. */
1674
+ id: string;
1675
+ /** Vector data URL. */
1676
+ url: string;
1677
+ /** Detected or specified format. */
1678
+ format: RemoteVectorFormat;
1679
+ /** Source ID in MapLibre. */
1680
+ sourceId: string;
1681
+ /** Array of layer IDs created for this dataset. */
1682
+ layerIds: string[];
1683
+ /** GeoJSON feature count. */
1684
+ featureCount: number;
1685
+ /** Geometry types present in the dataset. */
1686
+ geometryTypes: string[];
1687
+ /** Layer opacity. */
1688
+ opacity: number;
1689
+ /** Fill color. */
1690
+ fillColor: string;
1691
+ /** Stroke color. */
1692
+ strokeColor: string;
1693
+ /** Whether the layer is pickable (clickable). */
1694
+ pickable?: boolean;
1695
+ /** Whether viewport-based loading is enabled for this layer. */
1696
+ viewportLoading?: boolean;
1697
+ /** DuckDB registered filename for viewport loading. */
1698
+ duckdbFileName?: string;
1699
+ /** Geometry column name for spatial queries. */
1700
+ geometryColumn?: string;
1701
+ /** Geometry column type (for WKB handling). */
1702
+ geometryColumnType?: string;
1703
+ /** Property column names for spatial queries. */
1704
+ propertyColumns?: string[];
1705
+ /** Minimum zoom level for viewport loading (layer will be hidden below this). */
1706
+ viewportMinZoom?: number;
1707
+ }
1708
+ /**
1709
+ * Options for configuring the AddVectorControl.
1710
+ */
1711
+ export interface AddVectorControlOptions {
1712
+ /** Position on the map. Default: 'top-right'. */
1713
+ position?: ControlPosition;
1714
+ /** Custom CSS class name. */
1715
+ className?: string;
1716
+ /** Whether the control is initially visible. Default: true. */
1717
+ visible?: boolean;
1718
+ /** Whether the panel starts collapsed (button only). Default: true. */
1719
+ collapsed?: boolean;
1720
+ /** Layer ID to insert vector layers before. If not specified, layers are added on top. */
1721
+ beforeId?: string;
1722
+ /** Default URL to pre-fill. */
1723
+ defaultUrl?: string;
1724
+ /** Default layer name to pre-fill. If not specified, a unique ID is generated. */
1725
+ defaultLayerName?: string;
1726
+ /** Whether to automatically load the defaultUrl when control is added. Default: false. */
1727
+ loadDefaultUrl?: boolean;
1728
+ /** Default format. Default: 'auto'. */
1729
+ defaultFormat?: RemoteVectorFormat;
1730
+ /** Default opacity (0-1). Default: 1. */
1731
+ defaultOpacity?: number;
1732
+ /** Default fill color for polygons. Default: '#3388ff'. */
1733
+ defaultFillColor?: string;
1734
+ /** Default stroke color for lines and polygon outlines. Default: '#3388ff'. */
1735
+ defaultStrokeColor?: string;
1736
+ /** Default circle color for points. Default: '#3388ff'. */
1737
+ defaultCircleColor?: string;
1738
+ /** Whether layers are pickable (clickable to show feature info). Default: true. */
1739
+ defaultPickable?: boolean;
1740
+ /** CORS proxy URL prefix for fetching files from servers without CORS. The URL will be appended. */
1741
+ corsProxy?: string;
1742
+ /** Whether to fit map bounds to loaded data. Default: true. */
1743
+ fitBounds?: boolean;
1744
+ /** Padding for fitBounds in pixels. Default: 50. */
1745
+ fitBoundsPadding?: number;
1746
+ /** Width of the panel in pixels. Default: 300. */
1747
+ panelWidth?: number;
1748
+ /** Maximum height of the panel in pixels before scrolling. Default: 500. */
1749
+ maxHeight?: number;
1750
+ /** Background color of the container. */
1751
+ backgroundColor?: string;
1752
+ /** Border radius for container. */
1753
+ borderRadius?: number;
1754
+ /** Opacity of the container (0-1). */
1755
+ opacity?: number;
1756
+ /** Font size in pixels. */
1757
+ fontSize?: number;
1758
+ /** Font color. */
1759
+ fontColor?: string;
1760
+ /** Minimum zoom level at which the control is visible. */
1761
+ minzoom?: number;
1762
+ /** Maximum zoom level at which the control is visible. */
1763
+ maxzoom?: number;
1764
+ /**
1765
+ * Enable viewport-based loading for GeoParquet files.
1766
+ * When enabled, only features within the current map bounds are loaded using HTTP range requests.
1767
+ * This is ideal for large GeoParquet files (100MB+) as it avoids downloading the entire file.
1768
+ * Default: false.
1769
+ */
1770
+ geoparquetViewportLoading?: boolean;
1771
+ /**
1772
+ * Minimum zoom level for viewport-based GeoParquet loading.
1773
+ * The layer will be hidden below this zoom level to prevent loading too many features.
1774
+ * Only applies when geoparquetViewportLoading is enabled.
1775
+ * Default: 8.
1776
+ */
1777
+ geoparquetMinZoom?: number;
1778
+ /**
1779
+ * Debounce delay in milliseconds for viewport updates when panning/zooming.
1780
+ * Only applies when geoparquetViewportLoading is enabled.
1781
+ * Default: 300.
1782
+ */
1783
+ geoparquetDebounceMs?: number;
1784
+ }
1785
+ /**
1786
+ * Input mode for AddVectorControl - URL or inline GeoJSON text.
1787
+ */
1788
+ export type AddVectorInputMode = "url" | "text";
1789
+ /**
1790
+ * Internal state of the AddVectorControl.
1791
+ */
1792
+ export interface AddVectorControlState {
1793
+ /** Whether the control is visible. */
1794
+ visible: boolean;
1795
+ /** Whether the panel is collapsed. */
1796
+ collapsed: boolean;
1797
+ /** Input mode: 'url' for URL input, 'text' for pasting GeoJSON directly. */
1798
+ inputMode: AddVectorInputMode;
1799
+ /** Current vector URL. */
1800
+ url: string;
1801
+ /** Current GeoJSON text (when inputMode is 'text'). */
1802
+ geojsonText: string;
1803
+ /** Current layer name (optional, auto-generated if empty). */
1804
+ layerName: string;
1805
+ /** Current beforeId for layer ordering. */
1806
+ beforeId: string;
1807
+ /** Current format. */
1808
+ format: RemoteVectorFormat;
1809
+ /** Current opacity (0-1). */
1810
+ layerOpacity: number;
1811
+ /** Current fill color. */
1812
+ fillColor: string;
1813
+ /** Current stroke color. */
1814
+ strokeColor: string;
1815
+ /** Current circle/point color. */
1816
+ circleColor: string;
1817
+ /** Whether layers are pickable (clickable). */
1818
+ pickable: boolean;
1819
+ /** Whether viewport-based GeoParquet loading is enabled. */
1820
+ viewportLoading: boolean;
1821
+ /** Minimum zoom for viewport loading. */
1822
+ viewportMinZoom: number;
1823
+ /** Whether any vector layer is currently active. */
1824
+ hasLayer: boolean;
1825
+ /** Number of active vector layers. */
1826
+ layerCount: number;
1827
+ /** Information about all active vector layers. */
1828
+ layers: AddVectorLayerInfo[];
1829
+ /** Whether the layer is loading. */
1830
+ loading: boolean;
1831
+ /** Error message if any. */
1832
+ error: string | null;
1833
+ /** Status message. */
1834
+ status: string | null;
1835
+ }
1836
+ /**
1837
+ * Props for a potential React AddVectorControl wrapper component.
1838
+ * Note: No React wrapper is currently implemented. This interface is provided
1839
+ * for type consistency with other controls and future implementation.
1840
+ */
1841
+ export interface AddVectorControlReactProps extends AddVectorControlOptions {
1842
+ /** MapLibre GL map instance. */
1843
+ map: Map;
1844
+ /** Callback fired when a layer is added. */
1845
+ onLayerAdd?: (url: string) => void;
1846
+ /** Callback fired when a layer is removed. */
1847
+ onLayerRemove?: () => void;
1848
+ /** Callback fired when an error occurs. */
1849
+ onError?: (error: string) => void;
1850
+ /** Callback fired when state changes. */
1851
+ onStateChange?: (state: AddVectorControlState) => void;
1852
+ }
1853
+ /**
1854
+ * AddVector-specific event types.
1855
+ */
1856
+ export type AddVectorEvent = ComponentEvent | "layeradd" | "layerremove" | "error";
1857
+ /**
1858
+ * AddVector event handler function type.
1859
+ */
1860
+ export type AddVectorEventHandler = (event: {
1861
+ type: AddVectorEvent;
1862
+ state: AddVectorControlState;
1863
+ url?: string;
1864
+ error?: string;
1865
+ layerId?: string;
1866
+ }) => void;
1867
+ /**
1868
+ * Classification scheme for choropleth maps.
1869
+ */
1870
+ export type ChoroplethClassificationScheme = "quantile" | "equal_interval" | "natural_breaks" | "std_mean" | "head_tail";
1871
+ /**
1872
+ * Information about a single choropleth layer.
1873
+ */
1874
+ export interface ChoroplethLayerInfo {
1875
+ /** Unique layer identifier. */
1876
+ id: string;
1877
+ /** Data URL. */
1878
+ url: string;
1879
+ /** Source ID in MapLibre. */
1880
+ sourceId: string;
1881
+ /** Array of layer IDs created for this dataset. */
1882
+ layerIds: string[];
1883
+ /** GeoJSON feature count. */
1884
+ featureCount: number;
1885
+ /** Geometry types present. */
1886
+ geometryTypes: string[];
1887
+ /** Column used for classification. */
1888
+ column: string;
1889
+ /** Classification scheme used. */
1890
+ scheme: ChoroplethClassificationScheme;
1891
+ /** Number of classes. */
1892
+ k: number;
1893
+ /** Colormap name used. */
1894
+ colormap: ColormapName;
1895
+ /** Break values. */
1896
+ breaks: number[];
1897
+ /** Colors for legend. */
1898
+ legendColors: string[];
1899
+ /** Labels for legend. */
1900
+ legendLabels: string[];
1901
+ /** Layer opacity. */
1902
+ opacity: number;
1903
+ /** Whether 3D extrusion was used. */
1904
+ extrude: boolean;
1905
+ /** Scale factor for extrusion. */
1906
+ scaleFactor: number;
1907
+ }
1908
+ /**
1909
+ * Options for configuring the ChoroplethControl.
1910
+ */
1911
+ export interface ChoroplethControlOptions {
1912
+ /** Position on the map. Default: 'top-right'. */
1913
+ position?: ControlPosition;
1914
+ /** Custom CSS class name. */
1915
+ className?: string;
1916
+ /** Whether the control is initially visible. Default: true. */
1917
+ visible?: boolean;
1918
+ /** Whether the panel starts collapsed. Default: true. */
1919
+ collapsed?: boolean;
1920
+ /** Layer ID to insert layers before. */
1921
+ beforeId?: string;
1922
+ /** Default data URL to pre-fill. */
1923
+ defaultUrl?: string;
1924
+ /** Default layer name. */
1925
+ defaultLayerName?: string;
1926
+ /** Whether to automatically load the defaultUrl. Default: false. */
1927
+ loadDefaultUrl?: boolean;
1928
+ /** Default format. Default: 'auto'. */
1929
+ defaultFormat?: RemoteVectorFormat;
1930
+ /** Default column for classification. */
1931
+ defaultColumn?: string;
1932
+ /** Default colormap. Default: 'viridis'. */
1933
+ defaultColormap?: ColormapName;
1934
+ /** Default classification scheme. Default: 'quantile'. */
1935
+ defaultScheme?: ChoroplethClassificationScheme;
1936
+ /** Default number of classes. Default: 5. */
1937
+ defaultK?: number;
1938
+ /** Default opacity (0-1). Default: 0.8. */
1939
+ defaultOpacity?: number;
1940
+ /** Default outline color. Default: '#ffffff'. */
1941
+ defaultOutlineColor?: string;
1942
+ /** Default extrusion mode. Default: false. */
1943
+ defaultExtrude?: boolean;
1944
+ /** Default scale factor for extrusion height. Default: 1.0. */
1945
+ defaultScaleFactor?: number;
1946
+ /** Whether features are pickable. Default: true. */
1947
+ defaultPickable?: boolean;
1948
+ /** Whether to fit map bounds to data. Default: true. */
1949
+ fitBounds?: boolean;
1950
+ /** Padding for fitBounds. Default: 50. */
1951
+ fitBoundsPadding?: number;
1952
+ /** Panel width in pixels. Default: 320. */
1953
+ panelWidth?: number;
1954
+ /** Maximum height of the panel. Default: 500. */
1955
+ maxHeight?: number;
1956
+ /** Background color. */
1957
+ backgroundColor?: string;
1958
+ /** Border radius. */
1959
+ borderRadius?: number;
1960
+ /** Opacity of the container (0-1). */
1961
+ opacity?: number;
1962
+ /** Font size in pixels. */
1963
+ fontSize?: number;
1964
+ /** Font color. */
1965
+ fontColor?: string;
1966
+ /** Minimum zoom level. */
1967
+ minzoom?: number;
1968
+ /** Maximum zoom level. */
1969
+ maxzoom?: number;
1970
+ }
1971
+ /**
1972
+ * Internal state of the ChoroplethControl.
1973
+ */
1974
+ export interface ChoroplethControlState {
1975
+ /** Whether the control is visible. */
1976
+ visible: boolean;
1977
+ /** Whether the panel is collapsed. */
1978
+ collapsed: boolean;
1979
+ /** Current data URL. */
1980
+ url: string;
1981
+ /** Current layer name. */
1982
+ layerName: string;
1983
+ /** Current beforeId. */
1984
+ beforeId: string;
1985
+ /** Current format. */
1986
+ format: RemoteVectorFormat;
1987
+ /** Selected column for classification. */
1988
+ column: string;
1989
+ /** Current colormap. */
1990
+ colormap: ColormapName;
1991
+ /** Current classification scheme. */
1992
+ scheme: ChoroplethClassificationScheme;
1993
+ /** Number of classes. */
1994
+ k: number;
1995
+ /** Current opacity. */
1996
+ opacity: number;
1997
+ /** Whether to show outline. */
1998
+ showOutline: boolean;
1999
+ /** Outline color. */
2000
+ outlineColor: string;
2001
+ /** Whether 3D extrusion is enabled. */
2002
+ extrude: boolean;
2003
+ /** Scale factor for extrusion. */
2004
+ scaleFactor: number;
2005
+ /** Whether features are pickable. */
2006
+ pickable: boolean;
2007
+ /** Whether any layer is active. */
2008
+ hasLayer: boolean;
2009
+ /** Number of active layers. */
2010
+ layerCount: number;
2011
+ /** Active layer info. */
2012
+ layers: ChoroplethLayerInfo[];
2013
+ /** Loading state. */
2014
+ loading: boolean;
2015
+ /** Error message. */
2016
+ error: string | null;
2017
+ /** Status message. */
2018
+ status: string | null;
2019
+ /** Available numeric columns from loaded data. */
2020
+ availableColumns: string[];
2021
+ }
2022
+ /**
2023
+ * Choropleth-specific event types.
2024
+ */
2025
+ export type ChoroplethEvent = ComponentEvent | "layeradd" | "layerremove" | "error";
2026
+ /**
2027
+ * Choropleth event handler function type.
2028
+ */
2029
+ export type ChoroplethEventHandler = (event: {
2030
+ type: ChoroplethEvent;
2031
+ state: ChoroplethControlState;
2032
+ url?: string;
2033
+ error?: string;
2034
+ layerId?: string;
2035
+ }) => void;
2036
+ /**
2037
+ * Information about a STAC asset.
2038
+ */
2039
+ export interface StacAssetInfo {
2040
+ /** Asset key in the STAC item. */
2041
+ key: string;
2042
+ /** URL to the asset. */
2043
+ href: string;
2044
+ /** Asset MIME type. */
2045
+ type: string;
2046
+ /** Asset title. */
2047
+ title?: string;
2048
+ /** Data type from raster:bands (e.g., 'uint8', 'uint16', 'float32'). */
2049
+ dataType?: string;
2050
+ /** Nodata value from raster:bands. */
2051
+ nodata?: number;
2052
+ /** Scale factor from raster:bands. */
2053
+ scale?: number;
2054
+ /** Offset from raster:bands. */
2055
+ offset?: number;
2056
+ /** Center wavelength in micrometers from eo:bands (for sorting). */
2057
+ centerWavelength?: number;
2058
+ /** Common band name from eo:bands (e.g., 'blue', 'green', 'red', 'nir'). */
2059
+ commonName?: string;
2060
+ }
2061
+ /**
2062
+ * Options for configuring the StacLayerControl.
2063
+ */
2064
+ export interface StacLayerControlOptions {
2065
+ /** Position on the map. Default: 'top-right'. */
2066
+ position?: ControlPosition;
2067
+ /** Custom CSS class name. */
2068
+ className?: string;
2069
+ /** Whether the control is initially visible. Default: true. */
2070
+ visible?: boolean;
2071
+ /** Whether the panel starts collapsed (button only). Default: true. */
2072
+ collapsed?: boolean;
2073
+ /** Layer ID to insert layers before. If not specified, layers are added on top. */
2074
+ beforeId?: string;
2075
+ /** Default STAC item URL to pre-fill. */
2076
+ defaultUrl?: string;
2077
+ /** Whether to automatically load the defaultUrl when control is added. Default: false. */
2078
+ loadDefaultUrl?: boolean;
2079
+ /** Default colormap name. Default: 'none'. */
2080
+ defaultColormap?: ColormapName | "none";
2081
+ /** Default rescale minimum. Default: 0. */
2082
+ defaultRescaleMin?: number;
2083
+ /** Default rescale maximum. Default: 255. */
2084
+ defaultRescaleMax?: number;
2085
+ /** Default opacity (0-1). Default: 1. */
2086
+ defaultOpacity?: number;
2087
+ /** Default layer name to pre-fill. If not specified, name is auto-generated. */
2088
+ defaultLayerName?: string;
2089
+ /** Whether layers are pickable (clickable to show info). Default: true. */
2090
+ defaultPickable?: boolean;
2091
+ /** Width of the panel in pixels. Default: 320. */
2092
+ panelWidth?: number;
2093
+ /** Maximum height of the panel in pixels before scrolling. Default: 500. */
2094
+ maxHeight?: number;
2095
+ /** Background color of the container. */
2096
+ backgroundColor?: string;
2097
+ /** Border radius for container. */
2098
+ borderRadius?: number;
2099
+ /** Opacity of the container (0-1). */
2100
+ opacity?: number;
2101
+ /** Font size in pixels. */
2102
+ fontSize?: number;
2103
+ /** Font color. */
2104
+ fontColor?: string;
2105
+ /** Minimum zoom level at which the control is visible. */
2106
+ minzoom?: number;
2107
+ /** Maximum zoom level at which the control is visible. */
2108
+ maxzoom?: number;
2109
+ }
2110
+ /**
2111
+ * Internal state of the StacLayerControl.
2112
+ */
2113
+ export interface StacLayerControlState {
2114
+ /** Whether the control is visible. */
2115
+ visible: boolean;
2116
+ /** Whether the panel is collapsed. */
2117
+ collapsed: boolean;
2118
+ /** Current layer name (optional, auto-generated if empty). */
2119
+ layerName: string;
2120
+ /** Current STAC item URL. */
2121
+ stacUrl: string;
2122
+ /** Loaded STAC item. */
2123
+ stacItem: any | null;
2124
+ /** Available COG assets from the STAC item. */
2125
+ assets: StacAssetInfo[];
2126
+ /** Currently selected asset key (single band mode). */
2127
+ selectedAsset: string | null;
2128
+ /** Whether RGB composite mode is enabled. */
2129
+ rgbMode: boolean;
2130
+ /** Selected assets for RGB composite [R, G, B]. */
2131
+ rgbAssets: [string | null, string | null, string | null];
2132
+ /** Current colormap. */
2133
+ colormap: ColormapName | "none";
2134
+ /** Current rescale min. */
2135
+ rescaleMin: number;
2136
+ /** Current rescale max. */
2137
+ rescaleMax: number;
2138
+ /** Current opacity (0-1). */
2139
+ layerOpacity: number;
2140
+ /** Whether layers are pickable. */
2141
+ pickable: boolean;
2142
+ /** Whether any layer is currently active. */
2143
+ hasLayer: boolean;
2144
+ /** Number of active layers. */
2145
+ layerCount: number;
2146
+ /** Whether the control is loading. */
2147
+ loading: boolean;
2148
+ /** Error message if any. */
2149
+ error: string | null;
2150
+ /** Status message. */
2151
+ status: string | null;
2152
+ }
2153
+ /**
2154
+ * STAC-specific event types.
2155
+ */
2156
+ export type StacLayerEvent = ComponentEvent | "stacload" | "layeradd" | "layerremove" | "error";
2157
+ /**
2158
+ * STAC event handler function type.
2159
+ */
2160
+ export type StacLayerEventHandler = (event: {
2161
+ type: StacLayerEvent;
2162
+ state: StacLayerControlState;
2163
+ url?: string;
2164
+ error?: string;
2165
+ layerId?: string;
2166
+ assetKey?: string;
2167
+ layerName?: string;
2168
+ }) => void;
2169
+ /**
2170
+ * A STAC catalog configuration.
2171
+ */
2172
+ export interface StacCatalog {
2173
+ /** Display name of the catalog. */
2174
+ name: string;
2175
+ /** STAC API endpoint URL. */
2176
+ url: string;
2177
+ }
2178
+ /**
2179
+ * A STAC collection from a catalog.
2180
+ */
2181
+ export interface StacCollection {
2182
+ /** Collection ID. */
2183
+ id: string;
2184
+ /** Collection title. */
2185
+ title?: string;
2186
+ /** Collection description. */
2187
+ description?: string;
2188
+ }
2189
+ /**
2190
+ * A STAC item from a search result.
2191
+ */
2192
+ export interface StacSearchItem {
2193
+ /** Item ID. */
2194
+ id: string;
2195
+ /** Item datetime. */
2196
+ datetime?: string;
2197
+ /** Item geometry (GeoJSON). */
2198
+ geometry?: any;
2199
+ /** Item bounding box. */
2200
+ bbox?: [number, number, number, number];
2201
+ /** Full STAC item URL. */
2202
+ selfLink?: string;
2203
+ /** Full item properties. */
2204
+ properties?: Record<string, any>;
2205
+ /** Item assets (bands, data files). */
2206
+ assets?: Record<string, any>;
2207
+ }
2208
+ /**
2209
+ * Options for configuring the StacSearchControl.
2210
+ */
2211
+ export interface StacSearchControlOptions {
2212
+ /** Position on the map. Default: 'top-right'. */
2213
+ position?: ControlPosition;
2214
+ /** Custom CSS class name. */
2215
+ className?: string;
2216
+ /** Whether the control is initially visible. Default: true. */
2217
+ visible?: boolean;
2218
+ /** Whether the panel starts collapsed (button only). Default: true. */
2219
+ collapsed?: boolean;
2220
+ /** Width of the panel in pixels. Default: 360. */
2221
+ panelWidth?: number;
2222
+ /** Maximum height of the panel in pixels. Default: undefined (no limit). */
2223
+ maxHeight?: number;
2224
+ /** Background color of the container. */
2225
+ backgroundColor?: string;
2226
+ /** Border radius for container. */
2227
+ borderRadius?: number;
2228
+ /** Opacity of the container (0-1). */
2229
+ opacity?: number;
2230
+ /** Font size in pixels. */
2231
+ fontSize?: number;
2232
+ /** Font color. */
2233
+ fontColor?: string;
2234
+ /** Predefined STAC catalogs. */
2235
+ catalogs?: StacCatalog[];
2236
+ /** Maximum number of items to return from search. Default: 20. */
2237
+ maxItems?: number;
2238
+ /** Default rescale minimum for visualization. Default: 0. */
2239
+ defaultRescaleMin?: number;
2240
+ /** Default rescale maximum for visualization. Default: 10000. */
2241
+ defaultRescaleMax?: number;
2242
+ /** Default colormap for single band visualization. Default: 'viridis'. */
2243
+ defaultColormap?: string;
2244
+ /** Whether to start in RGB mode. Default: true. */
2245
+ defaultRgbMode?: boolean;
2246
+ /** Whether to add search result footprints to the map. Default: true. */
2247
+ showFootprints?: boolean;
2248
+ /** Minimum zoom level at which the control is visible. */
2249
+ minzoom?: number;
2250
+ /** Maximum zoom level at which the control is visible. */
2251
+ maxzoom?: number;
2252
+ }
2253
+ /**
2254
+ * Internal state of the StacSearchControl.
2255
+ */
2256
+ export interface StacSearchControlState {
2257
+ /** Whether the control is visible. */
2258
+ visible: boolean;
2259
+ /** Whether the panel is collapsed. */
2260
+ collapsed: boolean;
2261
+ /** Available catalogs. */
2262
+ catalogs: StacCatalog[];
2263
+ /** Currently selected catalog. */
2264
+ selectedCatalog: StacCatalog | null;
2265
+ /** Available collections from the selected catalog. */
2266
+ collections: StacCollection[];
2267
+ /** Currently selected collection. */
2268
+ selectedCollection: StacCollection | null;
2269
+ /** Search start date (ISO string). */
2270
+ startDate: string | null;
2271
+ /** Search end date (ISO string). */
2272
+ endDate: string | null;
2273
+ /** Maximum items to return. */
2274
+ maxItems: number;
2275
+ /** Query filter JSON string (e.g., {"eo:cloud_cover": {"lt": 10}}). */
2276
+ queryFilter: string;
2277
+ /** Search results (items). */
2278
+ items: StacSearchItem[];
2279
+ /** Currently selected item. */
2280
+ selectedItem: StacSearchItem | null;
2281
+ /** Rescale min value. */
2282
+ rescaleMin: number;
2283
+ /** Rescale max value. */
2284
+ rescaleMax: number;
2285
+ /** Whether in RGB mode (true) or single band mode (false). */
2286
+ isRgbMode: boolean;
2287
+ /** Selected colormap for single band mode. */
2288
+ colormap: string;
2289
+ /** Available assets/bands from the selected item. */
2290
+ availableAssets: string[];
2291
+ /** Selected band for single band mode. */
2292
+ selectedBand: string | null;
2293
+ /** Selected RGB bands. */
2294
+ rgbBands: {
2295
+ r: string | null;
2296
+ g: string | null;
2297
+ b: string | null;
2298
+ };
2299
+ /** Whether any layer is currently active. */
2300
+ hasLayer: boolean;
2301
+ /** Whether the control is loading. */
2302
+ loading: boolean;
2303
+ /** Error message if any. */
2304
+ error: string | null;
2305
+ /** Status message. */
2306
+ status: string | null;
2307
+ }
2308
+ /**
2309
+ * STAC Search event types.
2310
+ */
2311
+ export type StacSearchEvent = ComponentEvent | "catalogselect" | "collectionsload" | "collectionselect" | "search" | "itemselect" | "display" | "error";
2312
+ /**
2313
+ * STAC Search event handler function type.
2314
+ */
2315
+ export type StacSearchEventHandler = (event: {
2316
+ type: StacSearchEvent;
2317
+ state: StacSearchControlState;
2318
+ catalog?: StacCatalog;
2319
+ collection?: StacCollection;
2320
+ item?: StacSearchItem;
2321
+ error?: string;
2322
+ }) => void;
2323
+ /**
2324
+ * Measurement unit for distance.
2325
+ */
2326
+ export type DistanceUnit = "meters" | "kilometers" | "miles" | "feet" | "yards" | "nautical-miles";
2327
+ /**
2328
+ * Measurement unit for area.
2329
+ */
2330
+ export type AreaUnit = "square-meters" | "square-kilometers" | "square-miles" | "hectares" | "acres" | "square-feet";
2331
+ /**
2332
+ * Measurement mode.
2333
+ */
2334
+ export type MeasureMode = "distance" | "area";
2335
+ /**
2336
+ * Options for configuring the MeasureControl.
2337
+ */
2338
+ export interface MeasureControlOptions {
2339
+ /** Position on the map. Default: 'top-right'. */
2340
+ position?: ControlPosition;
2341
+ /** Custom CSS class name. */
2342
+ className?: string;
2343
+ /** Whether the control is initially visible. Default: true. */
2344
+ visible?: boolean;
2345
+ /** Whether to start collapsed. Default: true. */
2346
+ collapsed?: boolean;
2347
+ /** Default measurement mode. Default: 'distance'. */
2348
+ defaultMode?: MeasureMode;
2349
+ /** Default distance unit. Default: 'kilometers'. */
2350
+ distanceUnit?: DistanceUnit;
2351
+ /** Default area unit. Default: 'square-kilometers'. */
2352
+ areaUnit?: AreaUnit;
2353
+ /** Line color for distance measurements. Default: '#3b82f6'. */
2354
+ lineColor?: string;
2355
+ /** Line width for distance measurements. Default: 3. */
2356
+ lineWidth?: number;
2357
+ /** Fill color for area measurements. Default: 'rgba(59, 130, 246, 0.2)'. */
2358
+ fillColor?: string;
2359
+ /** Point color for vertices. Default: '#ef4444'. */
2360
+ pointColor?: string;
2361
+ /** Point radius for vertices. Default: 6. */
2362
+ pointRadius?: number;
2363
+ /** Whether to show segment distances. Default: true. */
2364
+ showSegments?: boolean;
2365
+ /** Whether to show total distance/area label. Default: true. */
2366
+ showTotal?: boolean;
2367
+ /** Number of decimal places for measurements. Default: 2. */
2368
+ precision?: number;
2369
+ /** Panel width in pixels. Default: 240. */
2370
+ panelWidth?: number;
2371
+ /** Maximum height of the panel in pixels before scrolling. Default: 500. */
2372
+ maxHeight?: number;
2373
+ /** Background color of the panel. Default: 'rgba(255, 255, 255, 0.95)'. */
2374
+ backgroundColor?: string;
2375
+ /** Border radius in pixels. Default: 4. */
2376
+ borderRadius?: number;
2377
+ /** Opacity of the control (0-1). Default: 1. */
2378
+ opacity?: number;
2379
+ /** Font size in pixels. Default: 12. */
2380
+ fontSize?: number;
2381
+ /** Font color. Default: '#333'. */
2382
+ fontColor?: string;
2383
+ /** Minimum zoom level at which the control is visible. */
2384
+ minzoom?: number;
2385
+ /** Maximum zoom level at which the control is visible. */
2386
+ maxzoom?: number;
2387
+ }
2388
+ /**
2389
+ * A single measurement point.
2390
+ */
2391
+ export interface MeasurePoint {
2392
+ /** Longitude. */
2393
+ lng: number;
2394
+ /** Latitude. */
2395
+ lat: number;
2396
+ }
2397
+ /**
2398
+ * A completed measurement.
2399
+ */
2400
+ export interface Measurement {
2401
+ /** Unique identifier. */
2402
+ id: string;
2403
+ /** Measurement mode. */
2404
+ mode: MeasureMode;
2405
+ /** Points that define the measurement. */
2406
+ points: MeasurePoint[];
2407
+ /** Total distance in meters (for distance mode). */
2408
+ distance?: number;
2409
+ /** Total area in square meters (for area mode). */
2410
+ area?: number;
2411
+ /** Segment distances in meters. */
2412
+ segments?: number[];
2413
+ }
2414
+ /**
2415
+ * Internal state of the MeasureControl.
2416
+ */
2417
+ export interface MeasureControlState {
2418
+ /** Whether the control is visible. */
2419
+ visible: boolean;
2420
+ /** Whether the panel is collapsed. */
2421
+ collapsed: boolean;
2422
+ /** Current measurement mode. */
2423
+ mode: MeasureMode;
2424
+ /** Current distance unit. */
2425
+ distanceUnit: DistanceUnit;
2426
+ /** Current area unit. */
2427
+ areaUnit: AreaUnit;
2428
+ /** Whether currently drawing a measurement. */
2429
+ isDrawing: boolean;
2430
+ /** Current drawing points. */
2431
+ currentPoints: MeasurePoint[];
2432
+ /** Current measurement value (distance or area). */
2433
+ currentValue: number;
2434
+ /** Segment distances for current drawing. */
2435
+ currentSegments: number[];
2436
+ /** Completed measurements. */
2437
+ measurements: Measurement[];
2438
+ }
2439
+ /**
2440
+ * MeasureControl event types.
2441
+ */
2442
+ export type MeasureEvent = ComponentEvent | "modechange" | "unitchange" | "drawstart" | "drawupdate" | "drawend" | "clear" | "measurementadd" | "measurementremove";
2443
+ /**
2444
+ * MeasureControl event handler function type.
2445
+ */
2446
+ export type MeasureEventHandler = (event: {
2447
+ type: MeasureEvent;
2448
+ state: MeasureControlState;
2449
+ measurement?: Measurement;
2450
+ }) => void;
2451
+ /**
2452
+ * Split orientation.
2453
+ */
2454
+ export type SplitOrientation = "vertical" | "horizontal";
2455
+ /**
2456
+ * Options for configuring the SplitMapControl.
2457
+ */
2458
+ export interface SplitMapControlOptions {
2459
+ /** Position on the map. Default: 'top-right'. */
2460
+ position?: ControlPosition;
2461
+ /** Custom CSS class name. */
2462
+ className?: string;
2463
+ /** Whether the control is initially visible. Default: true. */
2464
+ visible?: boolean;
2465
+ /** Split orientation. Default: 'vertical'. */
2466
+ orientation?: SplitOrientation;
2467
+ /** Initial split position (0-1). Default: 0.5. */
2468
+ initialPosition?: number;
2469
+ /** Left/top layer ID. */
2470
+ leftLayer?: string;
2471
+ /** Right/bottom layer ID. */
2472
+ rightLayer?: string;
2473
+ /** Swiper line color. Default: '#ffffff'. */
2474
+ swiperColor?: string;
2475
+ /** Swiper line width. Default: 4. */
2476
+ swiperWidth?: number;
2477
+ /** Swiper handle size. Default: 40. */
2478
+ handleSize?: number;
2479
+ /** Whether to show layer labels. Default: true. */
2480
+ showLabels?: boolean;
2481
+ /** Label for left/top layer. Default: 'Before'. */
2482
+ leftLabel?: string;
2483
+ /** Label for right/bottom layer. Default: 'After'. */
2484
+ rightLabel?: string;
2485
+ /** Minimum zoom level at which the control is visible. */
2486
+ minzoom?: number;
2487
+ /** Maximum zoom level at which the control is visible. */
2488
+ maxzoom?: number;
2489
+ }
2490
+ /**
2491
+ * Internal state of the SplitMapControl.
2492
+ */
2493
+ export interface SplitMapControlState {
2494
+ /** Whether the control is visible. */
2495
+ visible: boolean;
2496
+ /** Whether the split mode is active. */
2497
+ active: boolean;
2498
+ /** Current split position (0-1). */
2499
+ position: number;
2500
+ /** Split orientation. */
2501
+ orientation: SplitOrientation;
2502
+ /** Left layer ID. */
2503
+ leftLayer: string | null;
2504
+ /** Right layer ID. */
2505
+ rightLayer: string | null;
2506
+ }
2507
+ /**
2508
+ * SplitMapControl event types.
2509
+ */
2510
+ export type SplitMapEvent = ComponentEvent | "activate" | "deactivate" | "positionchange" | "layerchange";
2511
+ /**
2512
+ * SplitMapControl event handler function type.
2513
+ */
2514
+ export type SplitMapEventHandler = (event: {
2515
+ type: SplitMapEvent;
2516
+ state: SplitMapControlState;
2517
+ }) => void;
2518
+ /**
2519
+ * A saved map bookmark/view.
2520
+ */
2521
+ export interface MapBookmark {
2522
+ /** Unique identifier. */
2523
+ id: string;
2524
+ /** Bookmark name. */
2525
+ name: string;
2526
+ /** Center longitude. */
2527
+ lng: number;
2528
+ /** Center latitude. */
2529
+ lat: number;
2530
+ /** Zoom level. */
2531
+ zoom: number;
2532
+ /** Pitch (tilt). */
2533
+ pitch: number;
2534
+ /** Bearing (rotation). */
2535
+ bearing: number;
2536
+ /** Timestamp when created. */
2537
+ createdAt: number;
2538
+ /** Optional thumbnail data URL. */
2539
+ thumbnail?: string;
2540
+ }
2541
+ /**
2542
+ * Options for configuring the BookmarkControl.
2543
+ */
2544
+ export interface BookmarkControlOptions {
2545
+ /** Position on the map. Default: 'top-right'. */
2546
+ position?: ControlPosition;
2547
+ /** Custom CSS class name. */
2548
+ className?: string;
2549
+ /** Whether the control is initially visible. Default: true. */
2550
+ visible?: boolean;
2551
+ /** Whether to start collapsed. Default: true. */
2552
+ collapsed?: boolean;
2553
+ /** Initial bookmarks. Default: []. */
2554
+ bookmarks?: MapBookmark[];
2555
+ /** localStorage key for persistence. Default: null (no persistence). */
2556
+ storageKey?: string;
2557
+ /** Maximum number of bookmarks. Default: 20. */
2558
+ maxBookmarks?: number;
2559
+ /** Whether to generate thumbnails. Default: false. */
2560
+ generateThumbnails?: boolean;
2561
+ /** Fly-to animation duration in ms. Default: 1500. */
2562
+ flyToDuration?: number;
2563
+ /** Panel width in pixels. Default: 260. */
2564
+ panelWidth?: number;
2565
+ /** Maximum height of the panel in pixels before scrolling. Default: 500. */
2566
+ maxHeight?: number;
2567
+ /** Background color. Default: 'rgba(255, 255, 255, 0.95)'. */
2568
+ backgroundColor?: string;
2569
+ /** Border radius in pixels. Default: 4. */
2570
+ borderRadius?: number;
2571
+ /** Font size in pixels. Default: 12. */
2572
+ fontSize?: number;
2573
+ /** Font color. Default: '#333'. */
2574
+ fontColor?: string;
2575
+ /** Minimum zoom level at which the control is visible. */
2576
+ minzoom?: number;
2577
+ /** Maximum zoom level at which the control is visible. */
2578
+ maxzoom?: number;
2579
+ }
2580
+ /**
2581
+ * Internal state of the BookmarkControl.
2582
+ */
2583
+ export interface BookmarkControlState {
2584
+ /** Whether the control is visible. */
2585
+ visible: boolean;
2586
+ /** Whether the panel is collapsed. */
2587
+ collapsed: boolean;
2588
+ /** Saved bookmarks. */
2589
+ bookmarks: MapBookmark[];
2590
+ /** Currently selected bookmark ID. */
2591
+ selectedId: string | null;
2592
+ }
2593
+ /**
2594
+ * BookmarkControl event types.
2595
+ */
2596
+ export type BookmarkEvent = ComponentEvent | "add" | "remove" | "select" | "rename" | "clear" | "import";
2597
+ /**
2598
+ * BookmarkControl event handler function type.
2599
+ */
2600
+ export type BookmarkEventHandler = (event: {
2601
+ type: BookmarkEvent;
2602
+ state: BookmarkControlState;
2603
+ bookmark?: MapBookmark;
2604
+ }) => void;
2605
+ /**
2606
+ * Colorbar configuration for print export.
2607
+ */
2608
+ export interface PrintColorbarConfig {
2609
+ /** Whether to include the colorbar. Default: false. */
2610
+ enabled?: boolean;
2611
+ /** Colormap name or array of colors. */
2612
+ colormap?: ColormapName | string[];
2613
+ /** Minimum value for the colorbar. */
2614
+ vmin?: number;
2615
+ /** Maximum value for the colorbar. */
2616
+ vmax?: number;
2617
+ /** Label/title for the colorbar. */
2618
+ label?: string;
2619
+ /** Units to display after values. */
2620
+ units?: string;
2621
+ /** Orientation of the colorbar. Default: 'vertical'. */
2622
+ orientation?: "horizontal" | "vertical";
2623
+ /** Position of the colorbar on the exported image. Default: 'bottom-right'. */
2624
+ position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
2625
+ /** Width of the gradient bar in pixels. Default: 20. */
2626
+ barThickness?: number;
2627
+ /** Length of the gradient bar in pixels. Default: 150. */
2628
+ barLength?: number;
2629
+ /** Number of tick marks. Default: 5. */
2630
+ tickCount?: number;
2631
+ }
2632
+ /**
2633
+ * Options for configuring the PrintControl.
2634
+ */
2635
+ export interface PrintControlOptions {
2636
+ /** Position on the map. Default: 'top-right'. */
2637
+ position?: ControlPosition;
2638
+ /** Custom CSS class name. */
2639
+ className?: string;
2640
+ /** Whether the control is initially visible. Default: true. */
2641
+ visible?: boolean;
2642
+ /** Whether to start collapsed. Default: true. */
2643
+ collapsed?: boolean;
2644
+ /** Default image format. Default: 'png'. */
2645
+ format?: "png" | "jpeg" | "pdf";
2646
+ /** JPEG quality (0-1). Default: 0.92. */
2647
+ quality?: number;
2648
+ /** Default filename (without extension). Default: 'map-export'. */
2649
+ filename?: string;
2650
+ /** Optional title text rendered on the exported image. */
2651
+ title?: string;
2652
+ /** Whether to include a north arrow in exports. Default: false. */
2653
+ includeNorthArrow?: boolean;
2654
+ /** Whether to include a scale bar in exports. Default: false. */
2655
+ includeScaleBar?: boolean;
2656
+ /** Colorbar configuration for exports. */
2657
+ colorbar?: PrintColorbarConfig;
2658
+ /** Title font size in pixels. Default: 24. */
2659
+ titleFontSize?: number;
2660
+ /** Title font color. Default: '#333333'. */
2661
+ titleFontColor?: string;
2662
+ /** Title background. Default: 'rgba(255,255,255,0.8)'. */
2663
+ titleBackground?: string;
2664
+ /** Whether to show size options (Current/Custom). Default: false. */
2665
+ showSizeOptions?: boolean;
2666
+ /** Width override for export (pixels). If not set, uses current canvas size. */
2667
+ width?: number;
2668
+ /** Height override for export (pixels). If not set, uses current canvas size. */
2669
+ height?: number;
2670
+ /** Panel width in pixels. Default: 280. */
2671
+ panelWidth?: number;
2672
+ /** Maximum height of the panel in pixels before scrolling. Default: 500. */
2673
+ maxHeight?: number;
2674
+ /** Background color of the panel. Default: 'rgba(255, 255, 255, 0.95)'. */
2675
+ backgroundColor?: string;
2676
+ /** Border radius in pixels. Default: 4. */
2677
+ borderRadius?: number;
2678
+ /** Opacity of the control (0-1). Default: 1. */
2679
+ opacity?: number;
2680
+ /** Font size in pixels. Default: 12. */
2681
+ fontSize?: number;
2682
+ /** Font color. Default: '#333'. */
2683
+ fontColor?: string;
2684
+ /** Minimum zoom level at which the control is visible. */
2685
+ minzoom?: number;
2686
+ /** Maximum zoom level at which the control is visible. */
2687
+ maxzoom?: number;
2688
+ }
2689
+ /**
2690
+ * Internal state of the PrintControl.
2691
+ */
2692
+ export interface PrintControlState {
2693
+ /** Whether the control is visible. */
2694
+ visible: boolean;
2695
+ /** Whether the panel is collapsed. */
2696
+ collapsed: boolean;
2697
+ /** Current image format. */
2698
+ format: "png" | "jpeg" | "pdf";
2699
+ /** JPEG quality (0-1). */
2700
+ quality: number;
2701
+ /** Current filename (without extension). */
2702
+ filename: string;
2703
+ /** Title text for export. */
2704
+ title: string;
2705
+ /** Whether to include a north arrow in exports. */
2706
+ includeNorthArrow: boolean;
2707
+ /** Whether to include a scale bar in exports. */
2708
+ includeScaleBar: boolean;
2709
+ /** Colorbar configuration for exports. */
2710
+ colorbar: PrintColorbarConfig;
2711
+ /** Whether an export is in progress. */
2712
+ exporting: boolean;
2713
+ /** Custom width (null = use current canvas size). */
2714
+ width: number | null;
2715
+ /** Custom height (null = use current canvas size). */
2716
+ height: number | null;
2717
+ }
2718
+ /**
2719
+ * PrintControl event types.
2720
+ */
2721
+ export type PrintEvent = ComponentEvent | "export" | "copy" | "error";
2722
+ /**
2723
+ * PrintControl event handler function type.
2724
+ */
2725
+ export type PrintEventHandler = (event: {
2726
+ type: PrintEvent;
2727
+ state: PrintControlState;
2728
+ dataUrl?: string;
2729
+ error?: string;
2730
+ }) => void;
2731
+ /**
2732
+ * Options for configuring the MinimapControl.
2733
+ */
2734
+ export interface MinimapControlOptions {
2735
+ /** Position on the map. Default: 'bottom-left'. */
2736
+ position?: ControlPosition;
2737
+ /** Custom CSS class name. */
2738
+ className?: string;
2739
+ /** Whether the control is initially visible. Default: true. */
2740
+ visible?: boolean;
2741
+ /** Whether to start collapsed (minimap hidden). Default: false. */
2742
+ collapsed?: boolean;
2743
+ /** Width of the minimap in pixels. Default: 250. */
2744
+ width?: number;
2745
+ /** Height of the minimap in pixels. Default: 180. */
2746
+ height?: number;
2747
+ /** Zoom offset relative to the main map. Default: -5. */
2748
+ zoomOffset?: number;
2749
+ /** Style for the minimap. Can be a StyleSpecification object or a URL string. */
2750
+ style?: string | object;
2751
+ /** Color of the viewport rectangle outline. Default: '#0078d7'. */
2752
+ viewportRectColor?: string;
2753
+ /** Opacity of the viewport rectangle fill. Default: 0.2. */
2754
+ viewportRectOpacity?: number;
2755
+ /** Whether the minimap can be toggled. Default: true. */
2756
+ toggleable?: boolean;
2757
+ /** Whether the minimap is interactive (click to navigate). Default: false. */
2758
+ interactive?: boolean;
2759
+ /** Minimum zoom level at which the control is visible. */
2760
+ minzoom?: number;
2761
+ /** Maximum zoom level at which the control is visible. */
2762
+ maxzoom?: number;
2763
+ }
2764
+ /**
2765
+ * Internal state of the MinimapControl.
2766
+ */
2767
+ export interface MinimapControlState {
2768
+ /** Whether the control is visible. */
2769
+ visible: boolean;
2770
+ /** Whether the minimap panel is collapsed. */
2771
+ collapsed: boolean;
2772
+ }
2773
+ /**
2774
+ * Props for the React MinimapControl wrapper component.
2775
+ */
2776
+ export interface MinimapControlReactProps extends MinimapControlOptions {
2777
+ /** MapLibre GL map instance. */
2778
+ map: Map;
2779
+ /** Callback fired when state changes. */
2780
+ onStateChange?: (state: MinimapControlState) => void;
2781
+ }
2782
+ /**
2783
+ * MinimapControl event types.
2784
+ */
2785
+ export type MinimapEvent = ComponentEvent;
2786
+ /**
2787
+ * MinimapControl event handler function type.
2788
+ */
2789
+ export type MinimapEventHandler = (event: {
2790
+ type: MinimapEvent;
2791
+ state: MinimapControlState;
2792
+ }) => void;
2793
+ //# sourceMappingURL=types.d.ts.map