| type | Workspace Key | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| title | Layer data source | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description | Keys that tell the XYZ API where a layer's data is, which ID and geometry to use and how queries are restricted; use for every data layer. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| resource | ../../../apps/xyz/mod/query.js | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tags |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| status | draft | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| x-xyz-keys |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sources |
|
These keys connect a layer to a table. The XYZ API reads them from the workspace layer and fills the matching query params with them.1
dbsnames the connection, aDBS_*environment variable. Without it the layer uses the locale's, then the workspace'sdbs.2tableis the schema-qualified table, eg.geodata.uk_glx_open_retail_points.geomis the geometry column andsridits EPSG code, best as a string such as"4326".qIDis the unique ID column; locations are requested by it.paramsare sent with every layer data request:templatereplaces the format's default query template,viewportrestricts queries to the map extent,zsends the current zoom, anddefault_fieldsadds columns to the features.layer_templatenames a workspace template which the XYZ API loads as the layer for queries, instead of the layer itself.1 Other params are passed to the query template.params.fieldsis generated before every request fromdefault_fieldsand the theme, label, hover, icon scaling and cluster label fields, so a configured value is overwritten.queryparamsare assigned to layer queries and location entry queries. The locale'squeryparamsare merged in; layer values win.2
tables replaces table with a table per integer zoom level, and geoms
replaces geom with a geometry column per zoom level. Below the smallest or
above the largest key, the value of that key applies. A null table hides the
layer at those zoom levels and shows it again when a table applies.3
"tables": { "7": null, "8": "schema.table_low", "11": "schema.table_high", "14": null }z_field, on MVT layers, names an integer column; a feature is only in a tile
when its value is lower than the tile's zoom.4
- A request's
tableparam must be a table named in the layer: anytablevalue ortablesentry anywhere in the layer, including location entries. Other tables are rejected with 403.1 - Vector formats need
sridandqID, andtable,tablesor inlinefeatures; without a table for the current zoom no data is requested.5 MVT needstableortables, andsridmust be absent or the string"3857". See layer formats. - A
viewportquery fails with 400 withoutgeomandsrid, or whensridis not an integer or a string of digits.1
The retail points are hidden below zoom 6 and loaded from the same table from zoom 6.
{
"dbs": "DEVDB",
"locale": {
"layers": {
"retail_points": {
"display": true,
"format": "wkt",
"tables": { "5": null, "6": "geodata.uk_glx_open_retail_points" },
"geom": "geom_p_4326",
"srid": "4326",
"qID": "id",
"params": { "default_fields": ["retailer"] }
}
}
}
}