@smartnet360/svelte-components 0.0.51 → 0.0.54

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 (73) hide show
  1. package/dist/apps/site-check/transforms.js +2 -2
  2. package/dist/core/Charts/ChartCard.svelte +6 -1
  3. package/dist/core/Charts/ChartComponent.svelte +8 -3
  4. package/dist/core/Charts/GlobalControls.svelte +116 -14
  5. package/dist/core/Charts/adapt.js +1 -1
  6. package/dist/core/Charts/charts.model.d.ts +3 -0
  7. package/dist/core/FeatureRegistry/index.js +1 -1
  8. package/dist/core/TreeView/TreeNode.svelte +40 -45
  9. package/dist/core/TreeView/TreeNode.svelte.d.ts +10 -0
  10. package/dist/core/TreeView/TreeView.svelte +14 -2
  11. package/dist/core/TreeView/TreeView.svelte.d.ts +10 -0
  12. package/dist/core/TreeView/tree-utils.d.ts +3 -0
  13. package/dist/core/TreeView/tree-utils.js +33 -9
  14. package/dist/core/TreeView/tree.store.js +49 -24
  15. package/dist/core/index.d.ts +0 -1
  16. package/dist/core/index.js +2 -1
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +2 -0
  19. package/dist/map/controls/MapControl.svelte +204 -0
  20. package/dist/map/controls/MapControl.svelte.d.ts +17 -0
  21. package/dist/map/controls/SiteFilterControl.svelte +126 -0
  22. package/dist/map/controls/SiteFilterControl.svelte.d.ts +16 -0
  23. package/dist/map/demo/DemoMap.svelte +98 -0
  24. package/dist/map/demo/DemoMap.svelte.d.ts +12 -0
  25. package/dist/map/demo/demo-data.d.ts +12 -0
  26. package/dist/map/demo/demo-data.js +220 -0
  27. package/dist/map/hooks/useCellData.d.ts +14 -0
  28. package/dist/map/hooks/useCellData.js +29 -0
  29. package/dist/map/hooks/useMapbox.d.ts +14 -0
  30. package/dist/map/hooks/useMapbox.js +29 -0
  31. package/dist/map/index.d.ts +27 -0
  32. package/dist/map/index.js +47 -0
  33. package/dist/map/layers/CellsLayer.svelte +242 -0
  34. package/dist/map/layers/CellsLayer.svelte.d.ts +21 -0
  35. package/dist/map/layers/CoverageLayer.svelte +37 -0
  36. package/dist/map/layers/CoverageLayer.svelte.d.ts +9 -0
  37. package/dist/map/layers/LayerBase.d.ts +42 -0
  38. package/dist/map/layers/LayerBase.js +58 -0
  39. package/dist/map/layers/SitesLayer.svelte +282 -0
  40. package/dist/map/layers/SitesLayer.svelte.d.ts +19 -0
  41. package/dist/map/providers/CellDataProvider.svelte +43 -0
  42. package/dist/map/providers/CellDataProvider.svelte.d.ts +12 -0
  43. package/dist/map/providers/MapboxProvider.svelte +38 -0
  44. package/dist/map/providers/MapboxProvider.svelte.d.ts +9 -0
  45. package/dist/map/providers/providerHelpers.d.ts +17 -0
  46. package/dist/map/providers/providerHelpers.js +26 -0
  47. package/dist/map/stores/cellDataStore.d.ts +21 -0
  48. package/dist/map/stores/cellDataStore.js +53 -0
  49. package/dist/map/stores/interactions.d.ts +20 -0
  50. package/dist/map/stores/interactions.js +33 -0
  51. package/dist/map/stores/mapStore.d.ts +8 -0
  52. package/dist/map/stores/mapStore.js +10 -0
  53. package/dist/map/types.d.ts +115 -0
  54. package/dist/map/types.js +10 -0
  55. package/dist/map/utils/geojson.d.ts +20 -0
  56. package/dist/map/utils/geojson.js +78 -0
  57. package/dist/map/utils/mapboxHelpers.d.ts +51 -0
  58. package/dist/map/utils/mapboxHelpers.js +98 -0
  59. package/dist/map/utils/math.d.ts +40 -0
  60. package/dist/map/utils/math.js +95 -0
  61. package/dist/map/utils/siteTreeUtils.d.ts +27 -0
  62. package/dist/map/utils/siteTreeUtils.js +164 -0
  63. package/package.json +1 -1
  64. package/dist/core/Map/Map.svelte +0 -312
  65. package/dist/core/Map/Map.svelte.d.ts +0 -230
  66. package/dist/core/Map/index.d.ts +0 -9
  67. package/dist/core/Map/index.js +0 -9
  68. package/dist/core/Map/mapSettings.d.ts +0 -147
  69. package/dist/core/Map/mapSettings.js +0 -226
  70. package/dist/core/Map/mapStore.d.ts +0 -73
  71. package/dist/core/Map/mapStore.js +0 -136
  72. package/dist/core/Map/types.d.ts +0 -72
  73. package/dist/core/Map/types.js +0 -32
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Store factory and utilities for Mapbox instance
3
+ */
4
+ import { writable } from 'svelte/store';
5
+ /**
6
+ * Creates a writable store for the Mapbox instance
7
+ */
8
+ export function createMapStore() {
9
+ return writable(null);
10
+ }
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Core types for Mapbox cellular visualization components
3
+ */
4
+ import type { Writable } from 'svelte/store';
5
+ /** Context key for the Mapbox instance store */
6
+ export declare const MAP_CONTEXT_KEY: unique symbol;
7
+ /** Context key for the cell data stores */
8
+ export declare const CELL_DATA_CONTEXT_KEY: unique symbol;
9
+ /**
10
+ * Represents a cellular site/tower location
11
+ */
12
+ export interface Site {
13
+ /** Unique identifier for the site */
14
+ id: string;
15
+ /** Human-readable site name */
16
+ name: string;
17
+ /** Latitude (WGS84) */
18
+ latitude: number;
19
+ /** Longitude (WGS84) */
20
+ longitude: number;
21
+ /** Frequency bands */
22
+ fbands?: string[];
23
+ /** Technology (e.g., '4G', '5G', 'LTE') */
24
+ technology: string;
25
+ /** Additional properties */
26
+ properties: Record<string, any>;
27
+ /** Array of cell names at this site */
28
+ cellNames: string[];
29
+ /** Source or owning organization (e.g. 'Vodafone', 'France Telecom') */
30
+ provider: string;
31
+ /** Sub-classification used for TreeView grouping for level2 grouping */
32
+ featureGroup: string;
33
+ }
34
+ /**
35
+ * Represents a cellular sector/cell with coverage area
36
+ */
37
+ export interface Cell {
38
+ /** Unique identifier for the cell */
39
+ id: string;
40
+ /** ID of the parent site */
41
+ siteId: string;
42
+ /** Sector number (e.g., 1, 2, 3) */
43
+ sector?: number;
44
+ /** Azimuth/bearing in degrees (0-360, where 0 is North) */
45
+ azimuth: number;
46
+ /** Beamwidth/aperture in degrees (e.g., 65, 120) */
47
+ beamwidth: number;
48
+ /** Coverage radius in meters (default: 500) */
49
+ radius?: number;
50
+ /** Optional additional properties (band, technology, etc.) */
51
+ properties?: Record<string, unknown>;
52
+ }
53
+ /**
54
+ * User interaction state (selection, hover)
55
+ */
56
+ export interface InteractionState {
57
+ /** Currently selected site ID */
58
+ selectedSiteId: string | null;
59
+ /** Currently selected cell ID */
60
+ selectedCellId: string | null;
61
+ /** Currently hovered site ID */
62
+ hoveredSiteId: string | null;
63
+ /** Currently hovered cell ID */
64
+ hoveredCellId: string | null;
65
+ }
66
+ /**
67
+ * Map instance store provided by MapboxProvider
68
+ */
69
+ export type MapStore = Writable<mapboxgl.Map | null>;
70
+ /**
71
+ * Cell data context stores provided by CellDataProvider
72
+ */
73
+ export interface CellDataContext {
74
+ /** Store containing all sites */
75
+ sites: Writable<Site[]>;
76
+ /** Store containing all cells */
77
+ cells: Writable<Cell[]>;
78
+ /** Store for selected site ID */
79
+ selectedSiteId: Writable<string | null>;
80
+ /** Store for selected cell ID */
81
+ selectedCellId: Writable<string | null>;
82
+ /** Store for hovered site ID */
83
+ hoveredSiteId: Writable<string | null>;
84
+ /** Store for hovered cell ID */
85
+ hoveredCellId: Writable<string | null>;
86
+ }
87
+ /**
88
+ * GeoJSON Point Feature for a site
89
+ */
90
+ export interface SiteFeature {
91
+ type: 'Feature';
92
+ geometry: {
93
+ type: 'Point';
94
+ coordinates: [number, number];
95
+ };
96
+ properties: Site;
97
+ }
98
+ /**
99
+ * GeoJSON Polygon Feature for a cell sector
100
+ */
101
+ export interface CellFeature {
102
+ type: 'Feature';
103
+ geometry: {
104
+ type: 'Polygon';
105
+ coordinates: number[][][];
106
+ };
107
+ properties: Cell;
108
+ }
109
+ /**
110
+ * GeoJSON FeatureCollection
111
+ */
112
+ export interface FeatureCollection<T> {
113
+ type: 'FeatureCollection';
114
+ features: T[];
115
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Core types for Mapbox cellular visualization components
3
+ */
4
+ // ============================================================================
5
+ // Context Keys
6
+ // ============================================================================
7
+ /** Context key for the Mapbox instance store */
8
+ export const MAP_CONTEXT_KEY = Symbol('mapbox-instance');
9
+ /** Context key for the cell data stores */
10
+ export const CELL_DATA_CONTEXT_KEY = Symbol('cell-data');
@@ -0,0 +1,20 @@
1
+ /**
2
+ * GeoJSON conversion utilities for sites and cells
3
+ */
4
+ import type { Site, Cell, SiteFeature, CellFeature, FeatureCollection } from '../types';
5
+ /**
6
+ * Converts an array of sites to a GeoJSON FeatureCollection
7
+ */
8
+ export declare function sitesToGeoJSON(sites: Site[]): FeatureCollection<SiteFeature>;
9
+ /**
10
+ * Converts an array of cells to a GeoJSON FeatureCollection of polygons
11
+ */
12
+ export declare function cellsToGeoJSON(cells: Cell[], sites: Site[], defaultRadius?: number): FeatureCollection<CellFeature>;
13
+ /**
14
+ * Converts a single site to a GeoJSON Feature
15
+ */
16
+ export declare function siteToFeature(site: Site): SiteFeature;
17
+ /**
18
+ * Converts a single cell to a GeoJSON Feature (requires parent site for location)
19
+ */
20
+ export declare function cellToFeature(cell: Cell, site: Site, defaultRadius?: number): CellFeature | null;
@@ -0,0 +1,78 @@
1
+ /**
2
+ * GeoJSON conversion utilities for sites and cells
3
+ */
4
+ import { createSectorPolygon } from './math';
5
+ /**
6
+ * Converts an array of sites to a GeoJSON FeatureCollection
7
+ */
8
+ export function sitesToGeoJSON(sites) {
9
+ const features = sites.map((site) => ({
10
+ type: 'Feature',
11
+ geometry: {
12
+ type: 'Point',
13
+ coordinates: [site.longitude, site.latitude]
14
+ },
15
+ properties: site
16
+ }));
17
+ return {
18
+ type: 'FeatureCollection',
19
+ features
20
+ };
21
+ }
22
+ /**
23
+ * Converts an array of cells to a GeoJSON FeatureCollection of polygons
24
+ */
25
+ export function cellsToGeoJSON(cells, sites, defaultRadius = 500) {
26
+ // Create a map for fast site lookup
27
+ const siteMap = new Map(sites.map((site) => [site.id, site]));
28
+ const features = [];
29
+ for (const cell of cells) {
30
+ const site = siteMap.get(cell.siteId);
31
+ if (!site) {
32
+ console.warn(`Cell ${cell.id} references unknown site ${cell.siteId}`);
33
+ continue;
34
+ }
35
+ const radius = cell.radius ?? defaultRadius;
36
+ const coordinates = createSectorPolygon(site.longitude, site.latitude, cell.azimuth, cell.beamwidth, radius);
37
+ features.push({
38
+ type: 'Feature',
39
+ geometry: {
40
+ type: 'Polygon',
41
+ coordinates: [coordinates]
42
+ },
43
+ properties: cell
44
+ });
45
+ }
46
+ return {
47
+ type: 'FeatureCollection',
48
+ features
49
+ };
50
+ }
51
+ /**
52
+ * Converts a single site to a GeoJSON Feature
53
+ */
54
+ export function siteToFeature(site) {
55
+ return {
56
+ type: 'Feature',
57
+ geometry: {
58
+ type: 'Point',
59
+ coordinates: [site.longitude, site.latitude]
60
+ },
61
+ properties: site
62
+ };
63
+ }
64
+ /**
65
+ * Converts a single cell to a GeoJSON Feature (requires parent site for location)
66
+ */
67
+ export function cellToFeature(cell, site, defaultRadius = 500) {
68
+ const radius = cell.radius ?? defaultRadius;
69
+ const coordinates = createSectorPolygon(site.longitude, site.latitude, cell.azimuth, cell.beamwidth, radius);
70
+ return {
71
+ type: 'Feature',
72
+ geometry: {
73
+ type: 'Polygon',
74
+ coordinates: [coordinates]
75
+ },
76
+ properties: cell
77
+ };
78
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Mapbox GL JS helper utilities for layer and source management
3
+ */
4
+ /**
5
+ * Safely adds a source to the map if it doesn't already exist
6
+ */
7
+ export declare function addSourceIfMissing(map: mapboxgl.Map, sourceId: string, sourceSpec: mapboxgl.AnySourceData): void;
8
+ /**
9
+ * Safely removes a source from the map if it exists
10
+ */
11
+ export declare function removeSourceIfExists(map: mapboxgl.Map, sourceId: string): void;
12
+ /**
13
+ * Safely adds a layer to the map if it doesn't already exist
14
+ */
15
+ export declare function addLayerIfMissing(map: mapboxgl.Map, layer: mapboxgl.AnyLayer, beforeId?: string): void;
16
+ /**
17
+ * Safely removes a layer from the map if it exists
18
+ */
19
+ export declare function removeLayerIfExists(map: mapboxgl.Map, layerId: string): void;
20
+ /**
21
+ * Updates GeoJSON source data if the source exists
22
+ */
23
+ export declare function updateGeoJSONSource(map: mapboxgl.Map, sourceId: string, data: GeoJSON.FeatureCollection | GeoJSON.Feature): void;
24
+ /**
25
+ * Removes a layer and its associated source
26
+ */
27
+ export declare function removeLayerAndSource(map: mapboxgl.Map, layerId: string, sourceId: string): void;
28
+ /**
29
+ * Checks if the map style is loaded
30
+ */
31
+ export declare function isStyleLoaded(map: mapboxgl.Map): boolean;
32
+ /**
33
+ * Waits for the map style to be loaded
34
+ */
35
+ export declare function waitForStyleLoad(map: mapboxgl.Map): Promise<void>;
36
+ /**
37
+ * Sets a feature state on a source
38
+ */
39
+ export declare function setFeatureState(map: mapboxgl.Map, sourceId: string, featureId: string | number, state: Record<string, unknown>): void;
40
+ /**
41
+ * Removes a feature state from a source
42
+ */
43
+ export declare function removeFeatureState(map: mapboxgl.Map, sourceId: string, featureId: string | number, key?: string): void;
44
+ /**
45
+ * Generates a unique layer ID with a namespace prefix
46
+ */
47
+ export declare function generateLayerId(namespace: string, layerName: string): string;
48
+ /**
49
+ * Generates a unique source ID with a namespace prefix
50
+ */
51
+ export declare function generateSourceId(namespace: string, sourceName: string): string;
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Mapbox GL JS helper utilities for layer and source management
3
+ */
4
+ /**
5
+ * Safely adds a source to the map if it doesn't already exist
6
+ */
7
+ export function addSourceIfMissing(map, sourceId, sourceSpec) {
8
+ if (!map.getSource(sourceId)) {
9
+ map.addSource(sourceId, sourceSpec);
10
+ }
11
+ }
12
+ /**
13
+ * Safely removes a source from the map if it exists
14
+ */
15
+ export function removeSourceIfExists(map, sourceId) {
16
+ if (map.getSource(sourceId)) {
17
+ map.removeSource(sourceId);
18
+ }
19
+ }
20
+ /**
21
+ * Safely adds a layer to the map if it doesn't already exist
22
+ */
23
+ export function addLayerIfMissing(map, layer, beforeId) {
24
+ if (!map.getLayer(layer.id)) {
25
+ map.addLayer(layer, beforeId);
26
+ }
27
+ }
28
+ /**
29
+ * Safely removes a layer from the map if it exists
30
+ */
31
+ export function removeLayerIfExists(map, layerId) {
32
+ if (map.getLayer(layerId)) {
33
+ map.removeLayer(layerId);
34
+ }
35
+ }
36
+ /**
37
+ * Updates GeoJSON source data if the source exists
38
+ */
39
+ export function updateGeoJSONSource(map, sourceId, data) {
40
+ const source = map.getSource(sourceId);
41
+ if (source && source.type === 'geojson') {
42
+ source.setData(data);
43
+ }
44
+ }
45
+ /**
46
+ * Removes a layer and its associated source
47
+ */
48
+ export function removeLayerAndSource(map, layerId, sourceId) {
49
+ removeLayerIfExists(map, layerId);
50
+ removeSourceIfExists(map, sourceId);
51
+ }
52
+ /**
53
+ * Checks if the map style is loaded
54
+ */
55
+ export function isStyleLoaded(map) {
56
+ return map.isStyleLoaded();
57
+ }
58
+ /**
59
+ * Waits for the map style to be loaded
60
+ */
61
+ export async function waitForStyleLoad(map) {
62
+ if (isStyleLoaded(map)) {
63
+ return Promise.resolve();
64
+ }
65
+ return new Promise((resolve) => {
66
+ map.once('styledata', () => resolve());
67
+ });
68
+ }
69
+ /**
70
+ * Sets a feature state on a source
71
+ */
72
+ export function setFeatureState(map, sourceId, featureId, state) {
73
+ map.setFeatureState({
74
+ source: sourceId,
75
+ id: featureId
76
+ }, state);
77
+ }
78
+ /**
79
+ * Removes a feature state from a source
80
+ */
81
+ export function removeFeatureState(map, sourceId, featureId, key) {
82
+ map.removeFeatureState({
83
+ source: sourceId,
84
+ id: featureId
85
+ }, key);
86
+ }
87
+ /**
88
+ * Generates a unique layer ID with a namespace prefix
89
+ */
90
+ export function generateLayerId(namespace, layerName) {
91
+ return `${namespace}:${layerName}`;
92
+ }
93
+ /**
94
+ * Generates a unique source ID with a namespace prefix
95
+ */
96
+ export function generateSourceId(namespace, sourceName) {
97
+ return `${namespace}:${sourceName}`;
98
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Mathematical utilities for cellular sector geometry
3
+ */
4
+ /**
5
+ * Calculates the destination point given start point, bearing, and distance
6
+ * Uses Haversine formula
7
+ *
8
+ * @param lon - Starting longitude
9
+ * @param lat - Starting latitude
10
+ * @param bearing - Bearing in degrees (0 = North, 90 = East)
11
+ * @param distance - Distance in meters
12
+ * @returns [lon, lat] of destination point
13
+ */
14
+ export declare function destinationPoint(lon: number, lat: number, bearing: number, distance: number): [number, number];
15
+ /**
16
+ * Creates a polygon representing a cellular sector
17
+ *
18
+ * @param centerLon - Center point longitude
19
+ * @param centerLat - Center point latitude
20
+ * @param azimuth - Sector azimuth/bearing in degrees (0-360, where 0 is North)
21
+ * @param beamwidth - Sector beamwidth in degrees (e.g., 65, 120)
22
+ * @param radius - Sector radius in meters
23
+ * @param arcPoints - Number of points to use for the arc (default: 32)
24
+ * @returns Array of [lon, lat] coordinates forming a closed polygon
25
+ */
26
+ export declare function createSectorPolygon(centerLon: number, centerLat: number, azimuth: number, beamwidth: number, radius: number, arcPoints?: number): [number, number][];
27
+ /**
28
+ * Creates a circle polygon (360-degree sector)
29
+ *
30
+ * @param centerLon - Center point longitude
31
+ * @param centerLat - Center point latitude
32
+ * @param radius - Circle radius in meters
33
+ * @param points - Number of points to use for the circle (default: 64)
34
+ * @returns Array of [lon, lat] coordinates forming a closed polygon
35
+ */
36
+ export declare function createCirclePolygon(centerLon: number, centerLat: number, radius: number, points?: number): [number, number][];
37
+ /**
38
+ * Normalizes an azimuth to 0-360 range
39
+ */
40
+ export declare function normalizeAzimuth(azimuth: number): number;
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Mathematical utilities for cellular sector geometry
3
+ */
4
+ /**
5
+ * Converts degrees to radians
6
+ */
7
+ function toRadians(degrees) {
8
+ return (degrees * Math.PI) / 180;
9
+ }
10
+ /**
11
+ * Converts radians to degrees
12
+ */
13
+ function toDegrees(radians) {
14
+ return (radians * 180) / Math.PI;
15
+ }
16
+ /**
17
+ * Calculates the destination point given start point, bearing, and distance
18
+ * Uses Haversine formula
19
+ *
20
+ * @param lon - Starting longitude
21
+ * @param lat - Starting latitude
22
+ * @param bearing - Bearing in degrees (0 = North, 90 = East)
23
+ * @param distance - Distance in meters
24
+ * @returns [lon, lat] of destination point
25
+ */
26
+ export function destinationPoint(lon, lat, bearing, distance) {
27
+ const R = 6371e3; // Earth radius in meters
28
+ const δ = distance / R; // Angular distance
29
+ const θ = toRadians(bearing);
30
+ const φ1 = toRadians(lat);
31
+ const λ1 = toRadians(lon);
32
+ const φ2 = Math.asin(Math.sin(φ1) * Math.cos(δ) + Math.cos(φ1) * Math.sin(δ) * Math.cos(θ));
33
+ const λ2 = λ1 +
34
+ Math.atan2(Math.sin(θ) * Math.sin(δ) * Math.cos(φ1), Math.cos(δ) - Math.sin(φ1) * Math.sin(φ2));
35
+ return [toDegrees(λ2), toDegrees(φ2)];
36
+ }
37
+ /**
38
+ * Creates a polygon representing a cellular sector
39
+ *
40
+ * @param centerLon - Center point longitude
41
+ * @param centerLat - Center point latitude
42
+ * @param azimuth - Sector azimuth/bearing in degrees (0-360, where 0 is North)
43
+ * @param beamwidth - Sector beamwidth in degrees (e.g., 65, 120)
44
+ * @param radius - Sector radius in meters
45
+ * @param arcPoints - Number of points to use for the arc (default: 32)
46
+ * @returns Array of [lon, lat] coordinates forming a closed polygon
47
+ */
48
+ export function createSectorPolygon(centerLon, centerLat, azimuth, beamwidth, radius, arcPoints = 32) {
49
+ const coordinates = [];
50
+ // Start at the center point
51
+ coordinates.push([centerLon, centerLat]);
52
+ // Calculate start and end bearings
53
+ const startBearing = azimuth - beamwidth / 2;
54
+ const endBearing = azimuth + beamwidth / 2;
55
+ // Generate arc points
56
+ const angleStep = beamwidth / (arcPoints - 1);
57
+ for (let i = 0; i < arcPoints; i++) {
58
+ const bearing = startBearing + angleStep * i;
59
+ const point = destinationPoint(centerLon, centerLat, bearing, radius);
60
+ coordinates.push(point);
61
+ }
62
+ // Close the polygon by returning to center
63
+ coordinates.push([centerLon, centerLat]);
64
+ return coordinates;
65
+ }
66
+ /**
67
+ * Creates a circle polygon (360-degree sector)
68
+ *
69
+ * @param centerLon - Center point longitude
70
+ * @param centerLat - Center point latitude
71
+ * @param radius - Circle radius in meters
72
+ * @param points - Number of points to use for the circle (default: 64)
73
+ * @returns Array of [lon, lat] coordinates forming a closed polygon
74
+ */
75
+ export function createCirclePolygon(centerLon, centerLat, radius, points = 64) {
76
+ const coordinates = [];
77
+ const angleStep = 360 / points;
78
+ for (let i = 0; i < points; i++) {
79
+ const bearing = angleStep * i;
80
+ const point = destinationPoint(centerLon, centerLat, bearing, radius);
81
+ coordinates.push(point);
82
+ }
83
+ // Close the polygon
84
+ coordinates.push(coordinates[0]);
85
+ return coordinates;
86
+ }
87
+ /**
88
+ * Normalizes an azimuth to 0-360 range
89
+ */
90
+ export function normalizeAzimuth(azimuth) {
91
+ let normalized = azimuth % 360;
92
+ if (normalized < 0)
93
+ normalized += 360;
94
+ return normalized;
95
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Utilities for building and managing site filter tree
3
+ */
4
+ import type { Site } from '../types';
5
+ import type { TreeNode } from '../../core/TreeView/tree.model';
6
+ /**
7
+ * Builds a hierarchical tree from flat site array
8
+ * Structure: All Sites -> Provider -> Feature Group
9
+ */
10
+ export declare function buildSiteTree(sites: Site[]): TreeNode;
11
+ /**
12
+ * Filters sites based on checked tree paths
13
+ */
14
+ export declare function getFilteredSites(checkedPaths: string[], allSites: Site[]): Site[];
15
+ /**
16
+ * Saves tree checked paths to localStorage
17
+ */
18
+ export declare function saveTreeState(checkedPaths: string[]): void;
19
+ /**
20
+ * Loads tree state from localStorage
21
+ * Returns map of node IDs to checked state
22
+ */
23
+ export declare function loadTreeState(): Record<string, boolean>;
24
+ /**
25
+ * Clears saved tree state
26
+ */
27
+ export declare function clearTreeState(): void;