Location infoj
A location is one record of a layer table. layer.infoj is the ordered list of entries its location view shows. Each entry has a type, text by default, which selects how it is shown; see entry types. The type's examples list the built-in methods; a plugin which adds a method to mapp.ui.locations.entries adds a type, which the schema accepts; see extension points.[1]
Where values come from
fieldis a column of the layer table. Opening a location runs thelocation_getquery, which selects every infojfieldof the layer.[2]fieldfxreplaces the column with a SQL expression, selected asfield, eg."fieldfx": "ARRAY[ST_X(geom),ST_Y(geom)]". It is written into the SQL, so it must only come from the workspace.- With
template: true, a workspace template named like thefieldsupplies the expression.[3] jsonb_fieldandjsonb_key, orjson_fieldandjson_key, read one key of a JSON column.objectAssignFromFieldandobjectMergeFromFieldtake an object value from another entry.queryruns a query template for the entry instead, withqueryparams;runorqueryCheckrun it each time the view opens,runOnceonly the first time.defaultis the value of a new location;nullValueis shown fornull.
Layer data requests may only ask for fields named in the layer: any field or fields value anywhere in the layer configuration. Others are rejected with 400.[3:1]
Order and skipping
- Entries without
keyget theirfield, or their index, as key.[4] infoj_orderlists entry keys, fields or queries in display order, and leaves out the rest. Objects in it are added as extra entries.infoj_skipskips entries whose key, field, query, type or group is in the list, eg. to hide entries from a layer template.
Examples
The retail points with an ID, a pin, and text entries from the table.
json
{
"dbs": "DEVDB",
"locale": {
"layers": {
"retail_points": {
"display": true,
"format": "wkt",
"table": "geodata.uk_glx_open_retail_points",
"geom": "geom_p_4326",
"srid": "4326",
"qID": "id",
"infoj": [
{ "type": "key" },
{ "field": "pin", "type": "pin", "fieldfx": "ARRAY[ST_X(geom_p_4326),ST_Y(geom_p_4326)]" },
{ "title": "Retailer", "field": "retailer", "inline": true },
{ "title": "Name", "field": "store_name" },
{ "title": "Postcode", "field": "postcode", "skipNullValue": true },
{ "title": "Open Date", "field": "open_date", "type": "date" }
],
"infoj_skip": ["postcode"]
}
}
}
}