feat(globe): port to CeliumJS

This commit is contained in:
gili8420 2026-08-03 22:12:32 +09:00
parent ec03425067
commit eb7698e034
51 changed files with 3521 additions and 1992 deletions

View file

@ -27,7 +27,10 @@
import { pointsApi } from '$api';
import {
DEFAULT_FLIGHT_PARAMETERS,
MAX_LAUNCH_LATITUDE,
PROFILE_IDENTIFIERS,
clampLaunchLatitude,
wrapLongitude,
toFixedNumber,
type FlightParameters,
type ProfileIdentifier,
@ -75,7 +78,17 @@
function patchActive(patch: Partial<FlightParameters>) {
if (!active) return;
workspacesStore.setFlightParameters(active.id, { ...active.flightParameters, ...patch });
// Single choke point for launch latitude: typing it, clicking the map
// (updateLaunchPosition) and picking a saved point all land here, so one
// clamp covers every path.
const safe = { ...patch };
if (safe.launch_latitude !== undefined) {
safe.launch_latitude = clampLaunchLatitude(safe.launch_latitude);
}
if (safe.launch_longitude !== undefined) {
safe.launch_longitude = wrapLongitude(safe.launch_longitude);
}
workspacesStore.setFlightParameters(active.id, { ...active.flightParameters, ...safe });
}
function handlePointSelection(newPointId: number | null) {
@ -225,6 +238,8 @@
<Input
type="number"
step="0.000001"
min={-MAX_LAUNCH_LATITUDE}
max={MAX_LAUNCH_LATITUDE}
value={params.launch_latitude}
oninput={(e) =>
patchActive({