@smartnet360/svelte-components 0.0.54 → 0.0.56
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 +1 -1
- package/dist/index.js +2 -2
- package/dist/map-v2/core/controls/MapStyleControl.svelte +289 -0
- package/dist/map-v2/core/controls/MapStyleControl.svelte.d.ts +24 -0
- package/dist/{map → map-v2/core}/hooks/useMapbox.d.ts +1 -1
- package/dist/{map → map-v2/core}/hooks/useMapbox.js +1 -1
- package/dist/map-v2/core/index.d.ts +11 -0
- package/dist/map-v2/core/index.js +14 -0
- package/dist/map-v2/core/providers/MapboxProvider.svelte +140 -0
- package/dist/map-v2/core/providers/MapboxProvider.svelte.d.ts +33 -0
- package/dist/{map → map-v2/core}/stores/mapStore.d.ts +2 -2
- package/dist/{map → map-v2/core}/stores/mapStore.js +2 -2
- package/dist/map-v2/core/types.d.ts +13 -0
- package/dist/map-v2/core/types.js +7 -0
- package/dist/map-v2/demo/DemoMap.svelte +63 -0
- package/dist/{map → map-v2}/demo/DemoMap.svelte.d.ts +3 -4
- package/dist/map-v2/demo/demo-data.d.ts +8 -0
- package/dist/map-v2/demo/demo-data.js +128 -0
- package/dist/map-v2/demo/index.d.ts +7 -0
- package/dist/map-v2/demo/index.js +9 -0
- package/dist/map-v2/features/sites/controls/SiteFilterControl.svelte +147 -0
- package/dist/{map → map-v2/features/sites}/controls/SiteFilterControl.svelte.d.ts +4 -6
- package/dist/map-v2/features/sites/controls/SiteSizeSlider.svelte +236 -0
- package/dist/map-v2/features/sites/controls/SiteSizeSlider.svelte.d.ts +20 -0
- package/dist/map-v2/features/sites/index.d.ts +14 -0
- package/dist/map-v2/features/sites/index.js +16 -0
- package/dist/map-v2/features/sites/layers/SitesLayer.svelte +294 -0
- package/dist/map-v2/features/sites/layers/SitesLayer.svelte.d.ts +12 -0
- package/dist/map-v2/features/sites/stores/siteStore.d.ts +18 -0
- package/dist/map-v2/features/sites/stores/siteStore.js +36 -0
- package/dist/map-v2/features/sites/stores/siteStoreContext.svelte.d.ts +36 -0
- package/dist/map-v2/features/sites/stores/siteStoreContext.svelte.js +155 -0
- package/dist/map-v2/features/sites/types.d.ts +39 -0
- package/dist/map-v2/features/sites/types.js +4 -0
- package/dist/map-v2/features/sites/utils/siteGeoJSON.d.ts +33 -0
- package/dist/map-v2/features/sites/utils/siteGeoJSON.js +43 -0
- package/dist/map-v2/features/sites/utils/siteTreeUtils.d.ts +16 -0
- package/dist/{map → map-v2/features/sites}/utils/siteTreeUtils.js +9 -52
- package/dist/map-v2/index.d.ts +10 -0
- package/dist/map-v2/index.js +22 -0
- package/dist/{map → map-v2/shared}/controls/MapControl.svelte +1 -1
- package/dist/map-v2/shared/index.d.ts +7 -0
- package/dist/map-v2/shared/index.js +9 -0
- package/package.json +1 -1
- package/dist/map/controls/SiteFilterControl.svelte +0 -126
- package/dist/map/demo/DemoMap.svelte +0 -98
- package/dist/map/demo/demo-data.d.ts +0 -12
- package/dist/map/demo/demo-data.js +0 -220
- package/dist/map/hooks/useCellData.d.ts +0 -14
- package/dist/map/hooks/useCellData.js +0 -29
- package/dist/map/index.d.ts +0 -27
- package/dist/map/index.js +0 -47
- package/dist/map/layers/CellsLayer.svelte +0 -242
- package/dist/map/layers/CellsLayer.svelte.d.ts +0 -21
- package/dist/map/layers/CoverageLayer.svelte +0 -37
- package/dist/map/layers/CoverageLayer.svelte.d.ts +0 -9
- package/dist/map/layers/LayerBase.d.ts +0 -42
- package/dist/map/layers/LayerBase.js +0 -58
- package/dist/map/layers/SitesLayer.svelte +0 -282
- package/dist/map/layers/SitesLayer.svelte.d.ts +0 -19
- package/dist/map/providers/CellDataProvider.svelte +0 -43
- package/dist/map/providers/CellDataProvider.svelte.d.ts +0 -12
- package/dist/map/providers/MapboxProvider.svelte +0 -38
- package/dist/map/providers/MapboxProvider.svelte.d.ts +0 -9
- package/dist/map/providers/providerHelpers.d.ts +0 -17
- package/dist/map/providers/providerHelpers.js +0 -26
- package/dist/map/stores/cellDataStore.d.ts +0 -21
- package/dist/map/stores/cellDataStore.js +0 -53
- package/dist/map/stores/interactions.d.ts +0 -20
- package/dist/map/stores/interactions.js +0 -33
- package/dist/map/types.d.ts +0 -115
- package/dist/map/types.js +0 -10
- package/dist/map/utils/geojson.d.ts +0 -20
- package/dist/map/utils/geojson.js +0 -78
- package/dist/map/utils/math.d.ts +0 -40
- package/dist/map/utils/math.js +0 -95
- package/dist/map/utils/siteTreeUtils.d.ts +0 -27
- /package/dist/{map → map-v2/shared}/controls/MapControl.svelte.d.ts +0 -0
- /package/dist/{map → map-v2/shared}/utils/mapboxHelpers.d.ts +0 -0
- /package/dist/{map → map-v2/shared}/utils/mapboxHelpers.js +0 -0
package/dist/map/types.d.ts
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/map/types.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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');
|
|
@@ -1,20 +0,0 @@
|
|
|
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;
|
|
@@ -1,78 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/map/utils/math.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
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;
|
package/dist/map/utils/math.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
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;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|