@smartnet360/svelte-components 0.0.51 → 0.0.53

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 (66) 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/index.d.ts +0 -1
  9. package/dist/core/index.js +2 -1
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js +2 -0
  12. package/dist/map/controls/MapControl.svelte +204 -0
  13. package/dist/map/controls/MapControl.svelte.d.ts +17 -0
  14. package/dist/map/controls/SiteFilterControl.svelte +126 -0
  15. package/dist/map/controls/SiteFilterControl.svelte.d.ts +16 -0
  16. package/dist/map/demo/DemoMap.svelte +98 -0
  17. package/dist/map/demo/DemoMap.svelte.d.ts +12 -0
  18. package/dist/map/demo/demo-data.d.ts +12 -0
  19. package/dist/map/demo/demo-data.js +220 -0
  20. package/dist/map/hooks/useCellData.d.ts +14 -0
  21. package/dist/map/hooks/useCellData.js +29 -0
  22. package/dist/map/hooks/useMapbox.d.ts +14 -0
  23. package/dist/map/hooks/useMapbox.js +29 -0
  24. package/dist/map/index.d.ts +27 -0
  25. package/dist/map/index.js +47 -0
  26. package/dist/map/layers/CellsLayer.svelte +242 -0
  27. package/dist/map/layers/CellsLayer.svelte.d.ts +21 -0
  28. package/dist/map/layers/CoverageLayer.svelte +37 -0
  29. package/dist/map/layers/CoverageLayer.svelte.d.ts +9 -0
  30. package/dist/map/layers/LayerBase.d.ts +42 -0
  31. package/dist/map/layers/LayerBase.js +58 -0
  32. package/dist/map/layers/SitesLayer.svelte +282 -0
  33. package/dist/map/layers/SitesLayer.svelte.d.ts +19 -0
  34. package/dist/map/providers/CellDataProvider.svelte +43 -0
  35. package/dist/map/providers/CellDataProvider.svelte.d.ts +12 -0
  36. package/dist/map/providers/MapboxProvider.svelte +38 -0
  37. package/dist/map/providers/MapboxProvider.svelte.d.ts +9 -0
  38. package/dist/map/providers/providerHelpers.d.ts +17 -0
  39. package/dist/map/providers/providerHelpers.js +26 -0
  40. package/dist/map/stores/cellDataStore.d.ts +21 -0
  41. package/dist/map/stores/cellDataStore.js +53 -0
  42. package/dist/map/stores/interactions.d.ts +20 -0
  43. package/dist/map/stores/interactions.js +33 -0
  44. package/dist/map/stores/mapStore.d.ts +8 -0
  45. package/dist/map/stores/mapStore.js +10 -0
  46. package/dist/map/types.d.ts +115 -0
  47. package/dist/map/types.js +10 -0
  48. package/dist/map/utils/geojson.d.ts +20 -0
  49. package/dist/map/utils/geojson.js +78 -0
  50. package/dist/map/utils/mapboxHelpers.d.ts +51 -0
  51. package/dist/map/utils/mapboxHelpers.js +98 -0
  52. package/dist/map/utils/math.d.ts +40 -0
  53. package/dist/map/utils/math.js +95 -0
  54. package/dist/map/utils/siteTreeUtils.d.ts +27 -0
  55. package/dist/map/utils/siteTreeUtils.js +164 -0
  56. package/package.json +1 -1
  57. package/dist/core/Map/Map.svelte +0 -312
  58. package/dist/core/Map/Map.svelte.d.ts +0 -230
  59. package/dist/core/Map/index.d.ts +0 -9
  60. package/dist/core/Map/index.js +0 -9
  61. package/dist/core/Map/mapSettings.d.ts +0 -147
  62. package/dist/core/Map/mapSettings.js +0 -226
  63. package/dist/core/Map/mapStore.d.ts +0 -73
  64. package/dist/core/Map/mapStore.js +0 -136
  65. package/dist/core/Map/types.d.ts +0 -72
  66. package/dist/core/Map/types.js +0 -32
