Masking in Studio: Using high resolution administrative country polygons
Guest
No items found.
Jonni Walker
Guest
Jonni Walker
No items found.
Mapbox
October 15, 2020
Masking in Studio: Using high resolution administrative country polygons
Guest
No items found.
Jonni Walker
Guest
Jonni Walker
No items found.
Mapbox
October 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.
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
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.
Heading 2
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.
Heading 3
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.
Heading 4
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.
Heading 5
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.
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.
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque euismod maximus porta. Pellentesque vitae augue elit. Nam semper eros leo, nec hendrerit nunc aliquet quis. Morbi ac sapien tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Curabitur porta imperdiet lorem, ut aliquet orci pellentesque quis. Donec magna augue, molestie aliquam enim eu, auctor feugiat metus."