Ordered list

Ordered list is a type of infoj entry which returns a table with ordered results. Initial purpose is to display list of nearest locations from another layer in the tableview.

{ "type": "orderedList" }

A generic configuration of an orderedList entry:

{
  "type": "orderedList",
  "title": "Nearest competitors",    // tab title
  "display": true,
  "table": "public.food_beverage",  // data source
  "geom": "geom",                   // geometry column
  "columns": []                     // holder for table columns
}

"orderedList" support several distinct properties:

{
  "type": "orderedList",
  "title": "Nearest competitors",
  "display": true,
  "table": "public.food_beverage",
  "geom": "geom",
  "columns": [],
  "order": "DESC",   // ordering results, defaults to ASC / ascending
  "limit": 8,        // number of results, defaults to 100.
  "geography": true  // *
}
  • "geography": true is an optional parameter used to cast PostGIS geometry datatype to geography. This was implemented in order to return metric distance from calculation on WGS84 (SRID 4326) geometries.

Columns

"columns": [
 {
   "title": "Competitor name",
   "field": "fascia",
   "condition": {          // allows filtering based on where clause
      "operator": "ilike", // operator defaults to 'like'
      "phrase": "%a%"      // if phrase is undefined then condition is left out 
    }
  },
  {
    "title": "Category",
    "field": "rlcategory"  // type defaults to "text"
  },
  {
    "title": "Postcode",
    "fieldfx": "postcode", // functional "fieldfx" alias supported 
    "field": "_postcode"
   },
   {
     "title": "Retail place type",
     "field": "rp_type"
    },
    {
      "type": "integer",
      "geography": true,       // casts geometries to geographies
      "title" :"Distance (m)",
      "fx": "ST_DISTANCE",     // PostGIS function to perform on both geometries
      "field": "dist",
      "orderby": true          // entry entry included in "order by" clause
     }
  ]

The above configuration returns a set of features from another table where names contain 'a' ordered by closest distance.

Last updated