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 <noreply@anthropic.com>
This commit is contained in:
Daniel 2026-03-06 19:37:34 +01:00
parent a923463f83
commit 1b2fbe27ed

View file

@ -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);