Class: module:js

module:js(initialConfig, lizmap3)

new module:js(initialConfig, lizmap3)

Create a features table instance

Parameters:
Name Type Description
initialConfig Config

The lizmap initial config instance

lizmap3 object

The old lizmap object

Source:

Methods

addMessage(message, type, duration)

Display a lizMap message

Parameters:
Name Type Default Description
message string

Message to display

type string info

Type : error or info

duration number 60000

Number of millisecond the message must be displayed

Source:

getFeatures(layerId, filter, withGeometry, fields, additionalFields, limit, sortingField, sortingOrder) → {Promise}

Get the list of features containing the display expression

Parameters:
Name Type Default Description
layerId string

The QGIS layer ID

filter string | null null

An QGIS expression filter

withGeometry boolean false

If we need to get the geometry

fields string | null null

List of field names separated by comma

additionalFields object | Array

JSON object with the field names and expressions

limit number 1000

Number of features to return

sortingField string | null null

Field name to sort the features

sortingOrder string | null null

Sorting order

Source:
Throws:
  • In case of invalid content type (not application/json or application/vnd.geo+json) or invalid JSON

    Type
    ResponseError
  • In case of not successful response (status not in the range 200–299)

    Type
    HttpError
  • In case of catch exceptions

    Type
    NetworkError
Returns:

— A Promise that resolves with the result of parsing the response body text as JSON.

Type
Promise

openPopup(layerId, feature, uniqueField, targetElement, aCallBack) → {null|void}

Open a Lizmap Popup

Parameters:
Name Type Description
layerId string

QGIS layer ID

feature object

WFS Feature

uniqueField string

Field containing unique values (used to set the filter for the WMS request)

targetElement HTMLElement

Target HTML element to display the popup content for the given feature

aCallBack function

Callback function

Source:
Returns:

Return null if the layerId is not in the configuration

Type
null | void