MapBox data places United States states' admin level on the same level as the division of countries within Europe and elsewhere (level 4). For my purposes, it is useful to display distinct boundaries for states in the US, while it is not useful at all to display them in Europe.
Is there a way to style these admin_level: 4 boundaries uniquely for each of these locations?
It is possible to apply unique per-country styles to administrative boundary lines if you are using the
mapbox.mapbox-streets-v6
vector tile source. (You can check and adjust this in the Layers panel of Mapbox Studio Classic.)In the
#admin
layer there is a field callediso_3166_1
that you can use to create a filter in CartoCSS. All of the admin level 4 boundaries in the US will have aiso_3166_1
code ofUS
, so create a style like this:Values of the
iso_3166_1
field will match the ISO 3166-1 alpha-2 standard. For boundaries that separate two countries, the code for each country will be included in alphabetical order and separated by a dash. Eg the US-Mexico border would beMX-US
.