RegionMapping

RegionMapping

new RegionMapping(catalogItemopt, tableStructureopt, tableStyleopt)

Source:

A DataSource for table-based data. Handles the graphical display of lat-lon and region-mapped datasets. For lat-lon data sets, each row is taken to be a feature. RegionMapping generates Cesium entities for each row. For region-mapped data sets, each row is a region. The regions are displayed using a WMS imagery layer. Displaying the points or regions requires a legend.

Parameters:
Name Type Attributes Description
catalogItem CatalogItem <optional>

The CatalogItem instance.

tableStructure TableStructure <optional>

The Table Structure instance; defaults to a new one.

tableStyle TableStyle <optional>

The table style; defaults to undefined.

Members

changedEvent :CesiumEvent

Source:

Gets a CesiumEvent that will be raised when the underlying data changes.

Type:
  • CesiumEvent

clock :DataSourceClock

Source:

Gets the clock settings defined by the loaded data. If only static data exists, this value is undefined.

Type:
  • DataSourceClock

hasActiveTimeColumn :Boolean

Source:

Gets a Boolean value saying whether the region mapping has a time column.

Type:
  • Boolean

imageryLayer :Object

Source:

Gets the Cesium or Leaflet imagery layer object associated with this data source. This property is undefined if the data source is not enabled.

Type:
  • Object

isLoading :Boolean

Source:

Gets or sets a value indicating if the data source is currently loading data. Whenever loadingData is changed to false, also trigger a redraw.

Type:
  • Boolean

isPolled :Boolean

Source:

Gets a Boolean value saying whether the region mapping will be updated due to its catalog item being polled.

Type:
  • Boolean

tableStructure :TableStructure

Source:

Gets the TableStructure object holding all the data.

Type:

tableStyle :TableStyle

Source:

Gets the TableStyle object showing how to style the data.

Type:

Methods

destroy()

Source:

Destroy the object and release resources

hideImageryLayer()

Source:

Explictly hide the imagery layer (if any).

loadRegionDetails() → {Promise}

Source:

Builds a promise which resolves to either: undefined if no regions; An array of objects with regionProvider, column and disambigColumn properties. It also caches this object in regionMapping._regionDetails.

The steps involved are: 0. Wait for the data to be ready, if needed. (For loaded tables, this is trivially true, but it might be constructed elsewhere.)

  1. Get the region provider list (asynchronously).
  2. Use this list to find all the possible region identifiers for this table, eg. 'postcode' or 'sa4_code'. If the user specified a prefered region variable name/type, put this to the front of the list. Elsewhere, we only offer the user the first region mapping possibility.
  3. Load the region ids of each possible region identifier (asynchronously), eg. ['2001', '2002', ...].
  4. Once all of these are known, cache and return all the details of all the possible region mapping approaches.

These steps are sequenced using a series of promise.thens, so that the caller only sees a promise resolving to the end result.

It is safe to call this multiple times, as each asynchronous call returns a cached promise if it exists.

Returns:

The promise.

Type
Promise

setRegionColumnType(regionDetails)

Source:

Set the region column type. Currently we only use the first possible region column, and leave any others as they are.

Parameters:
Name Type Description
regionDetails Array.<Object>

The data source's regionDetails array.