# Labels

Labels are texts associated with map features. They are used to display information about features directly on the map. For example, you can use labels to show city names from a point layer representing urban areas.

The **Labels** section, accessible via the ![](https://3291879974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9n1KCuTyIKwSpZcPcC6l%2Fuploads%2F5Sqas23vDZ3Bf7WaIWol%2Fstudio-couche-etiquette.png?alt=media\&token=9f089d16-f8d2-48eb-bde4-bbcc084e71df), allows you to configure the content, style, and display settings of labels for the layer's features.

<figure><img src="https://3291879974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9n1KCuTyIKwSpZcPcC6l%2Fuploads%2FP5z0IZMUCzmEijUycZIF%2FEN-studio-etiquette.png?alt=media&#x26;token=65fe0bbc-c8e2-4bca-b2f6-74f73d8032fd" alt=""><figcaption></figcaption></figure>

<table data-header-hidden><thead><tr><th width="58" align="center"></th><th></th></tr></thead><tbody><tr><td align="center">1</td><td><strong>Activate labels</strong><br>Check this box to display labels by default in JMap NG.</td></tr><tr><td align="center">2</td><td><strong>Font</strong><br>Click this button to select the label text style: font, font size, bold, italic, font color, outline, and outline color.</td></tr><tr><td align="center">3</td><td>Area for writing the <strong>label content</strong>.<br>The <a href="#label-content">Label content</a> section provides details on this topic.</td></tr><tr><td align="center">4</td><td><strong>Attributes</strong><br>Available attributes for labels.<br>These are the layer attributes that you select in the <a href="layer-properties">Layer Properties</a> section.</td></tr><tr><td align="center">5</td><td><p><strong>Functions</strong></p><p>Functions available for labels. <br>The <a href="#label-content">Label content</a> section details these functions.</p></td></tr><tr><td align="center">6</td><td><strong>Zoom levels</strong><br>Zoom levels range at which labels are displayed.<br>Define the range by dragging the indicators on the bar or by entering the minimum and maximum zoom values ​​for the range.</td></tr><tr><td align="center">7</td><td><p><strong>Position</strong><br>Determine the position of the label relative to the element.<br>Click <img src="https://3291879974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9n1KCuTyIKwSpZcPcC6l%2Fuploads%2F9OOzt52ne4Lc9Y67NR1W%2Fstudio-couche-roue.png?alt=media&#x26;token=6749311a-869c-4017-b721-358008ba1473" alt=""> to select the position from the nine possible options.<br><br><strong>Allow overlapping</strong></p><p>Check the box to allow the labels of the layer to overlap the labels of other layers. This option can be useful to ensure that all labels of this layer are displayed.<br><br><strong>Follow the line</strong> <br>Only for line elements. Check the box to display the label text along the lines.<br><br><strong>Spacing (pixels)</strong><br>Only for line elements. Specify the spacing (in pixels) between repeated labels on the same line.</p></td></tr><tr><td align="center">8</td><td><strong>Offset (pixel)</strong><br>Set the offset in pixels and on both dimensions of the label's position relative to the element.</td></tr><tr><td align="center">9</td><td><strong>Frame</strong><br>Check the box to add a frame to the label text.<br>Select the background and countour color for the frame.</td></tr><tr><td align="center">10</td><td><strong>Rotation</strong><br>If you check <strong>Rotation using an attribute</strong>, select the numeric attribute whose values ​​will be used as the rotation angle and the rotation direction. Only for line elements.<br>If you check <strong>Follow map rotation</strong>, labels will follow the map rotation.</td></tr><tr><td align="center">11</td><td><strong>Proportional size</strong><br>By default, label text is always displayed at the specified font size, independently of the zoom level of the map. <br>Check this option to have the label text size adjusted proportionally to the zoom level of the map. <br>Drag the point in the bar to select the reference zoom level at which text is displayed at the specified font size.<br> When the zoom level of the map changes, the text size is modified accordingly.</td></tr><tr><td align="center">12</td><td>Click on the language of your choice to enter the label content in the selected language.</td></tr></tbody></table>

## Label Content

Labeling is done by defining the text that will appear as the label. This text can span multiple lines and contain:

* static content (unchanging),
* dynamic functions (variables), which are automatically replaced with their results when displayed.

The available **functions** are:&#x20;

<table data-header-hidden><thead><tr><th width="255"></th><th></th></tr></thead><tbody><tr><td>ev(<em>attrib</em>)<br><em>attrib</em> : the name of an attribute</td><td><p>This function is replaced by the value of the bound attribute whose name is passed as a parameter for the pointed element. <br><strong>Example</strong><br><code>ev(id)</code> </p><p>Label displays the value of the <em>id</em> attribute for this element.</p></td></tr><tr><td>ifNull(<em>attrib</em>, <em>value</em>)<br><em>attrib</em> : the name of the attribute to test<br><em>value</em> : the value to display if <em>attrib</em> is null</td><td>This function is replaced by the <em>value</em> value only if the value of the <em>attrib</em> attribute is null. <br>If the attribute value is not null, nothing is displayed. <br><strong>Example</strong> <br><code>ifNull(temp, N/A)</code> <br>Displays N/A if the value of the <em>temp</em> attribute is null. <br><strong>Example</strong> <br><code>ifNull(attrib_a, attrib_b)</code> <br>Displays the value of the <em>attrib_b</em> attribute if the value of the <em>attrib_a</em>attribute is null.</td></tr><tr><td>ifNotNull(<em>attrib</em>, <em>value</em>)<br><em>attrib</em> : the name of the attribute to test<br><em>value</em> : the value to display if <em>attrib</em> is not null</td><td>This function is replaced by the <em>value</em> value only if the value of the <em>attrib</em> attribute is not null. <br>If the attribute value is null, nothing is displayed. <br><strong>Example</strong> <br><code>ifNotNull(land_value, $)</code> <br>Displays $ only if the value of <em>land_value</em> is not null.</td></tr></tbody></table>

The usable attributes are shown in the **Attributes** section.

**To configure label content**:

1. Enter the desired static text.
2. To insert dynamic content, place the cursor at the appropriate position in the text area.
3. Click the function you want to use. It will be added instantly, and a menu will appear showing the available attributes for that function.
4. Select the attribute and enter a value if needed.
5. Click <img src="https://3291879974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9n1KCuTyIKwSpZcPcC6l%2Fuploads%2FNK6sBJK6PdVqpPdG3kc6%2Fstudio-ok.png?alt=media&#x26;token=fa22566b-2276-4fac-a226-f01feaf9dd87" alt="" data-size="line"> to save the label content.
