Skip to content

Location infoj ​

Workspace Key draft workspace location infoj ui xyz

layer.infoj lists the entries of a location view and where each value comes from; use to configure what a location shows.

Resource and sources

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 ​

  • field is a column of the layer table. Opening a location runs the location_get query, which selects every infoj field of the layer.[2]
  • fieldfx replaces the column with a SQL expression, selected as field, 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 the field supplies the expression.[3]
  • jsonb_field and jsonb_key, or json_field and json_key, read one key of a JSON column. objectAssignFromField and objectMergeFromField take an object value from another entry.
  • query runs a query template for the entry instead, with queryparams; run or queryCheck run it each time the view opens, runOnce only the first time.
  • default is the value of a new location; nullValue is shown for null.

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 key get their field, or their index, as key.[4]
  • infoj_order lists entry keys, fields or queries in display order, and leaves out the rest. Objects in it are added as extra entries.
  • infoj_skip skips 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"]
      }
    }
  }
}

  1. ui locations/entries/_entries.mjs ↩︎

  2. templates/location_get.js ↩︎

  3. query.js infojMap and fields check ↩︎ ↩︎

  4. ui locations/infoj.mjs ↩︎

XYZ v5.1.0. Generated from knowledge/ at dd7a6fa27736502733499c1bf485f15659b10338. Concepts marked draft are not reviewed.