Masking in Studio: Using high resolution administrative country polygons

No items found.

Oct 15, 2020

Masking in Studio: Using high resolution administrative country polygons


No items found.


Oct 15, 2020

The new high resolution administrative country boundaries tileset is now available to all designers and developers using the new version of Studio, for free. This is the perfect tileset to use when highlighting individual countries through a masking technique. Masking is a cartographic term that describes hiding features on a map so that the geographic area of interest is the main visual area illustrated, limiting unnecessary visual clutter.

5 simple steps for masking countries in Studio

Step 1

In Studio, begin by creating a new blank style. Select the layers tab, and add the “Mapbox Satellite” layer.

Step 2

Next, add the “Mapbox Countries V1” layer. The default styling is black so don’t panic! This will be adjusted in the next step.

Step 3

Style the “Mapbox Countries V1” layer using a data condition on color. Use the “name” data field, type in “United States” and use the “select data” panel to search for your country of choice by clicking on the map.

Step 4

Once the “United States” is selected, give the colour a “0” value for opacity. The map should look like this:

Click done and make the fallback value white and full opacity. The map should show that all countries, except for the United States, are white.

Step 5

Add the Mapbox “Water” layer and style the fill colour white. 

And there we have it --  countries of interest are masked. Of course there is flexibility to style the country fallback value any colour we wish and match that styling to the water layer. Try different colours to best match the data visualization or web platform background color.

Adding surrounding geographical context

To add some subtle surrounding geographical context like country borders, simply duplicate the “Mapbox Countries V1” layer and this time we will change the style type to a line.

Go to “select data” and change the “type” to “Line”, as below: 

Make sure to move the new country layer to the top of the hierarchy by dragging it to the top. The example below has the line with a thinner width and coloured it grey. See the duplicated Country Boundary layer at the top of the hierarchy. 

Black and white satellite layer as a background context layer

In the example below, another satellite layer was added. Note its position in the hierarchy - below the water layer, but above the country boundaries layer. We have also given the layer a value of 0.4 for opacity and  dropped the saturation to -1.

We would love to see how designers use the new boundaries and different kinds of masks. Share new designs on Twitter with #BuiltWithMapbox.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Block quote

Ordered list

  1. Item 1
  2. Item 2
  3. Item 3

Unordered list

  • Item A
  • Item B
  • Item C

Text link

Bold text




No items found.
No items found.

Related articles