mirror of
https://github.com/MeshCore-Beacon/beacon-web.git
synced 2026-10-22 18:51:21 +00:00
map: fade live-mode clusters more so dense ones stay see-through
This commit is contained in:
1 parent
105e68ec04
commit
c41fe359a6
2 files changed
+6
-2
No files matched your search
@@ -108,7 +108,10 @@ export const PACKET_FLOW_HOP_MS = 480; // ms the dot takes to cross one hop segm
|
||||
export const PACKET_FLOW_FLASH_MS = 900; // a crossed node's flash decays back to dim over this
|
||||
export const PACKET_FLOW_TRAIL_FADE_MS = 1000; // the dashed trail fades once the dot reaches the end
|
||||
export const PACKET_FLOW_MAX = 120; // cap on concurrent packet animations (busy-feed guard)
|
||||
export const LIVE_DIM_OPACITY = 0.18; // idle node/cluster opacity while Live mode is on
|
||||
export const LIVE_DIM_OPACITY = 0.18; // idle individual-node opacity while Live mode is on
|
||||
// Clusters dim further: many overlapping semi-transparent hexagons composite toward opaque, so a
|
||||
// dense cluster field stops being see-through. A lower per-cluster alpha keeps the stack translucent.
|
||||
export const LIVE_CLUSTER_DIM_OPACITY = 0.07;
|
||||
|
||||
export const CLUSTER_RADIUS = 50; // px
|
||||
// Keep clustering alive across the whole reachable zoom range (default max is 22). maplibre drops
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
PACKET_FLOW_TRAIL_FADE_MS,
|
||||
PACKET_FLOW_MAX,
|
||||
LIVE_DIM_OPACITY,
|
||||
LIVE_CLUSTER_DIM_OPACITY,
|
||||
NODES_SOURCE_ID,
|
||||
NODES_POINT_LAYER_ID,
|
||||
NODES_CLUSTER_LAYER_ID,
|
||||
@@ -195,7 +196,7 @@ export function useMapPacketFlow(
|
||||
map.setPaintProperty(NODES_POINT_LAYER_ID, "text-opacity", enabled ? 0 : LABEL_OPACITY);
|
||||
}
|
||||
if (map.getLayer(NODES_CLUSTER_LAYER_ID)) {
|
||||
map.setPaintProperty(NODES_CLUSTER_LAYER_ID, "icon-opacity", enabled ? LIVE_DIM_OPACITY : 1);
|
||||
map.setPaintProperty(NODES_CLUSTER_LAYER_ID, "icon-opacity", enabled ? LIVE_CLUSTER_DIM_OPACITY : 1);
|
||||
map.setPaintProperty(NODES_CLUSTER_LAYER_ID, "text-opacity", enabled ? 0 : 1);
|
||||
}
|
||||
}, [mapRef, isReady, enabled, themeKey]);
|
||||
|
||||
Reference in new issue
Block a user