2

I've been designing some tilesets in Mapbox Studio Classic and I keep seeing the :: notation in styles that Mapbox has created.

What does that mean? Are there only specific values that can be put after it?

3

This is a concept known as attachments. While the notation is similar to CSS pseudo classes they do not have much in common.

The CartoCSS documentation offers an explanation.

To summarize, attachments create implicit layers with the same data as defined by #layerId. Here is a real-world example from OSM Bright:

#place::country[type='country'][zoom>3][zoom<9] {
  text-name:'[name]';
  ...
}

#place::state[type='state'][zoom>=5][zoom<=10] {
  text-name:'[name]';
  ...
}

This defines two attachments to the place layer named country and state. They share the same data of the place layer, but the type filter restricts styling to the specified type. Mapnik would first draw all country styles and then proceed to the state styles. This assures that no state label could block a country label when they share a common position (as country labels are commonly viewed as more important than state labels).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.