@@ -0,0 +1,19 @@
1
+ interface Props {
2
+ /** Namespace for layer IDs (default: 'cellular') */
3
+ namespace?: string;
4
+ /** Enable click to select sites (default: true) */
5
+ clickable?: boolean;
6
+ /** Show popup on click (default: true) */
7
+ showPopup?: boolean;
8
+ /** Site circle radius (default: 8) */
9
+ circleRadius?: number;
10
+ /** Site circle color (default: '#3b82f6') */
11
+ circleColor?: string;
12
+ /** Selected site color (default: '#ef4444') */
13
+ selectedColor?: string;
14
+ /** Hovered site color (default: '#8b5cf6') */
15
+ hoverColor?: string;
16
+ }
17
+ declare const SitesLayer: import("svelte").Component<Props, {}, "">;
18
+ type SitesLayer = ReturnType<typeof SitesLayer>;
19
+ export default SitesLayer;
@@ -0,0 +1,43 @@
1
+ <script lang="ts">
2
+ /**
3
+ * CellDataProvider - Provides cellular data (sites, cells) and interaction state to child components
4
+ *
5
+ * Usage:
6
+ * <CellDataProvider {sites} {cells}>
7
+ * <SitesLayer />
8
+ * <CellsLayer />
9
+ * </CellDataProvider>
10
+ */
11
+ import { setContext } from 'svelte';
12
+ import type { Site, Cell } from '../types';
13
+ import { CELL_DATA_CONTEXT_KEY } from '../types';
14
+ import { createCellDataStores } from '../stores/cellDataStore';
15
+
16
+ interface Props {
17
+ /** Array of cellular sites */
18
+ sites?: Site[];
19
+ /** Array of cellular cells/sectors */
20
+ cells?: Cell[];
21
+ /** Optional child content */
22
+ children?: import('svelte').Snippet;
23
+ }
24
+
25
+ let { sites = [], cells = [], children }: Props = $props();
26
+
27
+ // Create and set the cell data context in context
28
+ const cellDataContext = createCellDataStores(sites, cells);
29
+ setContext(CELL_DATA_CONTEXT_KEY, cellDataContext);
30
+
31
+ // Update stores when props change
32
+ $effect(() => {
33
+ cellDataContext.sites.set(sites);
34
+ });
35
+
36
+ $effect(() => {
37
+ cellDataContext.cells.set(cells);
38
+ });
39
+ </script>
40
+
41
+ {#if children}
42
+ {@render children()}
43
+ {/if}
@@ -0,0 +1,12 @@
1
+ import type { Site, Cell } from '../types';
2
+ interface Props {
3
+ /** Array of cellular sites */
4
+ sites?: Site[];
5
+ /** Array of cellular cells/sectors */
6
+ cells?: Cell[];
7
+ /** Optional child content */
8
+ children?: import('svelte').Snippet;
9
+ }
10
+ declare const CellDataProvider: import("svelte").Component<Props, {}, "">;
11
+ type CellDataProvider = ReturnType<typeof CellDataProvider>;
12
+ export default CellDataProvider;
@@ -0,0 +1,38 @@
1
+ <script lang="ts">
2
+ /**
3
+ * MapboxProvider - Provides Mapbox GL JS map instance to child components via context
4
+ *
5
+ * Usage:
6
+ * <MapboxProvider {mapInstance}>
7
+ * <SitesLayer />
8
+ * <CellsLayer />
9
+ * </MapboxProvider>
10
+ */
11
+ import { setContext } from 'svelte';
12
+ import type mapboxgl from 'mapbox-gl';
13
+ import { MAP_CONTEXT_KEY } from '../types';
14
+ import { createMapStore } from '../stores/mapStore';
15
+
16
+ interface Props {
17
+ /** The Mapbox GL JS map instance */
18
+ mapInstance: mapboxgl.Map;
19
+ /** Optional child content */
20
+ children?: import('svelte').Snippet;
21
+ }
22
+
23
+ let { mapInstance, children }: Props = $props();
24
+
25
+ // Create and set the map store in context
26
+ const mapStore = createMapStore();
27
+ setContext(MAP_CONTEXT_KEY, mapStore);
28
+
29
+ // Update the store whenever the map instance changes
30
+ $effect(() => {
31
+ console.log('MapboxProvider: Setting map instance', mapInstance);
32
+ mapStore.set(mapInstance);
33
+ });
34
+ </script>
35
+
36
+ {#if children}
37
+ {@render children()}
38
+ {/if}
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ /** The Mapbox GL JS map instance */
3
+ mapInstance: mapboxgl.Map;
4
+ /** Optional child content */
5
+ children?: import('svelte').Snippet;
6
+ }
7
+ declare const MapboxProvider: import("svelte").Component<Props, {}, "">;
8
+ type MapboxProvider = ReturnType<typeof MapboxProvider>;
9
+ export default MapboxProvider;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Provider helper utilities
3
+ */
4
+ import type { MapStore } from '../types';
5
+ import type { Site, Cell, CellDataContext } from '../types';
6
+ /**
7
+ * Creates a new map store instance
8
+ */
9
+ export declare function createMap(): MapStore;
10
+ /**
11
+ * Creates a new cell data context
12
+ */
13
+ export declare function createCellContext(sites?: Site[], cells?: Cell[]): CellDataContext;
14
+ /**
15
+ * Validates that a map instance is ready for use
16
+ */
17
+ export declare function isMapReady(map: unknown): boolean;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Provider helper utilities
3
+ */
4
+ import { createMapStore } from '../stores/mapStore';
5
+ import { createCellDataStores } from '../stores/cellDataStore';
6
+ /**
7
+ * Creates a new map store instance
8
+ */
9
+ export function createMap() {
10
+ return createMapStore();
11
+ }
12
+ /**
13
+ * Creates a new cell data context
14
+ */
15
+ export function createCellContext(sites = [], cells = []) {
16
+ return createCellDataStores(sites, cells);
17
+ }
18
+ /**
19
+ * Validates that a map instance is ready for use
20
+ */
21
+ export function isMapReady(map) {
22
+ if (!map)
23
+ return false;
24
+ // Check if it has the basic Mapbox GL Map interface
25
+ return typeof map.getStyle === 'function';
26
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Store factory and utilities for cellular data
3
+ */
4
+ import type { Writable, Readable } from 'svelte/store';
5
+ import type { Site, Cell, CellDataContext } from '../types';
6
+ /**
7
+ * Creates a complete cell data context with all required stores
8
+ */
9
+ export declare function createCellDataStores(initialSites?: Site[], initialCells?: Cell[]): CellDataContext;
10
+ /**
11
+ * Creates a derived store that filters cells by site ID
12
+ */
13
+ export declare function createCellsBySiteStore(cells: Writable<Cell[]>, siteId: Writable<string | null>): Readable<Cell[]>;
14
+ /**
15
+ * Creates a derived store for the currently selected site
16
+ */
17
+ export declare function createSelectedSiteStore(sites: Writable<Site[]>, selectedSiteId: Writable<string | null>): Readable<Site | null>;
18
+ /**
19
+ * Creates a derived store for the currently selected cell
20
+ */
21
+ export declare function createSelectedCellStore(cells: Writable<Cell[]>, selectedCellId: Writable<string | null>): Readable<Cell | null>;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Store factory and utilities for cellular data
3
+ */
4
+ import { writable, derived } from 'svelte/store';
5
+ /**
6
+ * Creates a complete cell data context with all required stores
7
+ */
8
+ export function createCellDataStores(initialSites = [], initialCells = []) {
9
+ const sites = writable(initialSites);
10
+ const cells = writable(initialCells);
11
+ const selectedSiteId = writable(null);
12
+ const selectedCellId = writable(null);
13
+ const hoveredSiteId = writable(null);
14
+ const hoveredCellId = writable(null);
15
+ return {
16
+ sites,
17
+ cells,
18
+ selectedSiteId,
19
+ selectedCellId,
20
+ hoveredSiteId,
21
+ hoveredCellId
22
+ };
23
+ }
24
+ /**
25
+ * Creates a derived store that filters cells by site ID
26
+ */
27
+ export function createCellsBySiteStore(cells, siteId) {
28
+ return derived([cells, siteId], ([$cells, $siteId]) => {
29
+ if (!$siteId)
30
+ return [];
31
+ return $cells.filter((cell) => cell.siteId === $siteId);
32
+ });
33
+ }
34
+ /**
35
+ * Creates a derived store for the currently selected site
36
+ */
37
+ export function createSelectedSiteStore(sites, selectedSiteId) {
38
+ return derived([sites, selectedSiteId], ([$sites, $selectedSiteId]) => {
39
+ if (!$selectedSiteId)
40
+ return null;
41
+ return $sites.find((site) => site.id === $selectedSiteId) ?? null;
42
+ });
43
+ }
44
+ /**
45
+ * Creates a derived store for the currently selected cell
46
+ */
47
+ export function createSelectedCellStore(cells, selectedCellId) {
48
+ return derived([cells, selectedCellId], ([$cells, $selectedCellId]) => {
49
+ if (!$selectedCellId)
50
+ return null;
51
+ return $cells.find((cell) => cell.id === $selectedCellId) ?? null;
52
+ });
53
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Interaction state utilities and helpers
3
+ */
4
+ import type { Writable } from 'svelte/store';
5
+ /**
6
+ * Helper to clear all selections
7
+ */
8
+ export declare function clearSelections(selectedSiteId: Writable<string | null>, selectedCellId: Writable<string | null>): void;
9
+ /**
10
+ * Helper to clear all hover states
11
+ */
12
+ export declare function clearHovers(hoveredSiteId: Writable<string | null>, hoveredCellId: Writable<string | null>): void;
13
+ /**
14
+ * Helper to select a site and clear cell selection
15
+ */
16
+ export declare function selectSite(siteId: string | null, selectedSiteId: Writable<string | null>, selectedCellId: Writable<string | null>): void;
17
+ /**
18
+ * Helper to select a cell (and optionally its parent site)
19
+ */
20
+ export declare function selectCell(cellId: string | null, selectedCellId: Writable<string | null>, parentSiteId?: string | null, selectedSiteId?: Writable<string | null>): void;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Interaction state utilities and helpers
3
+ */
4
+ /**
5
+ * Helper to clear all selections
6
+ */
7
+ export function clearSelections(selectedSiteId, selectedCellId) {
8
+ selectedSiteId.set(null);
9
+ selectedCellId.set(null);
10
+ }
11
+ /**
12
+ * Helper to clear all hover states
13
+ */
14
+ export function clearHovers(hoveredSiteId, hoveredCellId) {
15
+ hoveredSiteId.set(null);
16
+ hoveredCellId.set(null);
17
+ }
18
+ /**
19
+ * Helper to select a site and clear cell selection
20
+ */
21
+ export function selectSite(siteId, selectedSiteId, selectedCellId) {
22
+ selectedSiteId.set(siteId);
23
+ selectedCellId.set(null);
24
+ }
25
+ /**
26
+ * Helper to select a cell (and optionally its parent site)
27
+ */
28
+ export function selectCell(cellId, selectedCellId, parentSiteId, selectedSiteId) {
29
+ selectedCellId.set(cellId);
30
+ if (selectedSiteId && parentSiteId !== undefined) {
31
+ selectedSiteId.set(parentSiteId);
32
+ }
33
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Store factory and utilities for Mapbox instance
3
+ */
4
+ import type { MapStore } from '../types';
5
+ /**
6
+ * Creates a writable store for the Mapbox instance
7
+ */
8
+ export declare function createMapStore(): MapStore;
@@ -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;