Cesium Guess
Introduction Welcome to Cesium Guess, an interactive web application that challenges you to guess locations on a map. This project leverages powerful mapping technologies to provide an engaging and educational experience. In this blog post, we'll explore what Cesium Guess does, the technologies it uses, and how you can get started with it. What is Cesium Guess? Cesium Guess is a web-based game where players are presented with a random location in Switzerland and must guess where it is on the map. The game provides a fun way to test and improve your geographical knowledge of Switzerland. After making a guess, the game shows the actual location and the distance between your guess and the correct location. Key Features Random Location Generation: The game uses a random position generator to place the camera at a random location within Switzerland. Interactive Map: Players can interact with the map to make their guesses. Distance Calculation: After guessing, the game calculates and displays the distance between the guessed location and the actual location. Responsive Design: The game is designed to work seamlessly on various devices, including desktops and mobile devices. Technologies Used Cesium Guess is built using a combination of modern web technologies and powerful mapping libraries. Here are the key technologies used in this project: CesiumJS CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin. It provides the core functionality for rendering the 3D globe and handling interactions. CesiumWidget: The main component for rendering the 3D globe. ImageryLayer: Used to display map imagery. CesiumTerrainProvider: Provides terrain data for the globe. OpenLayers OpenLayers is a high-performance, feature-packed library for creating interactive maps. It is used in this project to handle the 2D map interactions. Map: The main component for rendering the 2D map. TileLayer: Used to display map tiles. VectorLayer: Used to display vector data, such as points and lines. Turf.js Turf.js is a JavaScript library for spatial analysis. It is used in this project to generate random positions and check if they are within Switzerland's boundaries. randomPosition: Generates random geographical positions. booleanPointInPolygon: Checks if a point is within a polygon. bbox: Calculates the bounding box of a polygon. Vite Vite is a build tool that provides a fast development environment and optimized build process. It is used to bundle and serve the application. Web Components The project uses Web Components for creating reusable UI elements, such as the compass bar and dialog boxes. Getting Started To get started with Cesium Guess, follow these steps: Clone the Repository: Clone the project repository from GitHub. git clone https://github.com/fredj/cesium-guess.git cd cesium-guess Install Dependencies: Install the required dependencies using npm. npm install Run the Development Server: Start the development server using Vite. npm run start Open the Application: Open your web browser and navigate to http://localhost:3000 to start playing the game. Conclusion Cesium Guess is a fun and educational project that combines modern web technologies with powerful mapping libraries. Whether you're a geography enthusiast or just looking for a fun way to pass the time, Cesium Guess offers an engaging experience. We hope you enjoy playing the game and exploring the beautiful landscapes of Switzerland! For more information and to try the online demo, visit the Cesium Guess GitHub page. Happy guessing!

Introduction
Welcome to Cesium Guess, an interactive web application that challenges you to guess locations on a map. This project leverages powerful mapping technologies to provide an engaging and educational experience. In this blog post, we'll explore what Cesium Guess does, the technologies it uses, and how you can get started with it.
What is Cesium Guess?
Cesium Guess is a web-based game where players are presented with a random location in Switzerland and must guess where it is on the map. The game provides a fun way to test and improve your geographical knowledge of Switzerland. After making a guess, the game shows the actual location and the distance between your guess and the correct location.
Key Features
- Random Location Generation: The game uses a random position generator to place the camera at a random location within Switzerland.
- Interactive Map: Players can interact with the map to make their guesses.
- Distance Calculation: After guessing, the game calculates and displays the distance between the guessed location and the actual location.
- Responsive Design: The game is designed to work seamlessly on various devices, including desktops and mobile devices.
Technologies Used
Cesium Guess is built using a combination of modern web technologies and powerful mapping libraries. Here are the key technologies used in this project:
CesiumJS
CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin. It provides the core functionality for rendering the 3D globe and handling interactions.
- CesiumWidget: The main component for rendering the 3D globe.
- ImageryLayer: Used to display map imagery.
- CesiumTerrainProvider: Provides terrain data for the globe.
OpenLayers
OpenLayers is a high-performance, feature-packed library for creating interactive maps. It is used in this project to handle the 2D map interactions.
- Map: The main component for rendering the 2D map.
- TileLayer: Used to display map tiles.
- VectorLayer: Used to display vector data, such as points and lines.
Turf.js
Turf.js is a JavaScript library for spatial analysis. It is used in this project to generate random positions and check if they are within Switzerland's boundaries.
- randomPosition: Generates random geographical positions.
- booleanPointInPolygon: Checks if a point is within a polygon.
- bbox: Calculates the bounding box of a polygon.
Vite
Vite is a build tool that provides a fast development environment and optimized build process. It is used to bundle and serve the application.
Web Components
The project uses Web Components for creating reusable UI elements, such as the compass bar and dialog boxes.
Getting Started
To get started with Cesium Guess, follow these steps:
- Clone the Repository: Clone the project repository from GitHub.
git clone https://github.com/fredj/cesium-guess.git
cd cesium-guess
- Install Dependencies: Install the required dependencies using npm.
npm install
- Run the Development Server: Start the development server using Vite.
npm run start
-
Open the Application: Open your web browser and navigate to
http://localhost:3000
to start playing the game.
Conclusion
Cesium Guess is a fun and educational project that combines modern web technologies with powerful mapping libraries. Whether you're a geography enthusiast or just looking for a fun way to pass the time, Cesium Guess offers an engaging experience. We hope you enjoy playing the game and exploring the beautiful landscapes of Switzerland!
For more information and to try the online demo, visit the Cesium Guess GitHub page.
Happy guessing!