@classic-homes/maps-core 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,1487 +1,13 @@
1
- import { MapTheme } from './theme/index.js';
2
- export { MapDataColors, MapStyleSpec, MapThemeColors, THEME_DARK, THEME_LIGHT, darkBasicStyle, darkTheme, generateBasicStyle, generateDarkColors, generateDarkDataColors, generateDarkTheme, generateLightColors, generateLightDataColors, generateLightTheme, generateVectorStyle, getBasicStyle, getTheme, getTypography, lightBasicStyle, lightTheme } from './theme/index.js';
3
- import { L as LngLat, G as GeoJSONFeatureCollection, b as MarkerData, M as MapBounds, B as BoundsArray, a as GeoJSONFeature, c as GeoJSONPolygon } from './data-CICLgvT6.js';
4
- export { C as ClusterConfig, E as ExtrusionData, e as GeoJSONGeometry, h as GeoJSONLineString, i as GeoJSONMultiLineString, g as GeoJSONMultiPoint, j as GeoJSONMultiPolygon, f as GeoJSONPoint, H as HeatmapPoint, k as MapSourceData, d as MapViewport } from './data-CICLgvT6.js';
1
+ export { m as MapDataColors, M as MapTheme, k as MapThemeColors, a as THEME_DARK, T as THEME_LIGHT, j as darkTheme, d as generateDarkColors, f as generateDarkDataColors, b as generateDarkTheme, c as generateLightColors, e as generateLightDataColors, g as generateLightTheme, i as getTheme, h as getTypography, l as lightTheme } from './generator-CGfqiHvG.js';
2
+ export { MapStyleSpec, darkBasicStyle, generateBasicStyle, generateVectorStyle, getBasicStyle, lightBasicStyle } from './theme/index.js';
3
+ import { G as GeoJSONFeatureCollection } from './data-k7o-Rne0.js';
4
+ export { B as BoundsArray, C as ClusterConfig, E as ExtrusionData, a as GeoJSONFeature, c as GeoJSONGeometry, f as GeoJSONLineString, g as GeoJSONMultiLineString, e as GeoJSONMultiPoint, i as GeoJSONMultiPolygon, d as GeoJSONPoint, h as GeoJSONPolygon, H as HeatmapPoint, L as LngLat, M as MapBounds, k as MapSourceData, b as MapViewport, j as MarkerData } from './data-k7o-Rne0.js';
5
5
  import { BasemapDefinition, BasemapApiKeys, MapStyleSpec } from './types/index.js';
6
6
  export { BaseControlProps, BaseLayerProps, BaseMapEventParams, BaseMapProps, BasemapCategory, BasemapProvider, BasemapSwitcherProps, CircleLayerProps, ControlPosition, CoordinateDisplayProps, FeatureClickEventParams, FeatureHoverEventParams, FillExtrusionLayerProps, FillLayerProps, GeolocateControlProps, GradientStop, HeatmapLayerProps, LegendConfig, LegendGroupProps, LegendItem, LegendProps, LineLayerProps, MapClickEventParams, MapErrorEventParams, MapHoverEventParams, MapLayerSpecBase, MapLoadEventParams, MapMoveEventParams, MapProps, MapSourceSpec, MarkerClickEventParams, MarkerDragEventParams, MarkerProps, NavigationControlProps, PopupEventParams, PopupProps, RasterLayerProps, ScaleControlProps, SourceProps, SymbolLayerProps } from './types/index.js';
7
- export { o as BuildRTreeIndexOptions, B as BuildSpatialIndexOptions, I as IdleViewportManagerOptions, r as IdleViewportResult, P as PanVelocity, p as PredictiveViewportResult, k as QuerySpatialIndexOptions, Q as QueryStats, n as RTreeIndex, m as RTreeItem, R as RTreeQueryStats, S as SpatialIndex, V as ViewportManagedDataOptions, l as ViewportManagedResult, e as buildRTreeIndex, b as buildSpatialIndex, j as createIdleViewportManager, i as createPredictiveViewportManager, h as createRTreeViewportManager, d as createViewportManager, c as createViewportQuery, q as queryByBounds, a as queryByBoundsWithStats, f as queryRTreeByBounds, g as queryRTreeByBoundsWithStats } from './spatial-D4ZJ4Ul7.js';
7
+ export { ar as ClusterCircleStyleOptions, al as ClusterExpandOptions, am as ClusterExpansionResult, ak as ClusterFeatureProperties, au as ClusterLayerStyles, as as ClusterTextStyleOptions, C as ColorExpression, Z as CoordinateValidationResult, aJ as DEFAULT_SIMPLIFICATION_THRESHOLDS, aR as DynamicLODOptions, aS as DynamicLODState, E as ExtrusionHeightOptions, aL as FeatureGroup, b2 as FilterExpression, b3 as FilterOperator, b4 as FilterValue, aM as GenerateLODOptions, aW as GeoJSONFingerprint, aK as GroupFeaturesOptions, K as KEYBOARD_CONTROLS, aN as LODData, aQ as LODDataWithSimplification, a7 as LoadGeoJSONOptions, a8 as LoadGeoJSONResult, L as LotFillStyleOptions, z as LotOutlineStyleOptions, b8 as MARKER_PROTECTION_CLASS, N as NumberExpression, b0 as PaintProps, b1 as PaintPropsDiff, aP as SimplificationStats, aO as SimplificationThreshold, at as UnclusteredPointStyleOptions, a9 as ValidationResult, b6 as applyMarkerChildProtection, b5 as applyMarkerProtection, ay as boundsToPolygon, _ as calculateBounds, a4 as calculateCentroid, aA as calculateZoomThresholds, X as clampLatitude, a0 as combineBounds, a5 as countFeaturesByType, p as createCategoricalColorExpression, j as createCircleStyle, ai as createClusterCirclePaint, ah as createClusterStyles, aj as createClusterTextLayout, q as createContinuousColorExpression, aH as createDynamicLODManager, w as createExtrusionHeightExpression, k as createExtrusionStyle, h as createFillStyle, aT as createGeoJSONFingerprint, l as createHeatmapStyle, m as createHoverExpression, o as createInteractiveExpression, y as createInteractiveStatusColorExpression, i as createLineStyle, u as createLotFillStyle, v as createLotOutlineStyle, n as createSelectionExpression, x as createStatusColorExpression, r as createZoomExpression, B as decimalToDMS, aX as deepEqual, V as ensureValidCoordinates, ae as expandCluster, ag as expandClusterToBounds, $ as extendBounds, a6 as filterByGeometryType, a_ as filterEqual, aU as fingerprintEqual, F as formatArea, I as formatBearing, G as formatBounds, A as formatCoordinates, D as formatDistance, Q as formatFeatureProperties, R as formatLabel, J as formatPitch, P as formatPropertyValue, M as formatScale, H as formatZoom, ax as generateBoundingPolygon, aw as generateConvexHull, b as generateFeatureCollectionDescription, d as generateFeatureTable, g as generateKeyboardControlsDescription, az as generateLODData, aF as generateLODDataWithSimplification, a as generateMapDescription, e as generateMarkerList, c as generateMarkersDescription, f as generateMoveAnnouncement, aV as geoJSONEqual, aZ as getChangedPaintProps, af as getClusterBounds, ac as getClusterChildren, ab as getClusterExpansionZoom, ad as getClusterLeaves, s as getHighlightStyle, t as getSelectionStyle, aI as getSimplificationToleranceForZoom, aG as getSimplifiedFeaturesForZoom, av as groupFeaturesByProperty, aa as isClusterFeature, a1 as isValidBounds, T as isValidLatitude, S as isValidLongitude, a2 as loadGeoJSON, W as normalizeLongitude, aY as paintPropsEqual, b7 as removeMarkerProtection, a$ as serializeFilter, aC as simplifyFeature, aD as simplifyFeatureCollection, aE as simplifyFeatureCollectionWithStats, aB as simplifyPolygon, Y as validateBoundsArray, U as validateCoordinates, a3 as validateGeoJSON, O as zoomToScale } from './marker-BjzgxVwm.js';
8
+ export { n as BuildRTreeIndexOptions, B as BuildSpatialIndexOptions, I as IdleViewportManagerOptions, r as IdleViewportResult, P as PanVelocity, p as PredictiveViewportResult, Q as QuerySpatialIndexOptions, k as QueryStats, m as RTreeIndex, R as RTreeItem, o as RTreeQueryStats, S as SpatialIndex, V as ViewportManagedDataOptions, l as ViewportManagedResult, e as buildRTreeIndex, b as buildSpatialIndex, j as createIdleViewportManager, i as createPredictiveViewportManager, h as createRTreeViewportManager, d as createViewportManager, c as createViewportQuery, q as queryByBounds, a as queryByBoundsWithStats, f as queryRTreeByBounds, g as queryRTreeByBoundsWithStats } from './spatial-Bo8nM3fC.js';
8
9
  import 'rbush';
9
10
 
