0

I'm working in Mapbox Studio (Classic) and want to prevent labels from rendering more than once.

I'm using text-repeat-distance to prevent labels from showing more than once:

#Admin_level3_Boundary {
  line-width: 1;
  line-color: #aaa;

  [zoom>=8] {
    text-name: [AREANAME];
    text-face-name: @sans; 
    text-fill: #ccc;
    text-size: 8;
    text-avoid-edges: true;
    text-repeat-distance: 50000;
  }
}

According to the CartoCSS attributes outlined here, a high text-repeat-distance should do the trick. But it's not working:

Repeated labels

I've tried using text-min-distance and text-margin as well, but it causes other (non-repeat) labels to disappear if they are close by.

How can I prevent repeat labels from showing?

1

Polygons in Mapbox Studio Classic are often split between multiple vector tiles, which can make preventing repeated labels quite challenging, if not impossible. Many cartographers choose instead to create a separate point layer for their labels (this is how it's done in Mapbox Streets).

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.