A modern Vue 3 application for visualizing 3D geospatial data using CesiumJS. This project features an interactive 3D globe with custom tileset rendering, smooth camera animations, and Azure Blob Storage integration for hosting large 3D datasets.
- ๐บ๏ธ Interactive 3D Globe - Full-featured Cesium viewer with terrain visualization
- ๐๏ธ Custom 3D Tilesets - Load and display large-scale 3D models from Azure Blob Storage
- ๐ฌ Cinematic Camera Animations - Smooth orbital camera movements with user interaction controls
- โ๏ธ Cloud-Hosted Assets - Efficient delivery of 3D tiles via Azure CDN
- ๐๏ธ Clean Interface - Minimalist UI with disabled unnecessary widgets
- โก Modern Tech Stack - Vue 3 with Composition API, Vite bundler, and ES modules
- Frontend: Vue 3 + Vite
- 3D Engine: CesiumJS
- Styling: CSS3
- Build Tool: Vite with static asset copying
- Hosting: GitHub Pages ready
- Asset Storage: Azure Blob Storage
- Node.js 18+
- npm or yarn
- A Cesium Ion account (free tier available)
- Git
git clone https://github.com/datasantana/cesium-map.git
cd cesium-mapnpm installCopy the environment template and configure your credentials:
cp .env.template .envEdit .env file with your actual values:
# Get your token from: https://ion.cesium.com/tokens
VITE_CESIUM_ION_ACCESS_TOKEN=your_cesium_ion_access_token_here
# URL to your hosted 3D tileset.json file
VITE_TILESET_URL=https://your-blob-storage.com/path/to/tileset.jsonnpm run devVisit http://localhost:5173 in your browser. You should see:
- A 3D globe loading with terrain
- Camera flying to Cali, Colombia
- Custom 3D tiles loading from your configured URL
- Automatic camera animation starting after 2 seconds
- Animation stops when you click anywhere on the map
- Go to Cesium Ion
- Create a free account
- Navigate to "Access Tokens"
- Create a new token or use the default one
- Copy the token to your
.envfile
npm run buildThe built files will be in the dist/ directory, ready for deployment.
cesium-map/
โโโ public/ # Static assets
โโโ src/
โ โโโ components/
โ โ โโโ CesiumComponent.vue # Main 3D viewer component
โ โโโ App.vue # Root application component
โ โโโ main.js # Application entry point
โโโ .env.template # Environment variables template
โโโ .env # Your environment variables (git-ignored)
โโโ vite.config.js # Vite configuration with Cesium setup
โโโ package.json # Dependencies and scripts
- Left click + drag: Rotate the camera
- Right click + drag: Pan the camera
- Mouse wheel: Zoom in/out
- Click anywhere: Stop automatic animation
- Camera automatically flies to Cali, Colombia on load
- 3D tiles load from Azure Blob Storage
- Smooth transition to orbital animation after 2 seconds
- Orbital animation showcases the 3D model from all angles
- Animation stops on any user interaction
Edit the coordinates in CesiumComponent.vue:
const flyToCali = async (viewer) => {
viewer.camera.flyTo({
destination: Cartesian3.fromDegrees(
-76.5410942407, // Longitude
3.4300127118, // Latitude
1500 // Height in meters
),
// ... orientation settings
});
};Modify the animation settings:
const startCameraRotation = (cesiumViewer) => {
const rotationSpeed = 0.05; // Adjust rotation speed
const orbitRadius = 0.005; // Adjust orbit size
const height = 1500; // Adjust camera height
// ...
};This project is configured for automatic deployment to GitHub Pages using GitHub Actions.
-
Configure Repository Secrets:
- Go to your GitHub repository
- Navigate to
Settings>Secrets and variables>Actions - Add the following repository secrets:
VITE_CESIUM_ION_ACCESS_TOKEN: your_cesium_ion_token_here VITE_TILESET_URL: your_azure_blob_storage_url_here
-
Enable GitHub Pages:
- Go to repository
Settings>Pages - Under "Source", select
GitHub Actions - Save the settings
- Go to repository
-
Deploy:
- Push your code to the
mainbranch - GitHub Actions will automatically build and deploy
- Your site will be available at:
https://datasantana.github.io/cesium-map/
- Push your code to the
For other hosting services:
- Build the project:
npm run build - Deploy the
dist/folder to your hosting service - Ensure your hosting service supports single-page applications
- Ensure
.envfile is in the project root - Restart the development server after editing
.env - Check that variable names start with
VITE_
- Verify your tileset URL is accessible
- Check CORS settings on your Azure Blob Storage
- Ensure the tileset.json file is properly formatted
- Check browser console for WebGL errors
- Ensure your graphics drivers are up to date
- Try reducing the tileset quality or size
MIT License - feel free to use this project for your own applications.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