10
- /**
11
- * Accessibility utilities for maps
12
- *
13
- * Provides screen reader support and keyboard navigation guidance
14
- */
15
-
16
- /**
17
- * Keyboard controls documentation for screen readers
18
- */
19
- declare const KEYBOARD_CONTROLS: {
20
- readonly pan: {
21
- readonly up: "Arrow Up";
22
- readonly down: "Arrow Down";
23
- readonly left: "Arrow Left";
24
- readonly right: "Arrow Right";
25
- };
26
- readonly zoom: {
27
- readonly in: "Plus (+) or Equals (=)";
28
- readonly out: "Minus (-)";
29
- };
30
- readonly rotate: {
31
- readonly left: "Shift + Arrow Left";
32
- readonly right: "Shift + Arrow Right";
33
- };
34
- readonly pitch: {
35
- readonly increase: "Shift + Arrow Up";
36
- readonly decrease: "Shift + Arrow Down";
37
- };
38
- readonly reset: {
39
- readonly bearing: "N key (reset north)";
40
- readonly view: "R key (reset view)";
41
- };
42
- };
43
- /**
44
- * Generate a text description of keyboard controls
45
- */
46
- declare function generateKeyboardControlsDescription(): string;
47
- /**
48
- * Generate an accessible description for a map
49
- */
50
- declare function generateMapDescription(title: string, options?: {
51
- center?: LngLat;
52
- zoom?: number;
53
- featureCount?: number;
54
- markerCount?: number;
55
- layerTypes?: string[];
56
- }): string;
57
- /**
58
- * Generate description for GeoJSON features
59
- */
60
- declare function generateFeatureCollectionDescription(title: string, data: GeoJSONFeatureCollection): string;
61
- /**
62
- * Generate description for markers
63
- */
64
- declare function generateMarkersDescription(title: string, markers: MarkerData[]): string;
65
- /**
66
- * Generate a hidden data table for screen readers
67
- */
68
- declare function generateFeatureTable(features: GeoJSONFeatureCollection, propertyKeys: string[]): string;
69
- /**
70
- * Generate a hidden marker list for screen readers
71
- */
72
- declare function generateMarkerList(markers: MarkerData[]): string;
73
- /**
74
- * Generate live region announcement for map changes
75
- */
76
- declare function generateMoveAnnouncement(center: LngLat, zoom: number, action: 'pan' | 'zoom' | 'move'): string;
77
-
78
- /**
79
- * Style utilities for map layers
80
- *
81
- * Helper functions for creating MapLibre paint and layout expressions
82
- */
83
-
84
- /**
85
- * Color expression for data-driven styling
86
- */
87
- type ColorExpression = string | unknown[];
88
- /**
89
- * Number expression for data-driven styling
90
- */
91
- type NumberExpression = number | unknown[];
92
- /**
93
- * Create a solid polygon/fill style
94
- */
95
- declare function createFillStyle(options: {
96
- color: ColorExpression;
97
- opacity?: NumberExpression;
98
- outlineColor?: ColorExpression;
99
- }): {
100
- paint: Record<string, unknown>;
101
- };
102
- /**
103
- * Create a line style
104
- */
105
- declare function createLineStyle(options: {
106
- color: ColorExpression;
107
- width: NumberExpression;
108
- opacity?: NumberExpression;
109
- dashArray?: number[];
110
- cap?: 'butt' | 'round' | 'square';
111
- join?: 'bevel' | 'round' | 'miter';
112
- }): {
113
- paint: Record<string, unknown>;
114
- layout: Record<string, unknown>;
115
- };
116
- /**
117
- * Create a circle/point style
118
- */
119
- declare function createCircleStyle(options: {
120
- radius: NumberExpression;
121
- color: ColorExpression;
122
- opacity?: NumberExpression;
123
- strokeWidth?: NumberExpression;
124
- strokeColor?: ColorExpression;
125
- blur?: number;
126
- }): {
127
- paint: Record<string, unknown>;
128
- };
129
- /**
130
- * Create a 3D extrusion style for buildings
131
- */
132
- declare function createExtrusionStyle(options: {
133
- height: NumberExpression;
134
- baseHeight?: NumberExpression;
135
- color: ColorExpression;
136
- opacity?: number;
137
- verticalGradient?: boolean;
138
- }): {
139
- paint: Record<string, unknown>;
140
- };
141
- /**
142
- * Create a heatmap style
143
- */
144
- declare function createHeatmapStyle(options: {
145
- weight?: NumberExpression;
146
- intensity?: NumberExpression;
147
- radius?: NumberExpression;
148
- opacity?: NumberExpression;
149
- colorRamp?: string[];
150
- }): {
151
- paint: Record<string, unknown>;
152
- };
153
- /**
154
- * Create a hover expression for highlighting features
155
- *
156
- * @param baseValue - The default value
157
- * @param hoverValue - The value when hovered (feature-state hover = true)
158
- * @param featureStateName - The feature state property name (default: 'hover')
159
- */
160
- declare function createHoverExpression(baseValue: unknown, hoverValue: unknown, featureStateName?: string): unknown[];
161
- /**
162
- * Create a selection expression for highlighting selected features
163
- */
164
- declare function createSelectionExpression(baseValue: unknown, selectedValue: unknown, featureStateName?: string): unknown[];
165
- /**
166
- * Create a combined hover and selection expression
167
- */
168
- declare function createInteractiveExpression(baseValue: unknown, hoverValue: unknown, selectedValue: unknown): unknown[];
169
- /**
170
- * Create a data-driven color expression based on a property
171
- *
172
- * @param property - The feature property name
173
- * @param colorMap - Map of property values to colors
174
- * @param defaultColor - Default color for unmapped values
175
- */
176
- declare function createCategoricalColorExpression(property: string, colorMap: Record<string, string>, defaultColor: string): unknown[];
177
- /**
178
- * Create a continuous color ramp expression
179
- *
180
- * @param property - The feature property name
181
- * @param stops - Array of [value, color] pairs
182
- * @param interpolation - Interpolation type ('linear', 'exponential', 'cubic-bezier')
183
- */
184
- declare function createContinuousColorExpression(property: string, stops: [number, string][], interpolation?: 'linear' | 'exponential' | ['cubic-bezier', number, number, number, number]): unknown[];
185
- /**
186
- * Create a zoom-based interpolation expression
187
- *
188
- * @param stops - Array of [zoom, value] pairs
189
- */
190
- declare function createZoomExpression(stops: [number, number][]): unknown[];
191
- /**
192
- * Get pre-configured highlight style for the active theme
193
- */
194
- declare function getHighlightStyle(theme?: MapTheme): {
195
- fill: Record<string, unknown>;
196
- line: Record<string, unknown>;
197
- circle: Record<string, unknown>;
198
- };
199
- /**
200
- * Get pre-configured selection style for the active theme
201
- */
202
- declare function getSelectionStyle(theme?: MapTheme): {
203
- fill: Record<string, unknown>;
204
- line: Record<string, unknown>;
205
- circle: Record<string, unknown>;
206
- };
207
- /**
208
- * Options for creating lot fill styles
209
- */
210
- interface LotFillStyleOptions {
211
- /** Default fill color */
212
- defaultColor: string;
213
- /** Color when hovered */
214
- hoverColor: string;
215
- /** Color when selected (optional) */
216
- selectedColor?: string;
217
- /** Fill opacity (0-1, default: 0.7) */
218
- opacity?: number;
219
- }
220
- /**
221
- * Create fill + hover style for polygon lots
222
- *
223
- * @example
224
- * ```tsx
225
- * const fillStyle = createLotFillStyle({
226
- * defaultColor: '#22c55e',
227
- * hoverColor: '#3b82f6',
228
- * selectedColor: '#f59e0b',
229
- * opacity: 0.7,
230
- * });
231
- *
232
- * <FillLayer
233
- * fillColor={fillStyle['fill-color']}
234
- * fillOpacity={fillStyle['fill-opacity']}
235
- * />
236
- * ```
237
- */
238
- declare function createLotFillStyle(options: LotFillStyleOptions): {
239
- 'fill-color': unknown[];
240
- 'fill-opacity': number;
241
- };
242
- /**
243
- * Options for creating lot outline styles
244
- */
245
- interface LotOutlineStyleOptions {
246
- /** Default outline color */
247
- defaultColor: string;
248
- /** Color when hovered */
249
- hoverColor: string;
250
- /** Color when selected (optional) */
251
- selectedColor?: string;
252
- /** Default line width in pixels (default: 1) */
253
- defaultWidth?: number;
254
- /** Line width when hovered (default: 2) */
255
- hoverWidth?: number;
256
- /** Line width when selected (default: 3) */
257
- selectedWidth?: number;
258
- }
259
- /**
260
- * Create outline style with hover highlighting for polygon lots
261
- *
262
- * @example
263
- * ```tsx
264
- * const outlineStyle = createLotOutlineStyle({
265
- * defaultColor: '#333',
266
- * hoverColor: '#1d4ed8',
267
- * defaultWidth: 1,
268
- * hoverWidth: 2,
269
- * });
270
- *
271
- * <LineLayer
272
- * lineColor={outlineStyle['line-color']}
273
- * lineWidth={outlineStyle['line-width']}
274
- * />
275
- * ```
276
- */
277
- declare function createLotOutlineStyle(options: LotOutlineStyleOptions): {
278
- 'line-color': unknown[];
279
- 'line-width': unknown[];
280
- };
281
- /**
282
- * Options for creating extrusion height expressions
283
- */
284
- interface ExtrusionHeightOptions {
285
- /** Scale factor to multiply property value by (default: 1) */
286
- scale?: number;
287
- /** Minimum height in meters (default: 0) */
288
- minHeight?: number;
289
- /** Maximum height cap in meters (optional) */
290
- maxHeight?: number;
291
- /** Default height when property is missing (default: 0) */
292
- defaultHeight?: number;
293
- }
294
- /**
295
- * Create data-driven extrusion height expression from a feature property
296
- *
297
- * This is useful for visualizing property values like price, square footage,
298
- * or density as 3D heights on a map.
299
- *
300
- * @param property - The feature property name to use for height
301
- * @param options - Configuration options for height calculation
302
- *
303
- * @example
304
- * ```tsx
305
- * // Simple height based on price (scaled down)
306
- * const heightExpr = createExtrusionHeightExpression('price', {
307
- * scale: 0.0001, // $100,000 = 10m height
308
- * minHeight: 5,
309
- * maxHeight: 100,
310
- * });
311
- *
312
- * <FillExtrusionLayer
313
- * fillExtrusionHeight={heightExpr}
314
- * fillExtrusionBase={0}
315
- * />
316
- * ```
317
- */
318
- declare function createExtrusionHeightExpression(property: string, options?: ExtrusionHeightOptions): unknown[];
319
- /**
320
- * Create categorical color expression for lot status
321
- *
322
- * This creates a match expression that maps status values to colors.
323
- * Commonly used for real estate lot statuses like available, sold, pending.
324
- *
325
- * @param statusColors - Map of status values to colors
326
- * @param defaultColor - Fallback color for unknown statuses (default: '#888888')
327
- *
328
- * @example
329
- * ```tsx
330
- * const statusColorExpr = createStatusColorExpression({
331
- * available: '#22c55e', // green
332
- * pending: '#f59e0b', // amber
333
- * sold: '#ef4444', // red
334
- * reserved: '#3b82f6', // blue
335
- * });
336
- *
337
- * <FillLayer fillColor={statusColorExpr} />
338
- * <FillExtrusionLayer fillExtrusionColor={statusColorExpr} />
339
- * ```
340
- */
341
- declare function createStatusColorExpression(statusColors: Record<string, string>, defaultColor?: string): unknown[];
342
- /**
343
- * Create a combined status color expression with hover/selection support
344
- *
345
- * This creates an expression that:
346
- * 1. Uses status-based colors for the default state
347
- * 2. Applies a highlight color on hover
348
- * 3. Optionally applies a selection color when selected
349
- *
350
- * @example
351
- * ```tsx
352
- * const colorExpr = createInteractiveStatusColorExpression(
353
- * { available: '#22c55e', sold: '#ef4444' },
354
- * { hoverColor: '#3b82f6', selectedColor: '#f59e0b' }
355
- * );
356
- *
357
- * <FillLayer fillColor={colorExpr} />
358
- * ```
359
- */
360
- declare function createInteractiveStatusColorExpression(statusColors: Record<string, string>, options: {
361
- hoverColor: string;
362
- selectedColor?: string;
363
- defaultColor?: string;
364
- }): unknown[];
365
-
366
- /**
367
- * Formatting utilities for map data
368
- */
369
-
370
- /**
371
- * Format coordinates for display
372
- *
373
- * @param coordinates - [lng, lat] coordinate pair
374
- * @param precision - Decimal places (default: 6)
375
- * @param format - Output format
376
- */
377
- declare function formatCoordinates(coordinates: LngLat, precision?: number, format?: 'decimal' | 'dms' | 'dd'): string;
378
- /**
379
- * Convert decimal degrees to DMS (degrees, minutes, seconds)
380
- */
381
- declare function decimalToDMS(decimal: number, type: 'lat' | 'lng'): string;
382
- /**
383
- * Format distance in meters to human-readable string
384
- *
385
- * @param meters - Distance in meters
386
- * @param unit - Unit system
387
- */
388
- declare function formatDistance(meters: number, unit?: 'metric' | 'imperial'): string;
389
- /**
390
- * Format area in square meters to human-readable string
391
- *
392
- * @param sqMeters - Area in square meters
393
- * @param unit - Unit system
394
- */
395
- declare function formatArea(sqMeters: number, unit?: 'metric' | 'imperial'): string;
396
- /**
397
- * Format a bounding box for display
398
- */
399
- declare function formatBounds(bounds: MapBounds | BoundsArray): string;
400
- /**
401
- * Format zoom level for display
402
- */
403
- declare function formatZoom(zoom: number): string;
404
- /**
405
- * Format bearing/rotation for display
406
- */
407
- declare function formatBearing(bearing: number): string;
408
- /**
409
- * Format pitch/tilt for display
410
- */
411
- declare function formatPitch(pitch: number): string;
412
- /**
413
- * Format a scale value for display
414
- *
415
- * @param scale - Scale ratio (e.g., 50000 for 1:50,000)
416
- */
417
- declare function formatScale(scale: number): string;
418
- /**
419
- * Approximate the scale from zoom level (rough estimate)
420
- *
421
- * @param zoom - Map zoom level
422
- * @param latitude - Latitude (scale varies by latitude)
423
- */
424
- declare function zoomToScale(zoom: number, latitude?: number): number;
425
- /**
426
- * Format a property value for display in popups
427
- */
428
- declare function formatPropertyValue(value: unknown): string;
429
- /**
430
- * Create a popup content string from feature properties
431
- */
432
- declare function formatFeatureProperties(properties: Record<string, unknown>, options?: {
433
- exclude?: string[];
434
- include?: string[];
435
- labelMap?: Record<string, string>;
436
- }): string;
437
- /**
438
- * Format a property key as a human-readable label
439
- */
440
- declare function formatLabel(key: string): string;
441
- /**
442
- * Result of coordinate validation
443
- */
444
- interface CoordinateValidationResult {
445
- /** Whether the coordinate is valid */
446
- valid: boolean;
447
- /** Error message if invalid */
448
- error?: string;
449
- /** Normalized coordinate if valid */
450
- normalized?: LngLat;
451
- }
452
- /**
453
- * Validate a longitude value
454
- *
455
- * @param lng - Longitude value to validate
456
- * @returns true if valid longitude (-180 to 180)
457
- */
458
- declare function isValidLongitude(lng: unknown): lng is number;
459
- /**
460
- * Validate a latitude value
461
- *
462
- * @param lat - Latitude value to validate
463
- * @returns true if valid latitude (-90 to 90)
464
- */
465
- declare function isValidLatitude(lat: unknown): lat is number;
466
- /**
467
- * Validate a coordinate pair [lng, lat]
468
- *
469
- * @param coordinates - Coordinate pair to validate
470
- * @returns Validation result with error details
471
- *
472
- * @example
473
- * ```typescript
474
- * const result = validateCoordinates([-122.4194, 37.7749]);
475
- * if (result.valid) {
476
- * console.log('Valid:', result.normalized);
477
- * } else {
478
- * console.error('Invalid:', result.error);
479
- * }
480
- * ```
481
- */
482
- declare function validateCoordinates(coordinates: unknown): CoordinateValidationResult;
483
- /**
484
- * Validate and normalize coordinates, throwing on invalid input
485
- *
486
- * @param coordinates - Coordinate pair to validate
487
- * @returns Normalized [lng, lat] array
488
- * @throws Error if coordinates are invalid
489
- */
490
- declare function ensureValidCoordinates(coordinates: unknown): LngLat;
491
- /**
492
- * Normalize longitude to [-180, 180] range
493
- *
494
- * Handles values that wrap around the antimeridian.
495
- *
496
- * @param lng - Longitude value (can be outside -180 to 180)
497
- * @returns Normalized longitude in [-180, 180]
498
- */
499
- declare function normalizeLongitude(lng: number): number;
500
- /**
501
- * Clamp latitude to [-90, 90] range
502
- *
503
- * @param lat - Latitude value
504
- * @returns Clamped latitude in [-90, 90]
505
- */
506
- declare function clampLatitude(lat: number): number;
507
- /**
508
- * Validate a bounds array [[sw_lng, sw_lat], [ne_lng, ne_lat]]
509
- *
510
- * @param bounds - Bounds array to validate
511
- * @returns Validation result with error details
512
- */
513
- declare function validateBoundsArray(bounds: unknown): {
514
- valid: boolean;
515
- error?: string;
516
- normalized?: BoundsArray;
517
- };
518
-
519
- /**
520
- * Bounds calculation utilities for GeoJSON data
521
- */
522
-
523
- /**
524
- * Calculate bounds from GeoJSON data
525
- * @param geojson - GeoJSON FeatureCollection or Feature
526
- * @returns BoundsArray [[sw_lng, sw_lat], [ne_lng, ne_lat]] or null if no valid coordinates
527
- */
528
- declare function calculateBounds(geojson: GeoJSONFeatureCollection | GeoJSONFeature): BoundsArray | null;
529
- /**
530
- * Extend bounds to include a new point
531
- * @param bounds - Existing bounds
532
- * @param point - Point to include [lng, lat]
533
- * @returns Extended bounds
534
- */
535
- declare function extendBounds(bounds: BoundsArray, point: LngLat): BoundsArray;
536
- /**
537
- * Combine two bounds into one that encompasses both
538
- * @param bounds1 - First bounds
539
- * @param bounds2 - Second bounds
540
- * @returns Combined bounds
541
- */
542
- declare function combineBounds(bounds1: BoundsArray, bounds2: BoundsArray): BoundsArray;
543
- /**
544
- * Validate that bounds are properly formed
545
- * @param bounds - Bounds to validate
546
- * @returns True if bounds are valid
547
- */
548
- declare function isValidBounds(bounds: BoundsArray): boolean;
549
-
550
- /**
551
- * Data loading and validation utilities for GeoJSON
552
- */
553
-
554
- /**
555
- * Options for loading GeoJSON data
556
- */
557
- interface LoadGeoJSONOptions {
558
- /** Request timeout in milliseconds (default: 30000) */
559
- timeout?: number;
560
- /** Additional fetch options */
561
- fetchOptions?: RequestInit;
562
- /** Validate the GeoJSON structure after loading */
563
- validate?: boolean;
564
- }
565
- /**
566
- * Result of loading GeoJSON data
567
- */
568
- interface LoadGeoJSONResult<T = GeoJSONFeatureCollection> {
569
- /** The loaded data (null if error) */
570
- data: T | null;
571
- /** Error message if loading failed */
572
- error: string | null;
573
- /** Whether the request was successful */
574
- success: boolean;
575
- }
576
- /**
577
- * GeoJSON validation result
578
- */
579
- interface ValidationResult {
580
- /** Whether the GeoJSON is valid */
581
- valid: boolean;
582
- /** List of validation errors */
583
- errors: string[];
584
- /** Number of features (if FeatureCollection) */
585
- featureCount?: number;
586
- /** Geometry types found */
587
- geometryTypes?: string[];
588
- }
589
- /**
590
- * Load GeoJSON data from a URL
591
- * @param url - URL to fetch GeoJSON from
592
- * @param options - Loading options
593
- * @returns Promise with load result
594
- */
595
- declare function loadGeoJSON<T = GeoJSONFeatureCollection>(url: string, options?: LoadGeoJSONOptions): Promise<LoadGeoJSONResult<T>>;
596
- /**
597
- * Validate GeoJSON structure
598
- * @param data - Data to validate
599
- * @returns Validation result
600
- */
601
- declare function validateGeoJSON(data: unknown): ValidationResult;
602
- /**
603
- * Calculate the centroid of a GeoJSON FeatureCollection or Feature
604
- * @param geojson - GeoJSON data
605
- * @returns Centroid as [lng, lat] or null if no coordinates
606
- */
607
- declare function calculateCentroid(geojson: GeoJSONFeatureCollection | GeoJSONFeature): [number, number] | null;
608
- /**
609
- * Count features by geometry type in a FeatureCollection
610
- * @param geojson - GeoJSON FeatureCollection
611
- * @returns Object with geometry types as keys and counts as values
612
- */
613
- declare function countFeaturesByType(geojson: GeoJSONFeatureCollection): Record<string, number>;
614
- /**
615
- * Filter features by geometry type
616
- * @param geojson - GeoJSON FeatureCollection
617
- * @param types - Geometry types to include
618
- * @returns Filtered FeatureCollection
619
- */
620
- declare function filterByGeometryType(geojson: GeoJSONFeatureCollection, types: string[]): GeoJSONFeatureCollection;
621
-
622
- /**
623
- * Cluster utilities for MapLibre GL
624
- *
625
- * These utilities help with common clustering operations like
626
- * expanding clusters on click and getting cluster information.
627
- */
628
-
629
- /**
630
- * Minimal map interface for cluster read operations
631
- *
632
- * Note: getSource returns unknown to be compatible with MapLibre's Source type.
633
- * The actual clustering methods are validated at runtime.
634
- */
635
- interface ClusterMapReader {
636
- /** Get a source by ID - returns unknown for compatibility with MapLibre types */
637
- getSource: (id: string) => unknown;
638
- }
639
- /**
640
- * Map interface for cluster expansion with easeTo
641
- */
642
- interface ClusterMapExpander extends ClusterMapReader {
643
- /** Animate the map to a new center/zoom */
644
- easeTo: (options: {
645
- center: [number, number];
646
- zoom: number;
647
- duration?: number;
648
- animate?: boolean;
649
- padding?: number | {
650
- top: number;
651
- bottom: number;
652
- left: number;
653
- right: number;
654
- };
655
- }) => void;
656
- /** Get current zoom level */
657
- getZoom: () => number;
658
- }
659
- /**
660
- * Map interface for cluster expansion with fitBounds
661
- */
662
- interface ClusterMapBoundsExpander extends ClusterMapReader {
663
- /** Fit the map to bounds */
664
- fitBounds: (bounds: BoundsArray, options?: {
665
- padding?: number | {
666
- top: number;
667
- bottom: number;
668
- left: number;
669
- right: number;
670
- };
671
- duration?: number;
672
- animate?: boolean;
673
- maxZoom?: number;
674
- }) => void;
675
- }
676
- /**
677
- * Properties automatically added to cluster features by MapLibre GL
678
- */
679
- interface ClusterFeatureProperties extends Record<string, unknown> {
680
- /** Unique cluster identifier */
681
- cluster_id: number;
682
- /** Number of points in the cluster */
683
- point_count: number;
684
- /** Abbreviated point count (e.g., "1.2k") */
685
- point_count_abbreviated: string;
686
- /** Whether this is a cluster */
687
- cluster: true;
688
- }
689
- /**
690
- * Type guard to check if a feature is a cluster
691
- */
692
- declare function isClusterFeature(feature: {
693
- properties?: Record<string, unknown> | null;
694
- }): feature is {
695
- properties: ClusterFeatureProperties;
696
- };
697
- /**
698
- * Options for cluster expansion
699
- */
700
- interface ClusterExpandOptions {
701
- /** Animation duration in milliseconds (default: 500) */
702
- duration?: number;
703
- /** Whether to animate the transition (default: true) */
704
- animate?: boolean;
705
- /** Padding around the expanded cluster bounds */
706
- padding?: number | {
707
- top: number;
708
- bottom: number;
709
- left: number;
710
- right: number;
711
- };
712
- /** Maximum zoom level to expand to */
713
- maxZoom?: number;
714
- }
715
- /**
716
- * Result of getting cluster expansion zoom
717
- */
718
- interface ClusterExpansionResult {
719
- /** The zoom level needed to expand the cluster */
720
- zoom: number;
721
- /** The cluster's center coordinates */
722
- center: LngLat;
723
- }
724
- /**
725
- * Get the zoom level needed to expand a cluster
726
- *
727
- * This is a wrapper around MapLibre GL's getClusterExpansionZoom method
728
- * that provides a cleaner async interface.
729
- *
730
- * @param map - MapLibre GL map instance (or any object with getSource method)
731
- * @param sourceId - ID of the GeoJSON source with clustering enabled
732
- * @param clusterId - The cluster_id from the cluster feature properties
733
- * @returns Promise resolving to the expansion zoom level
734
- *
735
- * @example
736
- * ```typescript
737
- * const zoom = await getClusterExpansionZoom(map, 'points', clusterId);
738
- * map.easeTo({ center: clusterCoords, zoom });
739
- * ```
740
- */
741
- declare function getClusterExpansionZoom(map: ClusterMapReader, sourceId: string, clusterId: number): Promise<number>;
742
- /**
743
- * Get the children features of a cluster
744
- *
745
- * Returns the immediate children of a cluster, which may be
746
- * individual points or other clusters.
747
- *
748
- * @param map - MapLibre GL map instance (or any object with getSource method)
749
- * @param sourceId - ID of the GeoJSON source with clustering enabled
750
- * @param clusterId - The cluster_id from the cluster feature properties
751
- * @returns Promise resolving to an array of child features
752
- */
753
- declare function getClusterChildren(map: ClusterMapReader, sourceId: string, clusterId: number): Promise<GeoJSONFeature[]>;
754
- /**
755
- * Get all leaf features (individual points) of a cluster
756
- *
757
- * Returns all individual points contained within a cluster,
758
- * regardless of nesting level.
759
- *
760
- * @param map - MapLibre GL map instance (or any object with getSource method)
761
- * @param sourceId - ID of the GeoJSON source with clustering enabled
762
- * @param clusterId - The cluster_id from the cluster feature properties
763
- * @param limit - Maximum number of features to return (default: 100)
764
- * @param offset - Offset for pagination (default: 0)
765
- * @returns Promise resolving to an array of leaf features
766
- */
767
- declare function getClusterLeaves(map: ClusterMapReader, sourceId: string, clusterId: number, limit?: number, offset?: number): Promise<GeoJSONFeature[]>;
768
- /**
769
- * Expand a cluster by zooming in to show its contents
770
- *
771
- * This is the main utility for handling cluster click-to-expand behavior.
772
- * It gets the expansion zoom level and animates the map to that zoom.
773
- *
774
- * @param map - MapLibre GL map instance with easeTo method
775
- * @param sourceId - ID of the GeoJSON source with clustering enabled
776
- * @param clusterId - The cluster_id from the cluster feature properties
777
- * @param center - The cluster's center coordinates [lng, lat]
778
- * @param options - Animation and zoom options
779
- *
780
- * @example
781
- * ```typescript
782
- * // In a cluster click handler:
783
- * function handleClusterClick(e) {
784
- * const { cluster_id } = e.feature.properties;
785
- * const [lng, lat] = e.feature.geometry.coordinates;
786
- * expandCluster(map, 'points-source', cluster_id, [lng, lat]);
787
- * }
788
- * ```
789
- */
790
- declare function expandCluster(map: ClusterMapExpander, sourceId: string, clusterId: number, center: LngLat, options?: ClusterExpandOptions): Promise<void>;
791
- /**
792
- * Calculate bounds that encompass all leaves of a cluster
793
- *
794
- * Useful for fitting the map to show all points in a cluster.
795
- *
796
- * @param map - MapLibre GL map instance (or any object with getSource method)
797
- * @param sourceId - ID of the GeoJSON source with clustering enabled
798
- * @param clusterId - The cluster_id from the cluster feature properties
799
- * @param limit - Maximum number of leaves to consider (default: 1000)
800
- * @returns Promise resolving to bounds array [[sw_lng, sw_lat], [ne_lng, ne_lat]]
801
- */
802
- declare function getClusterBounds(map: ClusterMapReader, sourceId: string, clusterId: number, limit?: number): Promise<BoundsArray>;
803
- /**
804
- * Expand a cluster by fitting to the bounds of its leaves
805
- *
806
- * Alternative to expandCluster that zooms to fit all points
807
- * rather than using the expansion zoom level.
808
- *
809
- * @param map - MapLibre GL map instance with fitBounds method
810
- * @param sourceId - ID of the GeoJSON source with clustering enabled
811
- * @param clusterId - The cluster_id from the cluster feature properties
812
- * @param options - Animation and padding options
813
- */
814
- declare function expandClusterToBounds(map: ClusterMapBoundsExpander, sourceId: string, clusterId: number, options?: ClusterExpandOptions): Promise<void>;
815
- /**
816
- * Options for cluster circle layer style
817
- */
818
- interface ClusterCircleStyleOptions {
819
- /** Base color for small clusters (default: '#51bbd6') */
820
- smallColor?: string;
821
- /** Color for medium clusters (default: '#f1f075') */
822
- mediumColor?: string;
823
- /** Color for large clusters (default: '#f28cb1') */
824
- largeColor?: string;
825
- /** Point count threshold for medium size (default: 100) */
826
- mediumThreshold?: number;
827
- /** Point count threshold for large size (default: 750) */
828
- largeThreshold?: number;
829
- /** Base radius for small clusters (default: 20) */
830
- smallRadius?: number;
831
- /** Radius for medium clusters (default: 30) */
832
- mediumRadius?: number;
833
- /** Radius for large clusters (default: 40) */
834
- largeRadius?: number;
835
- /** Circle stroke color (default: '#fff') */
836
- strokeColor?: string;
837
- /** Circle stroke width (default: 2) */
838
- strokeWidth?: number;
839
- /** Circle opacity (default: 0.85) */
840
- opacity?: number;
841
- }
842
- /**
843
- * Options for cluster text layer style
844
- */
845
- interface ClusterTextStyleOptions {
846
- /** Text color (default: '#333') */
847
- textColor?: string;
848
- /** Text size (default: 12) */
849
- textSize?: number;
850
- /** Font stack (default: ['Open Sans Bold', 'Arial Unicode MS Bold']) */
851
- fontStack?: string[];
852
- /** Whether to use abbreviated count (e.g., "1.2k") (default: false) */
853
- abbreviated?: boolean;
854
- }
855
- /**
856
- * Options for unclustered point layer style
857
- */
858
- interface UnclusteredPointStyleOptions {
859
- /** Point color (default: '#11b4da') */
860
- color?: string;
861
- /** Point radius (default: 8) */
862
- radius?: number;
863
- /** Stroke color (default: '#fff') */
864
- strokeColor?: string;
865
- /** Stroke width (default: 1) */
866
- strokeWidth?: number;
867
- }
868
- /**
869
- * Complete cluster layer styles returned by createClusterStyles
870
- */
871
- interface ClusterLayerStyles {
872
- /** Paint properties for the cluster circle layer */
873
- clusterCirclePaint: Record<string, unknown>;
874
- /** Paint properties for the cluster text layer */
875
- clusterTextPaint: Record<string, unknown>;
876
- /** Layout properties for the cluster text layer */
877
- clusterTextLayout: Record<string, unknown>;
878
- /** Paint properties for the unclustered point layer */
879
- unclusteredPointPaint: Record<string, unknown>;
880
- /** Filter for cluster layers (only clusters) */
881
- clusterFilter: unknown[];
882
- /** Filter for unclustered point layer (only non-clusters) */
883
- unclusteredFilter: unknown[];
884
- }
885
- /**
886
- * Creates complete layer styles for rendering clusters
887
- *
888
- * Returns paint/layout properties and filters that can be used with
889
- * CircleLayer and SymbolLayer components.
890
- *
891
- * @param options - Customization options for colors, sizes, etc.
892
- * @returns Object containing all necessary styles and filters
893
- *
894
- * @example
895
- * ```tsx
896
- * const styles = createClusterStyles({
897
- * smallColor: '#3b82f6',
898
- * mediumColor: '#f59e0b',
899
- * largeColor: '#ef4444',
900
- * });
901
- *
902
- * <Source id="points" type="geojson" data={data} cluster={true}>
903
- * <CircleLayer
904
- * id="clusters"
905
- * filter={styles.clusterFilter}
906
- * paint={styles.clusterCirclePaint}
907
- * />
908
- * <SymbolLayer
909
- * id="cluster-count"
910
- * filter={styles.clusterFilter}
911
- * paint={styles.clusterTextPaint}
912
- * layout={styles.clusterTextLayout}
913
- * />
914
- * <CircleLayer
915
- * id="unclustered-point"
916
- * filter={styles.unclusteredFilter}
917
- * paint={styles.unclusteredPointPaint}
918
- * />
919
- * </Source>
920
- * ```
921
- */
922
- declare function createClusterStyles(options?: {
923
- circle?: ClusterCircleStyleOptions;
924
- text?: ClusterTextStyleOptions;
925
- unclusteredPoint?: UnclusteredPointStyleOptions;
926
- }): ClusterLayerStyles;
927
- /**
928
- * Creates a simple cluster circle paint style with stepped colors and sizes
929
- *
930
- * @param options - Customization options
931
- * @returns Paint properties for a circle layer
932
- *
933
- * @example
934
- * ```tsx
935
- * <CircleLayer
936
- * id="clusters"
937
- * filter={['has', 'point_count']}
938
- * paint={createClusterCirclePaint({ smallColor: '#3b82f6' })}
939
- * />
940
- * ```
941
- */
942
- declare function createClusterCirclePaint(options?: ClusterCircleStyleOptions): Record<string, unknown>;
943
- /**
944
- * Creates cluster count text layout properties
945
- *
946
- * @param options - Customization options
947
- * @returns Layout properties for a symbol layer
948
- */
949
- declare function createClusterTextLayout(options?: ClusterTextStyleOptions): Record<string, unknown>;
950
-
951
- /**
952
- * Level-of-Detail (LOD) utilities for efficient rendering of large polygon datasets
953
- *
954
- * These utilities help manage rendering performance by:
955
- * 1. Grouping features by hierarchy (community > filing > lot)
956
- * 2. Generating boundary polygons for groups when not provided
957
- * 3. Supporting zoom-based visibility switching
958
- */
959
-
960
- /**
961
- * Options for grouping features
962
- */
963
- interface GroupFeaturesOptions {
964
- /** Property name to group by */
965
- groupBy: string;
966
- /** Optional nested grouping property */
967
- subGroupBy?: string;
968
- }
969
- /**
970
- * A group of features with computed metadata
971
- */
972
- interface FeatureGroup {
973
- /** Group identifier (property value) */
974
- id: string;
975
- /** Features in this group */
976
- features: GeoJSONFeature[];
977
- /** Bounds of all features in group */
978
- bounds: BoundsArray | null;
979
- /** Centroid of the group */
980
- centroid: LngLat | null;
981
- /** Total count of features */
982
- count: number;
983
- /** Sub-groups if nested grouping was used */
984
- subGroups?: Map<string, FeatureGroup>;
985
- }
986
- /**
987
- * Group GeoJSON features by a property value
988
- *
989
- * @example
990
- * ```ts
991
- * const groups = groupFeaturesByProperty(lotsData, {
992
- * groupBy: 'community',
993
- * subGroupBy: 'filing',
994
- * });
995
- *
996
- * // Access groups
997
- * groups.forEach((group, communityId) => {
998
- * console.log(`Community ${communityId}: ${group.count} lots`);
999
- * group.subGroups?.forEach((subGroup, filingId) => {
1000
- * console.log(` Filing ${filingId}: ${subGroup.count} lots`);
1001
- * });
1002
- * });
1003
- * ```
1004
- */
1005
- declare function groupFeaturesByProperty(geojson: GeoJSONFeatureCollection, options: GroupFeaturesOptions): Map<string, FeatureGroup>;
1006
- /**
1007
- * Generate a convex hull polygon from a set of features
1008
- *
1009
- * Uses the gift wrapping algorithm for simplicity
1010
- */
1011
- declare function generateConvexHull(features: GeoJSONFeature[]): GeoJSONPolygon | null;
1012
- /**
1013
- * Generate a bounding box polygon from features
1014
- * Simpler alternative to convex hull
1015
- */
1016
- declare function generateBoundingPolygon(features: GeoJSONFeature[], padding?: number): GeoJSONPolygon | null;
1017
- /**
1018
- * Convert bounds to a polygon
1019
- */
1020
- declare function boundsToPolygon(bounds: BoundsArray, padding?: number): GeoJSONPolygon;
1021
- /**
1022
- * Simplify a GeoJSON polygon geometry
1023
- *
1024
- * @example
1025
- * ```ts
1026
- * const simplified = simplifyPolygon(polygon, 0.0001);
1027
- * console.log(`Reduced from ${original.coordinates[0].length} to ${simplified.coordinates[0].length} points`);
1028
- * ```
1029
- */
1030
- declare function simplifyPolygon(polygon: GeoJSONPolygon, tolerance: number): GeoJSONPolygon;
1031
- /**
1032
- * Simplify a GeoJSON feature's geometry
1033
- *
1034
- * Supports Point, Polygon, and MultiPolygon geometries.
1035
- * Points are returned unchanged. Lines could be added if needed.
1036
- */
1037
- declare function simplifyFeature(feature: GeoJSONFeature, tolerance: number): GeoJSONFeature;
1038
- /**
1039
- * Simplify all features in a GeoJSON FeatureCollection
1040
- *
1041
- * @example
1042
- * ```ts
1043
- * const simplified = simplifyFeatureCollection(features, 0.0001);
1044
- * // Polygon vertices reduced by ~50-80%
1045
- * ```
1046
- */
1047
- declare function simplifyFeatureCollection(collection: GeoJSONFeatureCollection, tolerance: number): GeoJSONFeatureCollection;
1048
- /**
1049
- * Calculate simplification statistics
1050
- */
1051
- interface SimplificationStats {
1052
- /** Original total vertex count */
1053
- originalVertices: number;
1054
- /** Simplified total vertex count */
1055
- simplifiedVertices: number;
1056
- /** Percentage of vertices removed */
1057
- reductionPercent: number;
1058
- /** Number of features processed */
1059
- featureCount: number;
1060
- }
1061
- /**
1062
- * Simplify a feature collection and return with statistics
1063
- */
1064
- declare function simplifyFeatureCollectionWithStats(collection: GeoJSONFeatureCollection, tolerance: number): {
1065
- data: GeoJSONFeatureCollection;
1066
- stats: SimplificationStats;
1067
- };
1068
- /**
1069
- * Simplification threshold configuration
1070
- */
1071
- interface SimplificationThreshold {
1072
- /** Maximum zoom level to apply this simplification */
1073
- maxZoom: number;
1074
- /** Tolerance in degrees - higher = more simplification */
1075
- tolerance: number;
1076
- }
1077
- /**
1078
- * Options for generating LOD data
1079
- */
1080
- interface GenerateLODOptions {
1081
- /** Property to group by at the top level (e.g., 'community') */
1082
- groupBy: string;
1083
- /** Property to group by at the second level (e.g., 'filing') */
1084
- subGroupBy?: string;
1085
- /** Pre-provided boundary for top-level groups (keyed by group ID) */
1086
- groupBoundaries?: Map<string, GeoJSONPolygon>;
1087
- /** Pre-provided boundary for sub-groups (keyed by "groupId:subGroupId") */
1088
- subGroupBoundaries?: Map<string, GeoJSONPolygon>;
1089
- /** Use convex hull (true) or bounding box (false) for auto-generated boundaries */
1090
- useConvexHull?: boolean;
1091
- /** Padding to add around auto-generated bounding boxes (in degrees) */
1092
- boundaryPadding?: number;
1093
- /** Additional properties to aggregate for group features */
1094
- aggregateProperties?: string[];
1095
- /**
1096
- * Simplification thresholds for reducing polygon complexity at lower zoom levels
1097
- * @example [{ maxZoom: 12, tolerance: 0.0001 }, { maxZoom: 10, tolerance: 0.0005 }]
1098
- */
1099
- simplificationThresholds?: SimplificationThreshold[];
1100
- }
1101
- /**
1102
- * Result of LOD generation
1103
- */
1104
- interface LODData {
1105
- /** Top-level group boundaries (communities) */
1106
- groupBoundaries: GeoJSONFeatureCollection;
1107
- /** Second-level group boundaries (filings) */
1108
- subGroupBoundaries: GeoJSONFeatureCollection | null;
1109
- /** Original features with group info */
1110
- features: GeoJSONFeatureCollection;
1111
- /** Recommended zoom thresholds */
1112
- zoomThresholds: {
1113
- /** Show groups below this zoom */
1114
- groupMaxZoom: number;
1115
- /** Show sub-groups between groupMaxZoom and this */
1116
- subGroupMaxZoom: number;
1117
- };
1118
- }
1119
- /**
1120
- * Generate Level-of-Detail data from a feature collection
1121
- *
1122
- * Creates boundary polygons for each group level that can be shown
1123
- * at different zoom levels for better performance.
1124
- *
1125
- * @example
1126
- * ```tsx
1127
- * const lodData = generateLODData(lotsData, {
1128
- * groupBy: 'community',
1129
- * subGroupBy: 'filing',
1130
- * useConvexHull: true,
1131
- * });
1132
- *
1133
- * // Use in map
1134
- * <Source id="communities" data={lodData.groupBoundaries} />
1135
- * <FillLayer
1136
- * id="communities-fill"
1137
- * source="communities"
1138
- * maxZoom={lodData.zoomThresholds.groupMaxZoom}
1139
- * />
1140
- *
1141
- * <Source id="filings" data={lodData.subGroupBoundaries} />
1142
- * <FillLayer
1143
- * id="filings-fill"
1144
- * source="filings"
1145
- * minZoom={lodData.zoomThresholds.groupMaxZoom}
1146
- * maxZoom={lodData.zoomThresholds.subGroupMaxZoom}
1147
- * />
1148
- *
1149
- * <Source id="lots" data={lodData.features} />
1150
- * <FillLayer
1151
- * id="lots-fill"
1152
- * source="lots"
1153
- * minZoom={lodData.zoomThresholds.subGroupMaxZoom}
1154
- * />
1155
- * ```
1156
- */
1157
- declare function generateLODData(geojson: GeoJSONFeatureCollection, options: GenerateLODOptions): LODData;
1158
- /**
1159
- * Extended LOD data with pre-simplified versions
1160
- */
1161
- interface LODDataWithSimplification extends LODData {
1162
- /** Simplified versions of features for different zoom levels */
1163
- simplifiedFeatures?: Map<number, GeoJSONFeatureCollection>;
1164
- /** Simplification statistics */
1165
- simplificationStats?: Map<number, SimplificationStats>;
1166
- }
1167
- /**
1168
- * Generate LOD data with optional polygon simplification
1169
- *
1170
- * When simplificationThresholds are provided, creates pre-simplified
1171
- * versions of features that can be swapped in at lower zoom levels.
1172
- *
1173
- * @example
1174
- * ```tsx
1175
- * const lodData = generateLODDataWithSimplification(lotsData, {
1176
- * groupBy: 'community',
1177
- * subGroupBy: 'filing',
1178
- * useConvexHull: true,
1179
- * simplificationThresholds: [
1180
- * { maxZoom: 14, tolerance: 0.00005 }, // Light simplification
1181
- * { maxZoom: 12, tolerance: 0.0002 }, // Medium simplification
1182
- * { maxZoom: 10, tolerance: 0.0005 }, // Heavy simplification
1183
- * ],
1184
- * });
1185
- *
1186
- * // Use appropriate data based on zoom
1187
- * const featureData = zoom < 12
1188
- * ? lodData.simplifiedFeatures?.get(10)
1189
- * : zoom < 14
1190
- * ? lodData.simplifiedFeatures?.get(12)
1191
- * : lodData.features;
1192
- * ```
1193
- */
1194
- declare function generateLODDataWithSimplification(geojson: GeoJSONFeatureCollection, options: GenerateLODOptions): LODDataWithSimplification;
1195
- /**
1196
- * Get the appropriate feature collection for a given zoom level
1197
- *
1198
- * @param lodData LOD data with simplification
1199
- * @param zoom Current zoom level
1200
- * @returns The most appropriate feature collection for the zoom level
1201
- */
1202
- declare function getSimplifiedFeaturesForZoom(lodData: LODDataWithSimplification, zoom: number): GeoJSONFeatureCollection;
1203
- /**
1204
- * Calculate appropriate zoom thresholds based on feature density
1205
- */
1206
- declare function calculateZoomThresholds(groups: Map<string, FeatureGroup>, options?: {
1207
- /** Target max features visible at any time */
1208
- targetMaxFeatures?: number;
1209
- /** Minimum zoom difference between levels */
1210
- minZoomGap?: number;
1211
- }): {
1212
- groupMaxZoom: number;
1213
- subGroupMaxZoom: number;
1214
- };
1215
- /**
1216
- * Options for dynamic LOD threshold management
1217
- */
1218
- interface DynamicLODOptions {
1219
- /** Base thresholds to start from */
1220
- baseThresholds: {
1221
- groupMaxZoom: number;
1222
- subGroupMaxZoom: number;
1223
- };
1224
- /** Target FPS to maintain. Default: 50 */
1225
- targetFps?: number;
1226
- /** FPS threshold below which to start adjusting. Default: 40 */
1227
- adjustBelowFps?: number;
1228
- /** Maximum zoom adjustment allowed. Default: 3 */
1229
- maxAdjustment?: number;
1230
- /** Adjustment step per FPS drop. Default: 0.5 */
1231
- adjustmentStep?: number;
1232
- /** Smoothing factor for FPS averaging (0-1). Default: 0.3 */
1233
- smoothingFactor?: number;
1234
- /** Minimum time between adjustments in ms. Default: 1000 */
1235
- adjustmentCooldown?: number;
1236
- }
1237
- /**
1238
- * Current state of dynamic LOD thresholds
1239
- */
1240
- interface DynamicLODState {
1241
- /** Current adjusted thresholds */
1242
- thresholds: {
1243
- groupMaxZoom: number;
1244
- subGroupMaxZoom: number;
1245
- };
1246
- /** Current smoothed FPS */
1247
- averageFps: number;
1248
- /** Current adjustment level */
1249
- adjustment: number;
1250
- /** Whether thresholds are currently elevated */
1251
- isAdjusted: boolean;
1252
- }
1253
- /**
1254
- * Create a dynamic LOD threshold manager
1255
- *
1256
- * Automatically adjusts LOD zoom thresholds based on FPS to maintain
1257
- * smooth performance. When FPS drops, thresholds are raised to show
1258
- * aggregated views longer.
1259
- *
1260
- * @example
1261
- * ```tsx
1262
- * const lodManager = createDynamicLODManager({
1263
- * baseThresholds: { groupMaxZoom: 12, subGroupMaxZoom: 14 },
1264
- * targetFps: 50,
1265
- * });
1266
- *
1267
- * // In render loop or animation frame:
1268
- * useEffect(() => {
1269
- * let frameCount = 0;
1270
- * let lastTime = performance.now();
1271
- *
1272
- * const measure = () => {
1273
- * frameCount++;
1274
- * const now = performance.now();
1275
- * if (now - lastTime >= 1000) {
1276
- * const fps = frameCount;
1277
- * const state = lodManager.update(fps);
1278
- * setThresholds(state.thresholds);
1279
- * frameCount = 0;
1280
- * lastTime = now;
1281
- * }
1282
- * requestAnimationFrame(measure);
1283
- * };
1284
- *
1285
- * const id = requestAnimationFrame(measure);
1286
- * return () => cancelAnimationFrame(id);
1287
- * }, []);
1288
- * ```
1289
- */
1290
- declare function createDynamicLODManager(options: DynamicLODOptions): {
1291
- /** Update with current FPS and get adjusted thresholds */
1292
- update: (currentFps: number) => DynamicLODState;
1293
- /** Force reset to base thresholds */
1294
- reset: () => DynamicLODState;
1295
- /** Get current state without updating */
1296
- getState: () => DynamicLODState;
1297
- };
1298
- /**
1299
- * Get recommended simplification tolerance for a zoom level
1300
- *
1301
- * Returns an appropriate tolerance value for polygon simplification
1302
- * based on the current zoom level. Lower zoom = more simplification.
1303
- *
1304
- * @param zoom Current zoom level
1305
- * @param baseToleranceAtZoom14 Base tolerance to use at zoom 14. Default: 0.00002
1306
- * @returns Tolerance value in degrees
1307
- */
1308
- declare function getSimplificationToleranceForZoom(zoom: number, baseToleranceAtZoom14?: number): number;
1309
- /**
1310
- * Suggested default simplification thresholds
1311
- */
1312
- declare const DEFAULT_SIMPLIFICATION_THRESHOLDS: SimplificationThreshold[];
1313
-
1314
- /**
1315
- * Fast O(1) fingerprinting utilities for GeoJSON data equality checking.
1316
- *
1317
- * Instead of deep comparing potentially 100k+ features, we compare:
1318
- * - Feature count
1319
- * - First feature ID
1320
- * - Last feature ID
1321
- *
1322
- * This provides a fast, reliable check for most data update scenarios.
1323
- */
1324
-
1325
- /**
1326
- * Fingerprint structure for quick GeoJSON comparison
1327
- */
1328
- interface GeoJSONFingerprint {
1329
- /** Total number of features */
1330
- count: number;
1331
- /** ID of the first feature (undefined if no features or no ID) */
1332
- firstId: string | number | undefined;
1333
- /** ID of the last feature (undefined if no features or no ID) */
1334
- lastId: string | number | undefined;
1335
- }
1336
- /**
1337
- * Creates a fast O(1) fingerprint for a GeoJSON FeatureCollection.
1338
- *
1339
- * @param data - GeoJSON data to fingerprint
1340
- * @returns Fingerprint object or null if data is not a FeatureCollection
1341
- */
1342
- declare function createGeoJSONFingerprint(data: GeoJSONFeatureCollection | GeoJSON.GeoJSON | string | null | undefined): GeoJSONFingerprint | null;
1343
- /**
1344
- * Compares two GeoJSON fingerprints for equality.
1345
- *
1346
- * @param a - First fingerprint
1347
- * @param b - Second fingerprint
1348
- * @returns true if fingerprints match (data likely unchanged)
1349
- */
1350
- declare function fingerprintEqual(a: GeoJSONFingerprint | null, b: GeoJSONFingerprint | null): boolean;
1351
- /**
1352
- * Checks if two GeoJSON data objects are equal based on their fingerprints.
1353
- * This is a fast O(1) check that works for most practical scenarios.
1354
- *
1355
- * @param a - First GeoJSON data
1356
- * @param b - Second GeoJSON data
1357
- * @returns true if data is likely unchanged based on fingerprints
1358
- */
1359
- declare function geoJSONEqual(a: GeoJSONFeatureCollection | GeoJSON.GeoJSON | string | null | undefined, b: GeoJSONFeatureCollection | GeoJSON.GeoJSON | string | null | undefined): boolean;
1360
-
1361
- /**
1362
- * Equality and delta detection utilities for MapLibre properties.
1363
- *
1364
- * These utilities help prevent redundant MapLibre API calls by:
1365
- * - Detecting which paint properties actually changed
1366
- * - Comparing filter expressions efficiently
1367
- * - Tracking visibility state changes
1368
- */
1369
- /**
1370
- * Deep equality check for simple values (primitives, arrays, objects).
1371
- * Works for MapLibre expressions and paint property values.
1372
- */
1373
- declare function deepEqual(a: unknown, b: unknown): boolean;
1374
- /**
1375
- * Paint property object type
1376
- */
1377
- type PaintProps = Record<string, unknown>;
1378
- /**
1379
- * Checks if two paint property objects are equal.
1380
- *
1381
- * @param prev - Previous paint properties
1382
- * @param next - Next paint properties
1383
- * @returns true if all properties are equal
1384
- */
1385
- declare function paintPropsEqual(prev: PaintProps | undefined, next: PaintProps | undefined): boolean;
1386
- /**
1387
- * Result of paint property diff
1388
- */
1389
- interface PaintPropsDiff {
1390
- /** Properties that were added or changed */
1391
- changed: PaintProps;
1392
- /** Property names that were removed */
1393
- removed: string[];
1394
- /** Whether there are any changes */
1395
- hasChanges: boolean;
1396
- }
1397
- /**
1398
- * Gets only the paint properties that changed between two states.
1399
- * This allows for targeted setPaintProperty calls instead of updating everything.
1400
- *
1401
- * @param prev - Previous paint properties
1402
- * @param next - Next paint properties
1403
- * @returns Object containing only changed properties
1404
- */
1405
- declare function getChangedPaintProps(prev: PaintProps | undefined, next: PaintProps | undefined): PaintPropsDiff;
1406
- /**
1407
- * MapLibre filter expression operators
1408
- */
1409
- type FilterOperator = 'has' | '!has' | '==' | '!=' | '>' | '>=' | '<' | '<=' | 'in' | '!in' | 'all' | 'any' | 'none' | 'geometry-type' | 'case' | 'match' | 'coalesce' | 'step' | 'interpolate' | 'let' | 'var' | 'literal' | 'get' | 'at' | 'length' | 'boolean' | 'number' | 'string' | 'to-boolean' | 'to-number' | 'to-string' | 'typeof' | '!' | 'within' | 'distance';
1410
- /**
1411
- * Filter expression value types
1412
- */
1413
- type FilterValue = string | number | boolean | null;
1414
- /**
1415
- * MapLibre filter expression type
1416
- *
1417
- * Filters are arrays where the first element is an operator string,
1418
- * followed by arguments that can be property names, values, or nested expressions.
1419
- *
1420
- * Note: We use `unknown[]` for the array type to avoid circular reference issues
1421
- * while still providing the FilterOperator type for documentation and discoverability.
1422
- *
1423
- * @example
1424
- * // Simple equality filter
1425
- * ['==', 'type', 'residential']
1426
- *
1427
- * // Combining filters
1428
- * ['all', ['==', 'type', 'residential'], ['>', 'area', 1000]]
1429
- *
1430
- * // Expression-based filter
1431
- * ['case', ['has', 'name'], true, false]
1432
- */
1433
- type FilterExpression = [FilterOperator, ...unknown[]] | unknown[] | undefined | null;
1434
- /**
1435
- * Checks if two filter expressions are equal.
1436
- *
1437
- * @param prev - Previous filter
1438
- * @param next - Next filter
1439
- * @returns true if filters are equal
1440
- */
1441
- declare function filterEqual(prev: FilterExpression, next: FilterExpression): boolean;
1442
- /**
1443
- * Serializes a filter expression for comparison.
1444
- * Useful for storing last-applied filter state.
1445
- *
1446
- * @param filter - Filter expression
1447
- * @returns JSON string or empty string if no filter
1448
- */
1449
- declare function serializeFilter(filter: FilterExpression): string;
1450
-
1451
- /**
1452
- * Marker CSS Protection Utilities
1453
- *
1454
- * NOTE: DOM-based markers (maplibregl.Marker) are susceptible to CSS framework
1455
- * interference that can cause visual sliding during map pan/rotate operations.
1456
- * For production use cases requiring markers, consider using SymbolLayer instead,
1457
- * which renders on the GPU canvas and is immune to CSS interference.
1458
- *
1459
- * This module provides best-effort CSS protection for DOM markers, but it may not
1460
- * fully prevent sliding in all environments due to CSS specificity and timing issues.
1461
- */
1462
- /**
1463
- * Marker protection class name - used for CSS targeting
1464
- */
1465
- declare const MARKER_PROTECTION_CLASS = "ct-marker-protected";
1466
- /**
1467
- * Apply CSS protection to a marker element.
1468
- *
1469
- * This sets inline styles with !important to attempt to block CSS transitions.
1470
- * Note: This may not work in all environments - use SymbolLayer for guaranteed
1471
- * immunity from CSS interference.
1472
- *
1473
- * @param element - The marker's root HTMLElement (from marker.getElement())
1474
- */
1475
- declare function applyMarkerProtection(element: HTMLElement): void;
1476
- /**
1477
- * Remove protection from a marker element (cleanup function).
1478
- */
1479
- declare function removeMarkerProtection(element: HTMLElement): void;
1480
- /**
1481
- * Apply CSS protection to custom marker content (children/slots).
1482
- */
1483
- declare function applyMarkerChildProtection(element: HTMLElement): void;
1484
-
1485
11
  /**
1486
12
  * Built-in basemap definitions and utilities
1487
13
  */
