2

I have labels that are being cut off when rendered in Mapbox Studio. As I understand it there is a 256x256 tile that gets rendered and if the label text "bleeds" into another tile it may get cut off. Research led me to a 'buffer-size:' thing but that isn't making any difference whether I set it to 0, 512, or 60000.

Label-clipping

4

Buffers are now handled in the source project, not in the style project (in TileMill, one project controlled both data source and style; in MapBox Studio, they are now two different projects).

So, assuming you have access to the source file, click on the label layer, and under the configure tab increase Buffer Size to a number half the width of your widest label (or just estimate).

enter image description here

See the source quickstart, source manual, and styling labels doc.

Edit If large labels are still an issue even with increased buffer size, it's possible to shrink text size for labels with high letter counts using regex expressions in the selectors. Something like

@text-size: 22;

#label-layer{
    text-name: [name];
    text-size: @text-size;
    [name=~'^.{10,}$'] {
        text-size: @text-size * 0.8;
    }
    [name=~'^.{14,}$'] {
        text-size: @text-size * 0.6;
    }
}

See this answer to another question on conditional labeling.

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.