Tutorial - Tracks

Track features are like line features with a time value at each vertex.

We'll use a few custom controls and styles in this tutorials. These are set up first.

Step 1
Active
Inactive
Step 2
Active
Inactive

Create a map and a feature layer.

Step 3
Active
Inactive

Specify some data.

A track feature is an array of data elements, each of which has a list of vertices.

If a time is not specified on a vertex, the index of the vertex is used.

Step 4
Active
Inactive

Create the track feature. By default, the entirety of each track is shown.

Step 5
Active
Inactive

Highlight a particular time range.

The track feature has a start time, end time, and duration. Parts of the track before the start time are styled with the pastStyle, those after the end time are styled with the futureStyle, and those between the start and end with the presentStyle. The head of the track is at the end time and can either have a marker or text styled with markerStyle and textStyle.

Step 6
Active
Inactive

Hide future parts of the track.

If the end time is after the end of the track, hide the marker, too.

Step 7
Active
Inactive

Use text instead of a marker.

Step 8
Active
Inactive

We can add controls to dynamically adjust the track times and to show other information.

If you adjust the start time to a point after the end time, the specified start time is ignored. Instead, the minimum value for the time range is used.

Step 9
Active
Inactive