Visualize historical track data

This sample demonstrates how to visualize historical hurricane locations as tracks (beta) in a GeoJSONLayer.

Track data is represented as a series of observations. In addition to a timestamp, each observation must belong to a track identified by a unique ID. This ID is used to group observations into a track. To render track data, the layer must be configured with a valid timeInfo.

The timeInfo property of the layer defines the following:

  • startField: The field representing the time the observation occurred.
  • trackIdField: The field containing the unique ID of the track the observation belongs to.
Use dark colors for code blocksCopy
1
2
3
4
layer.timeInfo = {
  startField: "ISO_time",
  trackIdField: "Serial_Num"
};

For client-side layers, such as GeoJSONLayer, you must set this property directly on the layer instance. For server-side layers, such as FeatureLayer, you should set this property in the layer's service definition.

To render each hurricane location as tracks, you must also set the trackInfo property of the layer. The trackInfo property defines how to render the track, including the following properties:

  • previousObservations: Defines how to render the previous observations of the track.
  • latestObservations: Defines how to render the latest observations of the track.
  • trackLine: Defines how to render the track line.
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
layer.trackInfo = {
  previousObservations: {
    renderer: {
      // renderer configuration defined here
    },
    labelingInfo: [
      // labelingInfo configuration defined here
    ]
  },
  latestObservations: {
    renderer: {
      // renderer configuration defined here
    },
    labelingInfo: [
      // labelingInfo configuration defined here
    ]
  },
  trackLine: {
    renderer: {
      // renderer configuration defined here
    },
    labelingInfo: [
      // labelingInfo configuration defined here
    ]
  }
};

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.