An interactive web application that visualizes flight routes as great circle paths on a world map. Explore airports, view flight connections, and see the shortest paths between destinations.
🌐 Live Demo: https://gc-mapper-ai.vercel.app/
- Interactive World Map: Navigate and explore airports across the globe using Mapbox GL
- Great Circle Paths: Visualize flight routes as accurate great circle arcs (the shortest distance between two points on a sphere)
- Airport Markers: Click on any airport to view detailed information
- Flight Statistics: See departing, arriving, and total flight connections for each airport
- Smart Airport Lookup: Supports both IATA (3-letter) and ICAO (4-letter) airport codes
- Smooth Animations: Map smoothly pans and centers when selecting airports
- Responsive Design: Works seamlessly on desktop and mobile devices
- Framework: Next.js 16 with React 19
- Mapping: Mapbox GL JS via react-map-gl
- Geospatial Calculations: @turf/turf for great circle path calculations
- Styling: Tailwind CSS
- Data Processing: CSV parsing for airport and flight data
- Deployment: Vercel
The application processes flight data and airport information to:
- Load Airport Data: Parses airport information including IATA/ICAO codes, names, and coordinates
- Process Flight Routes: Converts flight data to unique routes and calculates great circle paths
- Normalize Airport Codes: Uses ICAO codes internally (unique 4-letter codes) while supporting multiple IATA codes per airport
- Render Visualizations: Displays airports as interactive markers and flight paths as curved lines on the map
- Node.js >= 22.0.0
- npm, yarn, pnpm, or bun
- Clone the repository:
git clone <repository-url>
cd gc-mapper-ai- Install dependencies:
npm install
# or
yarn install
# or
pnpm install- Set up environment variables:
Create a
.env.localfile in the root directory:
NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN=your_mapbox_token_hereGet your Mapbox access token from mapbox.com
- Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev- Open http://localhost:3000 in your browser
gc-mapper-ai/
├── app/
│ ├── mapbox/ # Map components
│ │ ├── airportMarkers.tsx # Airport markers and popups
│ │ ├── flightPaths.tsx # Great circle path rendering
│ │ ├── flightContext.tsx # Global flight data state
│ │ └── mapboxMap.tsx # Map container component
│ ├── openflights/ # Data parsing
│ │ ├── airports.csv # Airport database
│ │ ├── demo.csv # Flight data
│ │ ├── parseAirports.ts # Airport data parser
│ │ └── parseFlights.ts # Flight data parser
│ └── page.tsx # Main page
├── public/ # Static assets
└── README.md
Flight routes are displayed as great circle arcs, which represent the shortest distance between two points on the Earth's surface. This is how aircraft actually navigate long distances.
- IATA Codes: 3-letter codes (e.g.,
JFK,LAX) used for passenger-facing operations - ICAO Codes: 4-letter codes (e.g.,
KJFK,KLAX) used for air traffic control - The application uses ICAO codes internally for unique identification, while supporting multiple IATA codes that may map to the same airport (e.g.,
BSL,MLH,EAPall map to Basel-Mulhouse AirportLFSB)
Click on any airport marker to:
- View airport name and codes
- See flight connection statistics (departing, arriving, total)
- Access location coordinates
- Open Wikipedia or Google Maps links
npm run build
npm startThe application is configured for easy deployment on Vercel:
- Push your code to GitHub
- Import the project in Vercel
- Add your
NEXT_PUBLIC_MAPBOX_ACCESS_TOKENenvironment variable - Deploy!
The live version is available at https://gc-mapper-ai.vercel.app/
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.