Feature

Feature

new Feature(optionsopt)

Source:

A feature is just a Cesium Entity, with observable (ie. knockout-tracked) properties added for currentDescription and currentProperties. These are tracked so that the feature info updates as the clock time changes, because the properties and description themselves do not change (they are functions of the time, whose values change). Set these if needed from an event listener on the terria clock, eg. terria.clock.onTick.addEventListener(function(clock) { if (typeof feature.description.getValue === 'function') { feature.currentDescription = feature.description.getValue(clock.currentTime); }; if (typeof feature.properties.getValue === 'function') { feature.currentProperties = feature.properties.getValue(clock.currentTime); }; });

Parameters:
Name Type Attributes Description
options Object <optional>

Object with the same properties as Cesium's Entity.

Extends

  • Entity

Members

currentDescription :String

Source:

Gets or sets the current description. This property is observable.

Type:
  • String

currentProperties :Object

Source:

Gets or sets the current properties. This property is observable.

Type:
  • Object

updateCounters :Object

Source:

Gets or sets counter objects used to trigger an update of the Feature Info Section, to allow custom components to self-update. The object keys are timeoutIds, and values are {reactComponent: ReactComponent, counter: Integer}. This property is observable.

Type:
  • Object

Methods

(static) fromEntity(entity) → {Feature}

Source:

Creates a new Feature from an Entity. Note the custom properties are also copied into the new Feature properly.

Parameters:
Name Type Description
entity Entity
Returns:
Type
Feature

(static) fromEntityCollectionOrEntity(entity) → {Feature}

Source:

If the given entity is part of an entityCollection, and those entities are themselves features, then return the matching feature from the collection. Otherwise, return a new Feature from this entity.

Parameters:
Name Type Description
entity Entity
Returns:

The corresponding feature.

Type
Feature