aWhere Manual
UseMap Studio

Add labels

Show a value from a field, such as a station name, on or beside each feature

A label is a Text style. You set it in the Styles tab, the same place as the other styles. See Set a layer's style.

Add a label

  1. Click the layer name, then open the Styles tab.
  2. Click Add a style, then choose Text.
  3. In the Label or expression box, type text, or put a field name in curly braces, such as {name} or PM2.5: {pm25}. See Choose a field.
  4. Set the Size and the Text color.

Choose a field

You do not have to type the field name yourself. Click the button at the end of the Label or expression box.

  • A layer from Drive opens the Expression builder window. Click the plus sign on a field under Add fields, then click Done.
  • A layer from tiles, such as PM tiles or vector tiles, lists the field names in the tile. Click the name you want and it is added to the end of the label.

If you choose a field from Drive, the box shows a short code, such as {zs7lcT9f}, instead of the field name. You do not need to change it. The map still shows the value correctly.

Where the label goes

Placement has the same choices as a marker. See Marker. If you choose Line on a line layer, the text runs along the line.

Size and colour

  • Open Typography and set Wrap width. Text longer than this goes onto a new line. If you do not want it to wrap, enter 0.
  • Open Size & position to set Opacity, Dx, Dy, Horizontal alignment, Vertical alignment and Rotation.

Halo

Open Halo to put an outline around the letters. This makes them easier to read on a busy background. Then set the Halo color, Halo opacity and Halo radius. If you do not want an outline, enter a size of 0.

Fonts on the map

Every label uses the Noto Sans font, which has both Thai and English letters. So choosing a Font or a Style does not change how the letters look on the map. If you want bold text, set Weight to bold, bolder or a number of 600 or more.

  • If the map has a MapLibre Style layer, labels use that style's fonts instead.
  • If the computer cannot reach protomaps.github.io, labels do not show, because the map loads its fonts from that site.

On this page