Repository navigation
feat(flights): follow a selected aircraft live, with a view of the ground below and a 3D model - #520
Merged
Merged
Conversation
…ound below and a 3D model Selecting an aircraft now opens a readout card in place of the popup and eases the camera to it. The card asks /api/aircraft/live for the aircraft's latest position every ten seconds and moves it on between fixes from its ground speed, track and climb rate, so the marker glides instead of jumping. No track line is drawn: the map shows a ring and the aircraft's live marker only. The card shows the ground beneath the aircraft from Esri World Imagery, or a 3D model of its type built from the ICAO type code. The satellite card's view below and model viewer become shared components (ViewBelow, ModelView) used by both cards.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Selecting an aircraft now takes the camera to it and follows it live. A readout card replaces the popup. Its position, altitude, speed, heading and climb rate update as the aircraft moves, alongside its route, type and registration.
As with the satellite card from #515, the card shows the ground beneath the aircraft from Esri World Imagery. A toggle switches to a 3D model of the aircraft's type.
No track line is drawn for the selected aircraft. The map shows a ring and its live marker.
Changes
Fly to and follow
sel-ac-ring,sel-ac-icon). It is filtered out of the flights layers so it is not drawn twice.Live position
/api/aircraft/live?icao24=returns the aircraft's latest position from adsb.lol, with adsb.fi as a fallback. Neither sends CORS headers, so the server asks on the page's behalf.src/lib/aircraft-live.ts). A fix is moved on for at most 90 seconds and then held where that leaves it, rather than guessing further. An aircraft on the ground is not moved./api/flight-route/api/aircraft.View below
SatelliteViewbecomesViewBelow, shared by both cards. For an aircraft it looks straight down from the aircraft's altitude, with its direction of travel at the top, and carries Esri's required credit.3D model
src/lib/aircraft-models.tsmaps an ICAO type code (A20N, B788, CRJ9, AT76, H60…) to one of 12 families: narrow-body, wide-body, four-engined, regional, rear-engined jet, turboprop, three kinds of light aircraft, helicopter, fighter and airlifter.ModelView, andSatelliteModelnow wraps it. three.js still loads the first time a model opens, and the WebGL context is released when it closes.CardBits.tsxholds what both cards share: field rows, compass points and the VIEW / 3D MODEL toggle.Testing
npx vitest run: 181 files, 1,839 tests passed. New tests cover:fixFromReadsb)npx tsc --noEmitis clean.eslintshows no new findings in the changed files;OsirisMap.tsxhas one error fewer than on master.next buildpasses.next start, a headless browser selected an Airbus A321neo and a Boeing 737-800 over Germany, and checked:🤖 Generated with SIMPLIFAI