Popups

Popups are used to display contextual information about hovered map features. This information may include text, attribute values, hyperlinks, images, and more.

You can configure the specific data shown in popups for each layer.

The Popups section, accessible via the icon, allows you to define both the content and display settings of popups.

1

Check this box to display popups in JMap NG apps.

2

Area for entering the popup content. The Popup content section provides details on this topic.

3

Available attributes for the popup. These are the layer attributes that you select in the Properties section.

4

Available popup functions. The Popup content section provides details on this topic.

5

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.

Popup content is defined using a text field that can combine static text with dynamic components called functions. When the popup is displayed, these functions are executed and replaced with their results.

Here are the functions available for popup configuration:

centroid()

Replaced by the coordinates of the geometric centroid of the element's geometry.

date()

Replaced by the current date and time.

elementId()

Replaced by the element identifier.

encode(attrib, encoding) attrib : the name of the attribute to encode encoding : the name of the encoding

Replaced by the value of the attrib attribute once it is encoded with the specified character encoding (UTF-8, CP437, ISO 8859-1, etc). Example encode(name, UTF-8) Replaced by the value of the name attribute encoded in UTF-8 characters.

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.

format(attrib, format) attrib: the name of a date or numerical attribute format: the desired date format

Replaced by a number or date that was formatted according to a specific format. Example format(date_insp, dd/MM/yyyy)

where date_insp is the name of an attribute containing a date and dd/MM/yyyy is the desired date format, as indicated in the documentation of the java.text.SimpleDateFormat Java class. Example format(attrib, ##0,00) where attrib is the name of an attribute containing a number and ##0,00 is the desired number format, as indicated in the documentation of the java.text.DecimalFormat Java class.

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.

lineLength()

This function is replaced by the length of a pointed line type element.

polygonArea()

This function is replaced by the area of a pointed polygon type element.

projectName()

This function is replaced by the name of the current project.

subString(attrib, startIx, endIx) attrib: the name of the attribute for which a part must be extracted. startIx: starting position in the character string. endIx: ending position in the character string.

This function is replaced by a portion of the value (as a character string) of the attrib attribute, between the startIx position and endIx position. Example subString(name, 0, 5) Replaced by the first five characters of the name attribute value. If this value is Montreal, the mouseover will display Montr.

userName()

This function is replaced by the user code of the user that is currently connected.

The attributes available for use in functions are shown in the Attributes section.

To configure tooltip content:

  1. Enter the static text.

  2. To insert dynamic content, place the cursor at the desired location in the text field.

  3. Click the function you want to use. It will be inserted automatically, and a menu of compatible attributes will appear.

  4. Select an attribute and add a value if applicable.

  5. Click to save the tooltip content.

Dernière mise à jour