@smartnet360/svelte-components 0.0.88 → 0.0.89
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/map-v3/features/cells/constants.d.ts +1 -0
- package/dist/map-v3/features/cells/constants.js +41 -14
- package/dist/map-v3/features/cells/layers/CellsLayer.svelte +12 -5
- package/dist/map-v3/features/cells/logic/geometry.d.ts +1 -1
- package/dist/map-v3/features/cells/logic/geometry.js +4 -3
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { TechnologyBandKey } from './types';
|
|
8
8
|
export declare const Z_INDEX_BY_BAND: Record<TechnologyBandKey, number>;
|
|
9
|
+
export declare const BEAMWIDTH_BOOST_BY_BAND: Record<TechnologyBandKey, number>;
|
|
9
10
|
/**
|
|
10
11
|
* Base Z-Index for Mapbox layer ordering
|
|
11
12
|
* Cells should render below sites but above base map features
|
|
@@ -5,20 +5,17 @@
|
|
|
5
5
|
* Higher frequency bands typically rendered on top
|
|
6
6
|
*/
|
|
7
7
|
export const Z_INDEX_BY_BAND = {
|
|
8
|
-
//
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'4G_800':
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
//
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'4G_2600': 18,
|
|
20
|
-
//high
|
|
21
|
-
'5G_3500': 20,
|
|
8
|
+
// '2G_900': 1,
|
|
9
|
+
// '2G_1800': 3,
|
|
10
|
+
// '4G_700': 7,
|
|
11
|
+
// '4G_800': 9,
|
|
12
|
+
// '4G_900': 11,
|
|
13
|
+
// '4G_1800': 13,
|
|
14
|
+
// '4G_2100': 15,
|
|
15
|
+
// '4G_2600': 19,
|
|
16
|
+
// '5G_700': 23,
|
|
17
|
+
// '5G_2100': 25,
|
|
18
|
+
// '5G_3500': 27,
|
|
22
19
|
// //low
|
|
23
20
|
// '4G_700': 0,
|
|
24
21
|
// '5G_700': 2,
|
|
@@ -33,6 +30,36 @@ export const Z_INDEX_BY_BAND = {
|
|
|
33
30
|
// '4G_2600': 22,
|
|
34
31
|
// //high
|
|
35
32
|
// '5G_3500': 28,
|
|
33
|
+
//low
|
|
34
|
+
'4G_700': 1,
|
|
35
|
+
'5G_700': 0.99,
|
|
36
|
+
'4G_800': 5,
|
|
37
|
+
'2G_900': 7,
|
|
38
|
+
'4G_900': 9,
|
|
39
|
+
//mid
|
|
40
|
+
'4G_1800': 15,
|
|
41
|
+
'2G_1800': 14.99,
|
|
42
|
+
'4G_2100': 19,
|
|
43
|
+
'5G_2100': 18.99,
|
|
44
|
+
'4G_2600': 23,
|
|
45
|
+
//high
|
|
46
|
+
'5G_3500': 25,
|
|
47
|
+
};
|
|
48
|
+
export const BEAMWIDTH_BOOST_BY_BAND = {
|
|
49
|
+
// Low band
|
|
50
|
+
'4G_700': 0,
|
|
51
|
+
'5G_700': 15,
|
|
52
|
+
'4G_800': 0,
|
|
53
|
+
'2G_900': 0,
|
|
54
|
+
'4G_900': 0,
|
|
55
|
+
// Mid band
|
|
56
|
+
'2G_1800': 15,
|
|
57
|
+
'4G_1800': 0,
|
|
58
|
+
'4G_2100': 0,
|
|
59
|
+
'5G_2100': 15,
|
|
60
|
+
'4G_2600': 0,
|
|
61
|
+
// High band
|
|
62
|
+
'5G_3500': 0
|
|
36
63
|
};
|
|
37
64
|
/**
|
|
38
65
|
* Base Z-Index for Mapbox layer ordering
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import type { CellDisplayStore } from '../stores/cell.display.svelte';
|
|
7
7
|
import { groupCells, getColorForGroup } from '../logic/grouping';
|
|
8
8
|
import { generateCellArc, calculateRadiusInMeters } from '../logic/geometry';
|
|
9
|
-
import { Z_INDEX_BY_BAND } from '../constants';
|
|
9
|
+
import { Z_INDEX_BY_BAND, BEAMWIDTH_BOOST_BY_BAND } from '../constants';
|
|
10
10
|
import type { TechnologyBandKey } from '../types';
|
|
11
11
|
import type mapboxgl from 'mapbox-gl';
|
|
12
12
|
|
|
@@ -86,6 +86,9 @@
|
|
|
86
86
|
['get', 'dashArray'],
|
|
87
87
|
['literal', []]
|
|
88
88
|
]
|
|
89
|
+
},
|
|
90
|
+
layout: {
|
|
91
|
+
'line-sort-key': ['get', 'zIndex']
|
|
89
92
|
}
|
|
90
93
|
});
|
|
91
94
|
}
|
|
@@ -171,19 +174,23 @@
|
|
|
171
174
|
// 4. BBox Filter (Simple point check)
|
|
172
175
|
if (bounds.contains([cell.longitude, cell.latitude])) {
|
|
173
176
|
// 5. Z-Index Lookup
|
|
174
|
-
const zIndexKey = `${cell.tech}_${cell.frq}` as TechnologyBandKey;
|
|
177
|
+
const zIndexKey = `${cell.tech}_${cell.frq}` as TechnologyBandKey;
|
|
175
178
|
const zIndex = Z_INDEX_BY_BAND[zIndexKey] || 10;
|
|
176
179
|
|
|
177
180
|
// 6. Calculate Scaled Radius based on Z-Index
|
|
178
181
|
// Higher Z-index (Top layer) = Smaller radius
|
|
179
182
|
// Lower Z-index (Bottom layer) = Larger radius
|
|
180
183
|
// This ensures stacked cells are visible
|
|
181
|
-
const MAX_Z =
|
|
184
|
+
const MAX_Z = 30;
|
|
182
185
|
const scaleFactor = 1 + Math.max(0, MAX_Z - zIndex) * 0.08; // 8% size diff per layer
|
|
183
186
|
const effectiveRadius = radiusMeters * scaleFactor;
|
|
184
187
|
|
|
185
|
-
// 7.
|
|
186
|
-
const
|
|
188
|
+
// 7. Apply beamwidth boost from constants
|
|
189
|
+
const beamwidthBoost = BEAMWIDTH_BOOST_BY_BAND[zIndexKey] || 0;
|
|
190
|
+
const adjustedBeamwidth = cell.beamwidth + beamwidthBoost;
|
|
191
|
+
|
|
192
|
+
// 8. Generate Arc
|
|
193
|
+
const feature = generateCellArc(cell, effectiveRadius, zIndex, style.color, adjustedBeamwidth);
|
|
187
194
|
features.push(feature);
|
|
188
195
|
}
|
|
189
196
|
}
|
|
@@ -9,4 +9,4 @@ export declare function calculateRadiusInMeters(latitude: number, zoom: number,
|
|
|
9
9
|
/**
|
|
10
10
|
* Generates a sector arc GeoJSON feature for a cell
|
|
11
11
|
*/
|
|
12
|
-
export declare function generateCellArc(cell: Cell, radiusMeters: number, zIndex: number, color: string): GeoJSON.Feature<GeoJSON.Polygon>;
|
|
12
|
+
export declare function generateCellArc(cell: Cell, radiusMeters: number, zIndex: number, color: string, beamwidthOverride?: number): GeoJSON.Feature<GeoJSON.Polygon>;
|
|
@@ -13,10 +13,11 @@ export function calculateRadiusInMeters(latitude, zoom, targetPixelSize) {
|
|
|
13
13
|
/**
|
|
14
14
|
* Generates a sector arc GeoJSON feature for a cell
|
|
15
15
|
*/
|
|
16
|
-
export function generateCellArc(cell, radiusMeters, zIndex, color) {
|
|
16
|
+
export function generateCellArc(cell, radiusMeters, zIndex, color, beamwidthOverride) {
|
|
17
17
|
const center = [cell.longitude, cell.latitude];
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const beamwidth = beamwidthOverride ?? cell.beamwidth;
|
|
19
|
+
const bearing1 = cell.azimuth - (beamwidth / 2);
|
|
20
|
+
const bearing2 = cell.azimuth + (beamwidth / 2);
|
|
20
21
|
// Use Turf to generate the sector
|
|
21
22
|
// Note: turf.sector takes (center, radius, bearing1, bearing2)
|
|
22
23
|
// Radius must be in kilometers for default turf units, or specify units
|