lib/Models/RegionMapping.js
function(catalogItem, tableStructure, tableStyle) {
  this._tableStructure = defined(tableStructure)
    ? tableStructure
    : new TableStructure();
  if (defined(tableStyle) && !(tableStyle instanceof TableStyle)) {
    throw new DeveloperError("Please pass a TableStyle object.");
  }
  this._tableStyle = tableStyle; // Can be undefined.
  this._changed = new CesiumEvent();
  this._legendHelper = undefined;
  this._legendUrl = undefined;
  this._extent = undefined;
  this._loadingData = false;

  this._catalogItem = catalogItem;
  this._regionMappingDefinitionsUrl = defined(catalogItem)
    ? catalogItem.terria.configParameters.regionMappingDefinitionsUrl
    : undefined;
  this._regionDetails = undefined; // For caching the region details.
  this._imageryLayer = undefined;
  this._nextImageryLayer = undefined; // For pre-rendering time-varying layers
  this._nextImageryLayerInterval = undefined;
  this._hadImageryAtLayerIndex = undefined;
  this._hasDisplayedFeedback = false; // So that we only show the feedback once.

  this._constantRegionRowObjects = undefined;
  this._constantRegionRowDescriptions = undefined;

  // Track _tableStructure so that the catalogItem's concepts are maintained.
  // Track _legendUrl so that the catalogItem can update the legend if it changes.
  // Track _regionDetails so that when it is discovered that region mapping applies,
  //       it updates the legendHelper via activeItems, and catalogItem properties like supportsReordering.
  knockout.track(this, ["_tableStructure", "_legendUrl", "_regionDetails"]);

  // Whenever the active item is changed, recalculate the legend and the display of all the entities.
  // This is triggered both on deactivation and on reactivation, ie. twice per change; it would be nicer to trigger once.
  knockout
    .getObservable(this._tableStructure, "activeItems")
    .subscribe(changedActiveItems.bind(null, this), this);

  knockout
    .getObservable(this._catalogItem, "currentTime")
    .subscribe(function() {
      if (this.hasActiveTimeColumn) {
        onClockTick(this);
      }
    }, this);
}
function(catalogItem, tableStructure, tableStyle) {
  this._tableStructure = defined(tableStructure)
    ? tableStructure
    : new TableStructure();
  if (defined(tableStyle) && !(tableStyle instanceof TableStyle)) {
    throw new DeveloperError("Please pass a TableStyle object.");
  }
  this._tableStyle = tableStyle; // Can be undefined.
  this._changed = new CesiumEvent();
  this._legendHelper = undefined;
  this._legendUrl = undefined;
  this._extent = undefined;
  this._loadingData = false;

  this._catalogItem = catalogItem;
  this._regionMappingDefinitionsUrl = defined(catalogItem)
    ? catalogItem.terria.configParameters.regionMappingDefinitionsUrl
    : undefined;
  this._regionDetails = undefined; // For caching the region details.
  this._imageryLayer = undefined;
  this._nextImageryLayer = undefined; // For pre-rendering time-varying layers
  this._nextImageryLayerInterval = undefined;
  this._hadImageryAtLayerIndex = undefined;
  this._hasDisplayedFeedback = false; // So that we only show the feedback once.

  this._constantRegionRowObjects = undefined;
  this._constantRegionRowDescriptions = undefined;

  // Track _tableStructure so that the catalogItem's concepts are maintained.
  // Track _legendUrl so that the catalogItem can update the legend if it changes.
  // Track _regionDetails so that when it is discovered that region mapping applies,
  //       it updates the legendHelper via activeItems, and catalogItem properties like supportsReordering.
  knockout.track(this, ["_tableStructure", "_legendUrl", "_regionDetails"]);

  // Whenever the active item is changed, recalculate the legend and the display of all the entities.
  // This is triggered both on deactivation and on reactivation, ie. twice per change; it would be nicer to trigger once.
  knockout
    .getObservable(this._tableStructure, "activeItems")
    .subscribe(changedActiveItems.bind(null, this), this);

  knockout
    .getObservable(this._catalogItem, "currentTime")
    .subscribe(function() {
      if (this.hasActiveTimeColumn) {
        onClockTick(this);
      }
    }, this);
}
function ( catalogItem , tableStructure , tableStyle ) { this . _tableStructure = defined ( tableStructure ) ? tableStructure : new TableStructure ( ) ; if ( defined ( tableStyle ) && ! ( tableStyle instanceof TableStyle ) ) { throw new DeveloperError ( "Please pass a TableStyle object." ) ; } this . _tableStyle = tableStyle ; // Can be undefined. this . _changed = new CesiumEvent ( ) ; this . _legendHelper = undefined ; this . _legendUrl = undefined ; this . _extent = undefined ; this . _loadingData = false ; this . _catalogItem = catalogItem ; this . _regionMappingDefinitionsUrl = defined ( catalogItem ) ? catalogItem . terria . configParameters . regionMappingDefinitionsUrl : undefined ; this . _regionDetails = undefined ; // For caching the region details. this . _imageryLayer = undefined ; this . _nextImageryLayer = undefined ; // For pre-rendering time-varying layers this . _nextImageryLayerInterval = undefined ; this . _hadImageryAtLayerIndex = undefined ; this . _hasDisplayedFeedback = false ; // So that we only show the feedback once. this . _constantRegionRowObjects = undefined ; this . _constantRegionRowDescriptions = undefined ; // Track _tableStructure so that the catalogItem's concepts are maintained. // Track _legendUrl so that the catalogItem can update the legend if it changes. // Track _regionDetails so that when it is discovered that region mapping applies, //       it updates the legendHelper via activeItems, and catalogItem properties like supportsReordering. knockout . track ( this , [ "_tableStructure" , "_legendUrl" , "_regionDetails" ] ) ; // Whenever the active item is changed, recalculate the legend and the display of all the entities. // This is triggered both on deactivation and on reactivation, ie. twice per change; it would be nicer to trigger once. knockout . getObservable ( this . _tableStructure , "activeItems" ) . subscribe ( changedActiveItems . bind ( null , this ) , this ) ; knockout . getObservable ( this . _catalogItem , "currentTime" ) . subscribe ( function ( ) { if ( this . hasActiveTimeColumn ) { onClockTick ( this ) ; } } , this ) ; }
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.

@name RegionMapping

@alias RegionMapping
@constructor
@param {CatalogItem} [catalogItem] The CatalogItem instance.
@param {TableStructure} [tableStructure] The Table Structure instance; defaults to a new one.
@param {TableStyle} [tableStyle] The table style; defaults to undefined.
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 .