@@ -2216,4 +742,4 @@ declare const clusterColorExpression: unknown[];
2216
742
  */
2217
743
  declare function createMatchedColorExpression(baseColorExpression: unknown[], matchedProperty?: string): unknown[];
2218
744
 
2219
- export { BIKE_LANES, BUILTIN_BASEMAPS, BUILTIN_OVERLAY_LAYERS, BasemapApiKeys, BasemapDefinition, BoundsArray, CATEGORY_META, CITY_LIMITS, CLASSIC_DARK, CLASSIC_LIGHT, type ClusterCircleStyleOptions, type ClusterExpandOptions, type ClusterExpansionResult, type ClusterFeatureProperties, type ClusterLayerStyles, type ClusterTextStyleOptions, type ColorExpression, type ControlBoundingBox, type ControlDimensions, type ControlOffset, type ControlPriority, type ControlRegistration, type ControlType, type ControlUpdateOptions, type CoordinateValidationResult, type CoordinatorEvent, type CoordinatorEventType, type CoordinatorListener, DEFAULT_BASEMAP, DEFAULT_SIMPLIFICATION_THRESHOLDS, type DynamicLODOptions, type DynamicLODState, EDGE_MARGIN, type ExtendedControlPosition, type ExtrusionHeightOptions, FLOOD_ZONES, FREE_BASEMAPS, type FeatureGroup, type FilterExpression, type FilterOperator, type FilterValue, type GenerateLODOptions, GeoJSONFeature, GeoJSONFeatureCollection, type GeoJSONFingerprint, GeoJSONPolygon, type GroupFeaturesOptions, type InventoryStatus, KEYBOARD_CONTROLS, type LODData, type LODDataWithSimplification, type LayerManagerProps, LngLat, type LoadGeoJSONOptions, type LoadGeoJSONResult, type LotAvailability, type LotFillStyleOptions, type LotOutlineStyleOptions, type LotSize, MAPTILER_BASIC, MAPTILER_OUTDOOR, MAPTILER_SATELLITE, MAPTILER_STREETS, MARKER_PROTECTION_CLASS, MapBounds, type MapDimensions, MapTheme, MarkerData, type NumberExpression, OSM_STANDARD, type OverlayApiKeys, type OverlayDataSource, type OverlayLayerCategory, type OverlayLayerCategoryMeta, type OverlayLayerDefinition, type OverlayLayerLegend, type OverlayLayerState, type OverlayLayerStyle, type OverlayLegendItem, PARKS, PRIMARY_BASEMAPS, PRIORITY_ORDER, type PaintProps, type PaintPropsDiff, type PositionConfig, PositioningCoordinator, SATELLITE_BASEMAP, SCHOOL_DISTRICTS, SPORTS_FACILITIES, STACK_GAP, STADIA_ALIDADE_DARK, STADIA_ALIDADE_SMOOTH, STADIA_STAMEN_TERRAIN, STADIA_STAMEN_TONER, STADIA_STAMEN_WATERCOLOR, type SimplificationStats, type SimplificationThreshold, TOPO_BASEMAP, TRAILS, TRANSIT_ROUTES, type UnclusteredPointStyleOptions, type ValidationResult, WATERSHEDS, type ZIndexLayer, ZONING_DISTRICTS, Z_INDEX_LAYERS, applyMarkerChildProtection, applyMarkerProtection, boundaryColors, boundsToPolygon, calculateBounds, calculateCentroid, calculateZoomThresholds, clampLatitude, clusterColorExpression, clusterColors, combineBounds, countFeaturesByType, createCategoricalColorExpression, createCircleStyle, createClusterCirclePaint, createClusterStyles, createClusterTextLayout, createContinuousColorExpression, createDynamicLODManager, createExtrusionHeightExpression, createExtrusionStyle, createFillStyle, createGeoJSONFingerprint, createHeatmapStyle, createHoverExpression, createInitialLayerStates, createInteractiveExpression, createInteractiveStatusColorExpression, createLineStyle, createLotFillStyle, createLotOutlineStyle, createMatchedColorExpression, createPositioningCoordinator, createSelectionExpression, createStatusColorExpression, createZoomExpression, decimalToDMS, deepEqual, ensureValidCoordinates, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, filterEqual, fingerprintEqual, formatArea, formatBearing, formatBounds, formatCoordinates, formatDistance, formatFeatureProperties, formatLabel, formatPitch, formatPropertyValue, formatScale, formatZoom, generateBoundingPolygon, generateConvexHull, generateFeatureCollectionDescription, generateFeatureTable, generateKeyboardControlsDescription, generateLODData, generateLODDataWithSimplification, generateMapDescription, generateMarkerList, generateMarkersDescription, generateMoveAnnouncement, geoJSONEqual, getAvailabilityColor, getAvailableBasemaps, getChangedPaintProps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getContrastTextColor, getHighlightStyle, getLayerCategories, getLayerStatesArray, getLayerStyleForTheme, getLayersByCategory, getLayersWithErrors, getSelectionStyle, getSimplificationToleranceForZoom, getSimplifiedFeaturesForZoom, getSizeColor, getVisibleLayerIds, groupFeaturesByProperty, groupLayersByCategory, hideAllLayers, inventoryStatusColorExpression, inventoryStatusColors, isAnyLayerLoading, isClusterFeature, isValidBounds, isValidLatitude, isValidLongitude, loadGeoJSON, lotAvailabilityColorExpression, lotAvailabilityColors, lotSizeColorExpression, lotSizeColors, nonMatchedColor, normalizeLongitude, paintPropsEqual, removeMarkerProtection, reorderLayers, resolveBasemapStyle, resolveBasemapThumbnail, resolveLayerSourceUrl, salesOfficeColor, searchLayers, serializeFilter, setLayerError, setLayerLoading, setLayerOpacity, showAllLayers, simplifyFeature, simplifyFeatureCollection, simplifyFeatureCollectionWithStats, simplifyPolygon, toggleLayerVisibility, updateLayerState, validateBoundsArray, validateCoordinates, validateGeoJSON, zoomToScale };
745
+ export { BIKE_LANES, BUILTIN_BASEMAPS, BUILTIN_OVERLAY_LAYERS, BasemapApiKeys, BasemapDefinition, CATEGORY_META, CITY_LIMITS, CLASSIC_DARK, CLASSIC_LIGHT, type ControlBoundingBox, type ControlDimensions, type ControlOffset, type ControlPriority, type ControlRegistration, type ControlType, type ControlUpdateOptions, type CoordinatorEvent, type CoordinatorEventType, type CoordinatorListener, DEFAULT_BASEMAP, EDGE_MARGIN, type ExtendedControlPosition, FLOOD_ZONES, FREE_BASEMAPS, GeoJSONFeatureCollection, type InventoryStatus, type LayerManagerProps, type LotAvailability, type LotSize, MAPTILER_BASIC, MAPTILER_OUTDOOR, MAPTILER_SATELLITE, MAPTILER_STREETS, type MapDimensions, OSM_STANDARD, type OverlayApiKeys, type OverlayDataSource, type OverlayLayerCategory, type OverlayLayerCategoryMeta, type OverlayLayerDefinition, type OverlayLayerLegend, type OverlayLayerState, type OverlayLayerStyle, type OverlayLegendItem, PARKS, PRIMARY_BASEMAPS, PRIORITY_ORDER, type PositionConfig, PositioningCoordinator, SATELLITE_BASEMAP, SCHOOL_DISTRICTS, SPORTS_FACILITIES, STACK_GAP, STADIA_ALIDADE_DARK, STADIA_ALIDADE_SMOOTH, STADIA_STAMEN_TERRAIN, STADIA_STAMEN_TONER, STADIA_STAMEN_WATERCOLOR, TOPO_BASEMAP, TRAILS, TRANSIT_ROUTES, WATERSHEDS, type ZIndexLayer, ZONING_DISTRICTS, Z_INDEX_LAYERS, boundaryColors, clusterColorExpression, clusterColors, createInitialLayerStates, createMatchedColorExpression, createPositioningCoordinator, getAvailabilityColor, getAvailableBasemaps, getContrastTextColor, getLayerCategories, getLayerStatesArray, getLayerStyleForTheme, getLayersByCategory, getLayersWithErrors, getSizeColor, getVisibleLayerIds, groupLayersByCategory, hideAllLayers, inventoryStatusColorExpression, inventoryStatusColors, isAnyLayerLoading, lotAvailabilityColorExpression, lotAvailabilityColors, lotSizeColorExpression, lotSizeColors, nonMatchedColor, reorderLayers, resolveBasemapStyle, resolveBasemapThumbnail, resolveLayerSourceUrl, salesOfficeColor, searchLayers, setLayerError, setLayerLoading, setLayerOpacity, showAllLayers, toggleLayerVisibility, updateLayerState };