This application allows users to explore antipodal points on a 3D globe using Mapbox GL JS and Go Fiber. When a user clicks on any point on the globe, the application calculates its antipodal point* and smoothly flies to that location.
Inspired by Neil deGrasse Tyson's explanation of antipodal points: Startalk Short Video
Antipodal points are two points on a sphere that are diametrically opposite to each other. On Earth, they are sometimes referred to as antipodes. If you were to draw a straight line from one point through the center of the Earth, it would emerge at the antipodal point.
- Interactive 3D globe using Mapbox GL JS
- Click on any point to fly to its antipodal location
- Display of starting and destination coordinates
- Smooth animation using Mapbox's flyTo effect
- Go 1.16 or later
- Mapbox API token
- Clone this repository:
git clone https://github.com/yourusername/antipodal-navigator.git && cd antipodal-navigator
-
Install dependencies:
go mod tidy
-
Get a Mapbox API token:
- Sign up at Mapbox
- Navigate to your account's tokens page
- Create a new token or use the default public token
- Set up your environment variables:
- Copy the
.env.example
file to.env
- Open
.env
and add your Mapbox token:MAPBOX_TOKEN=your_mapbox_public_key_here PORT=:3000
-
Set an environment var named DEV:
export DEV=1
-
Start the server:
go run main.go
-
Open a web browser and navigate to
http://localhost:3000
-
Click on any point on the globe to see the animation to its antipodal point!
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Neil deGrasse Tyson and Startalk for the inspiration
- Mapbox for their excellent mapping platform
- The Go Fiber team for the fast web framework