Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Create a Spinning 3D Globe Map Without Writing Any Code

You have probably seen spinning globe animations on social media showing satellite imagery, land cover, or population data rotating smoothly in 3D. They look impressive, but you might assume they require custom code or specialized software. They do not. In this tutorial, I show you how to create a spinning 3D globe with raster and vector data overlays using a simple web-based tool. The entire process runs in your browser, and you can also reproduce it in a Jupyter Notebook environment.

Video tutorial: Create a Spinning 3D Globe Map Without Writing Any Code

What You Will Need

Open the Web Demo

  1. Go to ts.anymap.dev.

  2. Click Live Examples on the homepage. You will see a gallery of examples organized by mapping library.

  3. Under the MapLibre section, click the Control Grid example. This opens a globe view with two sample data layers already loaded: USGS imagery and ESA Global Land Cover.

You can toggle layers on and off using the layer control in the upper right corner. Try turning off the background basemap and keeping just the two data layers to see how they look on the globe by themselves.

Add Data Layers

The toolbar provides icons for adding different types of data. To add raster data, click the tile layer icon. You can add any XYZ or WMS tile layer by pasting its URL. The tool includes presets to get you started:

To add a layer, select it from the list and click Add Layer. You can stack multiple raster layers and reorder them in the layer panel.

Start the Spinning Globe

  1. Click the toolbar icon (the two-bar icon) to open the globe controls.

  2. Click the spinning globe icon. A dialog will appear with a speed slider.

  3. Click Start to begin the rotation. The default speed works well for most cases, but you can adjust it while the globe is spinning. A speed of around 30 degrees per second provides a smooth, watchable rotation. Going higher (60 degrees per second) creates a faster effect, while lower values give a more gradual spin.

Before starting the spin, you can adjust the camera angle by dragging the globe and zooming in or out. Find the angle that best showcases your data, then click Start.

Add Vector Data

The tool also supports vector data. Click the point/line/polygon icon in the toolbar to open the vector data panel. From here you can:

  1. Select a data source. The tool supports GeoParquet and other common vector formats. You can paste a URL pointing to your data file.

  2. Once the data loads, choose a column for classification. For example, if you load a hexagonal H3 dataset of global building density, you can classify by building count.

  3. Select a classification scheme. Quantile is a good default because it distributes features evenly across categories.

  4. Choose a color palette. Options include Inferno, Viridis, and many others.

  5. Optionally disable polygon outlines for a cleaner look.

  6. Click Add Choropleth Map to render the data on the globe.

3D Extrusion

The vector data panel includes a 3D Extrusion checkbox. Enabling it before adding your choropleth map will render each polygon as a 3D column whose height corresponds to the data value. This creates a dramatic visualization where, for example, areas with high building density rise above the globe surface. You can rotate and zoom to explore the 3D features from different angles.

Note that 3D rendering on top of the MapLibre basemap can produce minor visual artifacts when rotating the globe. This is a known limitation of the 3D rendering engine, but it does not affect the data or the overall visualization.

Customize the Appearance

Several options let you refine how your globe looks:

Use the Swipe Tool

The tool includes a swipe comparison feature for comparing two data layers side by side on the same globe:

  1. Click the swipe tool button in the toolbar.

  2. Select the layer for the left side (for example, Sentinel-2 false color composite).

  3. Select the layer for the right side (for example, ESA land cover).

  4. Click Activate.

A vertical divider appears on the globe. Drag it left or right to reveal each layer. This is useful for comparing satellite imagery against derived products like land cover maps. You can zoom into any location and continue using the swipe tool at any scale.

Use It in a Jupyter Notebook

If you prefer working in a notebook environment, the same functionality is available through the anymap Python package:

  1. Go to ts.anymap.dev and scroll down to the MapLibre section.

  2. Click the Control Grid example.

  3. Click the notebook.link to open the notebook directly in your browser. No local installation is needed since it runs in a virtual environment within the browser.

The notebook code is minimal:

from anymap import maplibre

m = maplibre.Map()
m.add_control_grid()
m

This creates the same interactive map you saw in the web demo, complete with all the toolbar buttons for adding data layers, toggling the spinning globe, and using the swipe tool. The anymap package is lightweight with few dependencies.

Resources

Everything shown in this tutorial is freely available. You do not need to install anything on your computer - all you need is a web browser with internet access. If you run into any issues, feel free to submit them on the GitHub repository. Give it a try and share your spinning globe creations!