Update city radius values and add Miami; refine map styles and improve OpenSky code readability

This commit is contained in:
Kewonit
2026-02-14 16:39:17 +05:30
parent bea74cc70f
commit 0f8012361f
13 changed files with 4647 additions and 196 deletions

View File

@ -318,24 +318,17 @@ export function FlightLayers({
const ax = animFlight.longitude;
const ay = animFlight.latitude;
const curr = currSnapshotsRef.current.get(d.icao24);
const prev = prevSnapshotsRef.current.get(d.icao24);
const heading = ((animFlight.trueTrack ?? 0) * Math.PI) / 180;
const fdx = Math.sin(heading);
const fdy = Math.cos(heading);
if (curr && prev) {
// Direction from prev → curr
const fdx = curr.lng - prev.lng;
const fdy = curr.lat - prev.lat;
// Walk backward; collapse points that are ahead of the
// animated position (positive projection along flight dir)
for (let i = basePath.length - 1; i >= 0; i--) {
const vx = basePath[i][0] - ax;
const vy = basePath[i][1] - ay;
if (vx * fdx + vy * fdy > 0) {
basePath[i] = [ax, ay, alt];
} else {
break;
}
for (let i = basePath.length - 1; i >= 0; i--) {
const vx = basePath[i][0] - ax;
const vy = basePath[i][1] - ay;
if (vx * fdx + vy * fdy > 0) {
basePath[i] = [ax, ay, alt];
} else {
break;
}
}
basePath[basePath.length - 1] = [ax, ay, alt];