The query_button [location] entries module exports the query_button method as default.
Requires
Methods
(async, inner) query(entry)
Will be called by the onclick event of the query_button element.
The entry.location.view
will be disabled.
Runs the entry.query
template with the provided entry.queryparams
.
The entry.host
defaults to the entry.mapview.host concatenated with the /api/query
path.
The location.layer will reload after the query response with the entry.reload
flag.
The entry values of fields in the entry.dependents
array will be synched after the query has been resolved.
The entry.alert
message will be displayed after the query has been resolved.
The entry.location.view
will be enabled by calling the updateInfo
element event.
Name | Type | Description |
---|---|---|
entry | infoj-entry | type:query_button infoj entry. |
Name | Type | Attributes | Description |
---|---|---|---|
entry.query | string | Query template. | |
entry.queryparams | Object | <optional> | Parameter for query in template. |
entry.host | string | <optional> | The host for the query. |
entry.alert | string | <optional> | Alert message after the query has responded. |
entry.reload | boolean | <optional> | Reload location.layer if true. |
entry.dependents | Array | <optional> | Reload dependent entry.field values. |
(inner) query_button(entry) → {HTMLElement}
mapp.ui.locations.entries.query_button(entry)
Returns a button element. The query(entry)
method will be called by the button onclick event.
{
"label": "Snap to Postal Sector",
"type": "query_button",
"query": "catchment_statistics_snap_to_postal_sector",
"queryparams": {
"id": true
},
"alert": "Query has executed!",
"reload": true,
"dependents": [
"geom_3857",
"perimeter",
"area"
]
}
Name | Type | Description |
---|---|---|
entry | infoj-entry | type:query_button infoj entry. |
Location view entry node.
- Type:
- HTMLElement