From 1b2fbe27ed4f2419438e8617e190a98b4d556ff5 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Mar 2026 19:37:34 +0100 Subject: [PATCH] Fix: Size-based dot radius for radio stations Restore d.size-dependent point radius so larger cities (more stations) show bigger dots like Radio Garden. Formula: radius = clamp(0.12, 0.45, 0.06 + size * 0.005) Zoom scaling also respects per-station size. Co-Authored-By: Claude Opus 4.6 --- web/src/plugins/radio/RadioTab.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/src/plugins/radio/RadioTab.tsx b/web/src/plugins/radio/RadioTab.tsx index a86c092..06f7af8 100644 --- a/web/src/plugins/radio/RadioTab.tsx +++ b/web/src/plugins/radio/RadioTab.tsx @@ -64,7 +64,6 @@ const THEMES = [ // ── Zoom scaling constants ── const BASE_ALT = 2.0; -const BASE_RADIUS = 0.18; // ── Component ── export default function RadioTab({ data }: { data: any }) { @@ -216,7 +215,7 @@ export default function RadioTab({ data }: { data: any }) { .pointLat((d: any) => d.geo[1]) .pointLng((d: any) => d.geo[0]) .pointColor(() => `rgba(${initRgb}, 0.85)`) - .pointRadius(BASE_RADIUS) + .pointRadius((d: any) => Math.max(0.12, Math.min(0.45, 0.06 + (d.size ?? 1) * 0.005))) .pointAltitude(0.001) .pointResolution(24) .pointLabel((d: any) => @@ -250,7 +249,10 @@ export default function RadioTab({ data }: { data: any }) { if (Math.abs(alt - lastAlt) / lastAlt < 0.05) return; lastAlt = alt; const scale = Math.sqrt(alt / BASE_ALT); - globe.pointRadius(() => BASE_RADIUS * Math.max(0.15, Math.min(2.5, scale))); + globe.pointRadius((d: any) => { + const base = Math.max(0.12, Math.min(0.45, 0.06 + (d.size ?? 1) * 0.005)); + return base * Math.max(0.15, Math.min(2.5, scale)); + }); }; controls.addEventListener('change', onControlsChange);