An object literal containing the TrajectoryPainter constructor's parameters.

interface TrajectoryPainterConstructorOptions {
    defaultColor?: null | string;
    drapeTarget?: DrapeTarget;
    draped?: boolean;
    lineType?: LineType;
    lineWidth?: number;
    outsideTimeRangeWeight?: number;
    properties?: string[];
    propertyColorExpressions?: PropertyColorExpression[];
    selectionColor?: null | string;
    timeProvider?: ((feature, shape, pointIndex) => number);
    timeWindow?: [number, number];
}

Properties

defaultColor?: null | string

The default line color of trajectories, represented as a CSS color string.

drapeTarget?: DrapeTarget

Whether these lines should be draped on top of the terrain or a 3D tiles mesh (or both).

Default

{@link DrapeTarget.NOT_DRAPED}

Since

2022.1

draped?: boolean

Whether these lines should be draped on top of the terrain or not.

This property only exists for backwards compatibility. You should use drapeTarget instead. false is equivalent to DrapeTarget.NOT_DRAPED and true is equivalent to DrapeTarget.TERRAIN.

Default

false

Deprecated

Use drapeTarget instead.

lineType?: LineType

Determines how lines between subsequent points will be interpreted.

lineWidth?: number

The line width, in pixels, to paint trajectories with.

Default

1
outsideTimeRangeWeight?: number

The weight to apply to parts of lines outside of the configured time window.

properties?: string[]

The list of property names that will be used in the propertyColorExpressions. If a property is ever to be used in the propertyColorExpressions, it must be listed in this array.

propertyColorExpressions?: PropertyColorExpression[]

An array of objects describing a mapping of property values to colors.

selectionColor?: null | string

The color to paint selected trajectories with, represented as a CSS color string.

timeProvider?: ((feature, shape, pointIndex) => number)

A function that returns time as a number for a given point on a trajectory.

The user of this class is free to choose the range of time values. However the values should not be too big because they are internally converted to 32-bit floating-point numbers. For example do not use the time in milliseconds from epoch (e.g. 1970) but instead use the time in seconds from the start of the first day in your data set.

If no timeProvider is passed, time filtering is disabled (timeWindow will be ignored).

You can not modify the timeProvider after the TrajectoryPainter has been constructed.

Type declaration

    • (feature, shape, pointIndex): number
    • Parameters

      • feature: Feature<null | Shape, FeatureProperties>

        The feature for which to determine a time.

      • shape: Shape

        The shape for which to determine a time.

      • pointIndex: number

        The index of the point in the shape for which to determine a time.

      Returns number

timeWindow?: [number, number]

The start / end value for time filtering as an array with two values.