Labels
Labels are text elements attached to map features. They are used to display information about it. For example, you can use labels to display city names for a point layer representing cities.
The Labels section, accessible via the icon, allows you to configure the content, style, and display of labels for the layer's elements.

1
Font Click this button to select the label text style: font size, bold, italic, font color, outline, and outline color.
2
Activate labels Check this box to display labels by default in JMap NG.
3
Area for writing the label content. The Label content section provides details on this topic.
4
Attributes Available attributes for labels. These are the layer attributes that you select in the Layer Properties section.
5
Functions
Functions available for labels. The Label content section details these functions.
6
Zoom levels Zoom level threshold at which labels are displayed. Select the threshold by dragging the indicators on the bar or by entering the minimum and maximum zoom values for the range.
7
Position
Determine the position of the label relative to the element.
Click to select the position from the nine possible options.
Allow overlapping
Check the box to allow the labels of the layer to overlap the labels of other layers. This can be useful to ensure that all labels of this layer are displayed. Follow the line Only for line elements. Check the box to display the label text along the lines. Spacing (pixels) Only for line elements. Set the labels spacing (in pixels) along the lines.
8
Offset (pixel) Set the offset in pixels and on both dimensions of the label's position relative to the element.
9
Frame Check the box to add a frame to the label text. Select the background and countour color for the frame.
10
Rotation If you check Rotation using an attribute, select the numeric attribute whose values will be used as the rotation angle and the rotation direction. If you check Follow map rotation, labels will follow the map rotation.
11
Proportional size By default, label text is always displayed at the specified font size, independently of the zoom level of the map. Check this option to have the label text size adjusted proportionally to the zoom level of the map. Drag the point in the bar to select the reference zoom level at which text is displayed at the specified font size. When the zoom level of the map changes, the text size is modified accordingly.
12
Click on the language of your choice to enter the label content in the selected language.
Label Content
Labeling is configured by specifying text that defines the label's content. Label text can span multiple lines.
The text can contain static and variable parts, such as functions. When displayed, the functions are executed and replaced with the result. Labels don't support HTML formatting or hyperlinks.
The following functions are available:
ev(attrib) attrib : the name of an attribute
This function is replaced by the value of the bound attribute whose name is passed as a parameter for the pointed element.
Example
ev(id)
Label displays the value of the id attribute for this element.
ifNull(attrib, value) attrib : the name of the attribute to test value : the value to display if attrib is null
This function is replaced by the value value only if the value of the attrib attribute is null.
If the attribute value is not null, nothing is displayed.
Example
ifNull(temp, N/A)
Displays N/A if the value of the temp attribute is null.
Example
ifNull(attrib_a, attrib_b)
Displays the value of the attrib_b attribute if the value of the attrib_aattribute is null.
ifNotNull(attrib, value) attrib : the name of the attribute to test value : the value to display if attrib is not null
This function is replaced by the value value only if the value of the attrib attribute is not null.
If the attribute value is null, nothing is displayed.
Example
ifNotNull(land_value, $)
Displays $ only if the value of land_value is not null.
The available attributes are displayed in the Attributes section.
To enter the label content:
Write the text for static content.
If you want to include dynamic content, position the cursor at the desired location within the content area and click to select the function you want to use. It is instantly added to the content area, and a menu of available attributes for the function is also displayed.
Select the attribute and add a value if applicable.
Click
to save the label content.
Dernière mise à jour