Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: TemporalRenderer

require(["esri/renderers/TemporalRenderer"], function(TemporalRenderer) { /* code goes here */ });

Description

(Added at v2.0)
Temporal renderers provide time-based rendering of features in a feature layer. It can be useful to visualize historic or real-time data such as earthquake or hurricane occurrences. You can use a temporal renderer to define how observations (regular, historic, latest) and tracks are rendered. You can also show aging of features with respect to the map's time extent.

More information on working with rendering, smart mapping, and using visual variables can be found in the Data Visualization guide topic and the multiple samples referenced within this topic.

Samples

Search for samples that use this class.

Class hierarchy

esri/renderers/Renderer
|_esri/renderers/TemporalRenderer

Constructors

NameSummary
new TemporalRenderer(observationRenderer, latestObservationRenderer?, trackRenderer?, observationAger?)Creates a new TemporalRenderer object that can be used with a time-aware feature layer.

Methods

NameReturn typeSummary
getColor(graphic, options?)ColorGets the color for the Graphic.
getOpacity(graphic, options?)NumberReturns the opacity value for the specified graphic.
getRotationAngle(graphic, options?)NumberReturns the angle of rotation (in degrees) for the graphic calculated using rotationInfo.
getSize(graphic, options?)NumberReturn the symbol size (in pixels) for the graphic, calculated using sizeInfo.
getSymbol(graphic)SymbolReturns the symbol used to render the graphic.
toJson()ObjectConverts object to its ArcGIS Server JSON representation.
Constructor Details

new TemporalRenderer(observationRenderer, latestObservationRenderer?, trackRenderer?, observationAger?)

Creates a new TemporalRenderer object that can be used with a time-aware feature layer.
Parameters:
<Renderer> observationRenderer Required Renderer for regular/historic observations.
<Renderer> latestObservationRenderer Optional Renderer for the most current observations.

In the snippet below RouteID is the field that contains the trackID for the feature layer this is used to display the latest observation for the specified tracks.

require([
  "esri/renderers/UniqueValueRenderer", "esri/symbols/PictureMarkerSymbol", ... 
], function(UniqueValueRenderer, PictureMarkerSymbol, ... ) {
  var latestObservationRenderer = new UniqueValueRenderer(defaultSymbol, "RouteID");
  latestObservationRenderer.addValue(1,new PictureMarkerSymbol('images/runnergreen.png',20,20));
  latestObservationRenderer.addValue(2,new PictureMarkerSymbol('images/runnerblue.png',20,20));
  latestObservationRenderer.addValue(3,new PictureMarkerSymbol('images/runnerred.png',20,20));
  ...
});
<Renderer> trackRenderer Optional Renderer for the tracks. A track is a collection of events that share a common track ID. A track line is a graphic line that connects the observations. Applicable only for feature layers with a valid trackIdField.
require([
  "esri/renderers/SimpleRenderer", ... 
], function(SimpleRenderer, ... ) {
  var trackRenderer = new SimpleRenderer(myLineSymbol);
  ...
});
<SymbolAger> observationAger Optional Symbol ager for regular observations.
require([
  "esri/renderers/TimeClassBreaksAger", "esri/Color", ... 
], function(TimeClassBreaksAger, Color, ... ) {
  var infos = [
    {
      minAge: 0,
      maxAge: 1,
      color: new Color([255, 0, 0])
    },
    {
      minAge: 1,
      maxAge: 5,
      color: new Color([255, 153, 0])
    },
    {
      minAge: 5,
      maxAge: 10,
      color: new Color([255, 204, 0])
    },
    {
      minAge: 10,
      maxAge: Infinity,
      color: new Color([0, 0, 0, 0])
    }
  ];
  var ager = new TimeClassBreaksAger(infos, TimeClassBreaksAger.UNIT_MINUTES);
  ...
});
Sample:
require([
  "esri/renderers/TemporalRenderer", ... 
], function(TemporalRenderer, ... ) {
  var renderer = new TemporalRenderer(observationRenderer, null, null, ager);
  ...
});
Method Details

getColor(graphic, options?)

Gets the color for the Graphic. (Added at v3.8)
Return type: Color
Parameters:
<Graphic> graphic Required Graphic to get color from.
<Object> options Optional This optional parameter supports colorInfo. If none is provided, the Renderer.colorInfo will be used.

getOpacity(graphic, options?)

Returns the opacity value for the specified graphic. This is calculated using the opacityInfo definition. (Added at v3.11)
Return type: Number
Parameters:
<Graphic> graphic Required Returns the opacity value appropriate for the given graphic. This value is calculated based on the opacityInfo definition.
<Object> options Optional This optional parameter supports opacityInfo. If none is provided, the Renderer.opacityInfo will be used.

getRotationAngle(graphic, options?)

Returns the angle of rotation (in degrees) for the graphic calculated using rotationInfo. (Added at v3.7)
Return type: Number
Parameters:
<Graphic> graphic Required An input graphic for which you want to get the angle of rotation.
<Object> options Optional This optional parameter supports rotationInfo. If none is provided, the Renderer.rotationInfo will be used.

getSize(graphic, options?)

Return the symbol size (in pixels) for the graphic, calculated using sizeInfo. (Added at v3.7)
Return type: Number
Parameters:
<Graphic> graphic Required The graphic for which you want to calculate the symbol size.
<Object> options Optional This optional parameter supports sizeInfo. If none is provided, the Renderer.sizeInfo will be used.

getSymbol(graphic)

Returns the symbol used to render the graphic.
Return type: Symbol
Parameters:
<Graphic> graphic Required The input graphic.

toJson()

Converts object to its ArcGIS Server JSON representation. (Added at v2.1)
Return type: Object