new module:FeaturesTable(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:
Classes
- FeaturesTable
- Allows to display a compact list of vector layer features labels
- FeaturesTable
Methods
addDragAndDropCapabilities()
Add drag&drop capabilities to the lizmap-features-table element
A request is sent when the order changes
- Source:
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:
buildColumns(properties) → {TemplateResult.<1>}
Build the columns of the table
Parameters:
Name | Type | Description |
---|---|---|
properties |
Object containing the properties of the feature |
- Source:
Returns:
The columns of the table
- Type
- TemplateResult.<1>
buildDisplayExpressionColumn(properties) → {TemplateResult.<1>}
Initialize tab with the first column "display_expression"
Parameters:
Name | Type | Description |
---|---|---|
properties |
object | Object containing the properties of the feature |
- Source:
Returns:
The first column of the table
- Type
- TemplateResult.<1>
buildLabels() → {TemplateResult.<1>}
Initialize the labels of the table
- Source:
Returns:
The labels of the table
- Type
- TemplateResult.<1>
getFeatures(layerId, filter, withGeometry, fields, additionalFields)
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 |
- 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.
isAdditionalFieldsEmpty() → {boolean}
Check if the additionalFields property is empty
- Source:
Returns:
True if the additionalFields property is empty
- Type
- boolean
isGeneralLabelExisting() → {boolean}
Check if the general label "display_expression" is existing
- Source:
Returns:
True if the general label "display_expression" is existing
- Type
- boolean
(async) load()
Load features from the layer and configured filter
- Source:
onItemClick(event, feature)
Display a popup when a feature item is clicked
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | Click event on a feature item |
feature |
Object | WFS feature |
- Source:
openPopup(layerId, feature, uniqueField, targetElement, aCallBack)
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 |
requestCallback | Callback function |
- Source:
render()
Render component from the template using Lit
- Source:
sortFeatures()
Sort the features array property
depending on the options
- Source:
verifyFields(listField) → {Array.<object>}
Verify if there's no fields with the same alias or expression
Parameters:
Name | Type | Description |
---|---|---|
listField |
Array.<object> | List of fields |
- Source:
Returns:
- List of verified fields
- Type
- Array.<object>