Location
A location is associated with the features that make up a layer. It is possible to get a location from the XYZ Location API by sending a request providing the locale, layer, and a location's unique ID.
.infoj_skip[]
The infoj_skip array allows you to define a list of keys, fields, or queries to be skipped from the infoj of that layer.
"infoj_skip": [
"field_to_skip",
"key_to_skip",
"query_to_skip"
].infoj_order[]
The infoj_order array can be defined as a list of lookup keys and entry objects.
"infoj_order": [
{
"type": "dataview",
"dataview": "tabulator",
"target": "tabview",
"query": "query_template",
"table": {
"layout": "fitColumns",
"columns": [],
"autoColumns": true
}
},
"entry_key",
"char_field",
"textarea"
]Key strings will be used to lookup entries in the location layer infoj array for matching key, field, or query key values. This allows for the sorting and filtering of infoj entries.
Entry objects in the infoj_order will be spliced and decorated with the location object in place.
.edit{}
Editing is possible on locations, so the user could for instance alter a field name, add a comment or move a geometry and this would be stored to the database.
Adding toggleLocationViewEdits: true will add a spanner to the location entry that can be toggled for editing.
This is particularly useful if any of your fields use formatting or fieldfx.
This should be used as the default as it is much neater for the user.
It is also possible to edit field values within a location, and save these to the database.
"edit": true.placeholder
If configured a placeholder will be set on the edit input element where available (eg. text, textarea, options)
"edit": {
"placeholder": "Select from list",
"options": ["A", "B"]
}Options
Three options here:
- Provide defined options
"edit": {
"options": ["A", "B"]
}- Provide empty options array
This will then use thedistinct_valuestemplate to get all values from the field on the table as provide them.
"edit": {
"options": []
}- Provide query
This will then run the provided query to get the values for the options.
This query must in theworkspace.templatesobject.
"edit": {
"query": "edit_options",
"options": []
}Modifying Geometry
If you wish to edit geometry, then we must specify this in the edit object.
"infoj": [
{
"type": "geometry",
"display": true,
"field": "geom_p_4326",
"fieldfx": "ST_asGeoJSON(geom_p_4326)",
"edit": {
"geometry": true
}
}
]delete_label
- Providing an
edit.delete_labelwill provide a custom label to the 'Delete Geometry' button.
"edit": {
"geometry": true,
"delete_label": "Delete Site Geometry"
}modify_label
- Providing an
edit.modify_labelwill provide a custom label to the 'Modify Geometry' button.
"edit": {
"geometry": true,
"modify_label": "Move Site"
}.dependents
Dependents allow us to set certain fields to be updated when another is edited.
For instance, if the user can edit type: geometry we may wish to set the type: pin as a dependent, so that the pin is always shown in the correct location.
We also set dependents on a field that is not editable by the user, but will be edited via a trigger on the database side.
Here you can provide an array of field values that you wish to reload upon changes to the field in question.
{
"type": "geometry",
"display": true,
"field": "geom_p_4326",
"fieldfx": "ST_asGeoJSON(geom_p_4326)",
"dependents": ["pin","field_1","field_2"],
"edit": {
"geometry": true
}
},