maps for developers

The (former) official Mapbox blog. See mapbox.com/blog for current content.

Follow publication

How to extrude vector terrain with hypsometric tints

--

By: Erin Quinn

Ever since Damon tweeted about extruding Mapbox vector terrain and applying hypsometric colors with Studio, I’ve been chomping at the bit to share how he did it.

Left: Mt. St. Helens | Right: The Grand Canyon

We’ll continue building upon your custom terrain styling by extending Tristen’s original style, Relief Shading, with a new data layer.

You can click here to start fresh with the Relief canvas or head to https://www.mapbox.com/studio/styles to open your custom version. Let’s 🤘.

Adding a Contour data layer

Inside the Studio Style Editor, we’ll start by adding a new layer -

In the upper left, click + Layer then Click to select a source to see a list of available sources. Within the Vector Terrain V2 category, choose the Contour tileset.

Now set the Type as Fill extrusion in the highlighted dropdown menu, then Create layer.

If you’re interested in learning more about the data within the contour layer, check out the features in the Mapbox Terrain vector style source, https://www.mapbox.com/vector-tiles/mapbox-terrain/#contour.

Set the height value of the contour layer to be data driven

To focus on our contour layer, let’s hide the hillshading layer by selecting it, then clicking the hide button in your toolbar. I also brought my contour layer to the top of the list (and hierarchy order). You can do this by hovering over an individual layer, clicking the hamburger menu, and dragging the the layers in any order you like -

Set the field to ele as well as adding a stop of 6000 | 6000 meters:

Set the colors of the contour layer to be data driven

If you hover over an individual layer you’ll see a hamburger menu that allows you to re-arrange the layers in any order you’d like:

You’ll need to zoom down on your map to zoom level 11 or 12 to see the contour layer, but as just a single color it won’t make much sense — let’s start assigning values to the color property by clicking value options and set value by data:

Now we have the chance to add stops by any increment of your choice to represent distinct bands of elevation heights. Each of these can have unique fill color on a value based ramp, ele (elevation). You’ll adjust the color for each elevation by clicking the dot like this:

Here’s a look at Damon’s color choices:

Customize, and share!

From here, you get to customize the colors and elevation bands completely to your liking, take amazing screenshots, share on twitter with the hashtag #mapwithmapbox.

Pro tips:

  • Zoom out your browser window
  • Use Control and pan the map to adjust the pitch
  • Use the search box to jump to a mountainous region like “Snowbird, Utah” or “Kilimanjaro”

I’ll end with a few of my examples:

Stuck? Reach out to @Mapbox on twitter at any time!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Unlisted

--

--

Written by Mapbox

mapping tools for developers + precise location data to change the way we explore the world

Responses (3)

Write a response