This project demonstrates how to set up a Cesium globe with an access token using HTML and JavaScript on the client side and a Flask server on the server side for backend operations. The access token is kept in a separate configuration file for security and flexibility.
Follow these steps to set up and run the client part of the project:
-
Clone or download this repository to your local machine.
-
Navigate to the
clientdirectory in your code editor. -
Create a
config.jsfile in theclientdirectory and add your Cesium access token.let cesiumAccessToken = 'your token here';
-
Make sure you have Node.js installed on your machine. If not, you can download it from the official website. Execute the below command to install
http-serverglobally.npm install -g http-server
-
Open your terminal/command prompt and navigate to the
clientdirectory. -
Start the server by running:
http-server
-
Open your web browser and go to
http://127.0.0.1:8080to see the Cesium globe with your access token in action.
- The globe allows you to click on it to add pins at specific locations.
- Hovering over a pin displays information about the location.
- You can customize the pins, appearance, and functionality as needed in the JavaScript code.
- The access token is stored in the
config.jsfile for security. You can create your own in the home directory and access it.
Follow these steps to set up and run the server part of the project:
-
Navigate to the
serverdirectory. -
Make sure you have Python and pip installed on your machine.
-
Install the necessary Python packages using:
pip install -r requirements.txt
-
Run the
main.pyscript to start the server.python main.py
- If you encounter issues, you may want to ensure that all dependencies are correctly installed and that the server is running properly.
- For client-side issues, clear your browser cache or use an incognito/private browsing window to ensure your changes take effect.
This project makes use of below external APIs:
- Cesium: Used for the 3D globe rendering on the client side. Cesium provides an interactive globe platform which can be used to visualize spatial data.
- OpenCage: Utilized for geocoding services. OpenCage offers an API that provides forward and reverse geocoding.
- Wikipedia API: Used for fetching detailed information for the server side. The Wikipedia API allows access to various features of Wikipedia content.
