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:
parent
a923463f83
commit
1b2fbe27ed
1 changed files with 5 additions and 3 deletions
|
|
@ -64,7 +64,6 @@ const THEMES = [
|
||||||
|
|
||||||
// ── Zoom scaling constants ──
|
// ── Zoom scaling constants ──
|
||||||
const BASE_ALT = 2.0;
|
const BASE_ALT = 2.0;
|
||||||
const BASE_RADIUS = 0.18;
|
|
||||||
|
|
||||||
// ── Component ──
|
// ── Component ──
|
||||||
export default function RadioTab({ data }: { data: any }) {
|
export default function RadioTab({ data }: { data: any }) {
|
||||||
|
|
@ -216,7 +215,7 @@ export default function RadioTab({ data }: { data: any }) {
|
||||||
.pointLat((d: any) => d.geo[1])
|
.pointLat((d: any) => d.geo[1])
|
||||||
.pointLng((d: any) => d.geo[0])
|
.pointLng((d: any) => d.geo[0])
|
||||||
.pointColor(() => `rgba(${initRgb}, 0.85)`)
|
.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)
|
.pointAltitude(0.001)
|
||||||
.pointResolution(24)
|
.pointResolution(24)
|
||||||
.pointLabel((d: any) =>
|
.pointLabel((d: any) =>
|
||||||
|
|
@ -250,7 +249,10 @@ export default function RadioTab({ data }: { data: any }) {
|
||||||
if (Math.abs(alt - lastAlt) / lastAlt < 0.05) return;
|
if (Math.abs(alt - lastAlt) / lastAlt < 0.05) return;
|
||||||
lastAlt = alt;
|
lastAlt = alt;
|
||||||
const scale = Math.sqrt(alt / BASE_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);
|
controls.addEventListener('change', onControlsChange);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue