Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NameDescription
formatLatLng(latitude, longitude)

Format lat/lng into a readable string with decimal degrees.

Example: {formatLatLng(properties.begin_latitude, properties.begin_longitude)}

formatGeometry(geometry)

Format the GeoJSON geometry and display it as human-readable coordinates. Works only for POINT geometries.

Example: {formatGeometry(geometry)}

addFilterButton(name, value)

Add a button to request filtering by an attribute.

Example: {addFilterButton("platform", properties.platform)}

formatDate(isoDateString)

Improve ISO timestamp readability.

Example: {formatDate(properties.date_time_start)}

formatUnit(value, unit, targetUnit (optional), precision (optional))

Improve the readability of numbers by simplifying their representation with a unit prefix.

Example: {formatUnit(properties["mediainfo.media.track.Video.BitRate"], "bit/s")} 

isDefined(valueToCheck, then, else)

Return the given string only if the first value is not null or undefined. Used as a way to implement conditions. Uses the optional else value if valueToCheck is null or undefined.

Example: {isDefined(properties.date_time_end, "Date Time Start", "Date Time")}

concatIfDefined(concat1, concat2, ...)

Concatenate values if each value is defined (not null or undefined).

Example: {concatIfDefined(properties.elevation, " m")}

encodeURLComponent(urlComponent)

Encode a string to URL-compatible characters.

Example: {encodeURLComponent("PS133/2_0_Underway-6")}

round(number, decimals)

Round a number to the specified decimal places.

Example: {round("1.12345", "3")}

splitString(string, substring, index)

Split a string at a substring and return the given index.

Example: {splitString("Hello World", " ", "1")}

substring(string, startIndex, endIndex)

Split a string at an index and get the substring.

Example: {substring("Hello World", "0", "5")}

setTitle(str1, str2, ...)

Define the title in data-title for the entire popup feature. The PopupRenderer will extract the title from this property to display it in the header. This is set directly in the container.

Example: {setTitle("Event: ", properties.event)}

parseJSON(jsonstring, key1, key2, ...)

Parse a JSON string and return the value of the given property identified by the list of keys.

Example: {parseJSON('{"outer": {"inner": "Hello World"}}', "outer", "inner")}

noCopy()

Prevent the copy button from being displayed in a table row.

hideOnSiteStart(site)
hideOnSiteEnd(site)

Prevent content from being rendered by inserting a comment when the page matches. These functions must be used together to mark an area to be removed.

Example: {hideOnSiteStart("gallery")} ...... {hideOnSiteEnd("gallery")}

parseMarkdown(text)

Parse Markdown text to HTML. Useful when text from an attribute/property is formatted as markdown.

Example: {parseMarkdown(layer.abstract)}

joinArray(array, seperator)

Join array values as a string. Default separator is a comma ( , ).

Example: {joinArray(array, " - ")}

displayLayerLegend()

Display the active layer's legend graphic.

displayImage(src, width (optional), height (optional), srcset (optional))

Display an image. Clicking on an image opens it in a full-screen, zoomable lightbox.

Example: {displayImage(properties.picture, properties.width, properties.height, properties.srcset)}

displayVideo(media, width, height, thumbnail (optional), cover (optional), poster (optional))

Display a video in a video player. The following keys arguments are supported: "media" (URL to media file), thumbnail (URL to webvtt file for seekbar thumbnails), cover (URL to video cover) and poster (URL to background poster on video player loading). They contain the respective URLs.

Example: {displayVideo(properties.video, properties.width, properties.height, properties.thumbnail, properties.cover)}

displayVideoPlayerKeys()

Display a link to open the documentation of video player hotkeys.

...