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.
Create a map and a feature layer.
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.
Create the track feature. By default, the entirety of each track is shown.
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
Hide future parts of the track.
If the end time is after the end of the track, hide the marker, too.
Use text instead of a marker.
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.