Type Alias ElevationProfileOptions

type ElevationProfileOptions = {
    backgroundColor?: string | null;
    crosshairColor?: string;
    displayCrosshair?: boolean;
    displayDistanceGrid?: boolean;
    displayDistanceLabels?: boolean;
    displayElevationGrid?: boolean;
    displayElevationLabels?: boolean;
    displayTooltip?: boolean;
    displayUnits?: boolean;
    distanceGridColor?: string;
    elevationGridColor?: string;
    fontSize?: number;
    forceComputeElevation?: boolean;
    labelColor?: string;
    onChangeView?: ((windowedLineString: LineString) => void) | null;
    onClick?: ((data: CallbackData) => void) | null;
    onMove?: ((data: CallbackData) => void) | null;
    paddingBottom?: number;
    paddingLeft?: number;
    paddingRight?: number;
    paddingTop?: number;
    profileBackgroundColor?: string | null;
    profileLineColor?: string | null;
    profileLineWidth?: number;
    tooltipBackgroundColor?: string;
    tooltipDisplayDistance?: boolean;
    tooltipDisplayDPlus?: boolean;
    tooltipDisplayElevation?: boolean;
    tooltipDisplayGrade?: boolean;
    tooltipTextColor?: string;
    unit?: "metric" | "imperial";
}
Index

Properties

backgroundColor?: string | null

Color of the background of the chart

crosshairColor?: string

Color of the crosshair.

Default: "#0005" (partially transparent black)

displayCrosshair?: boolean

Display the crosshair, a vertical line that follows the pointer, if true.

Default: true

displayDistanceGrid?: boolean

Display the distance grid lines (vertical lines matching the distance labels) if true.

Default: false

displayDistanceLabels?: boolean

Display the distance labels alon the horizontal axis.

Default: true

displayElevationGrid?: boolean

Display the elevation grid lines (horizontal lines matching the elevation labels) if true.

Default: true

displayElevationLabels?: boolean

Display the elevation label along the vertical axis.

Default: true

displayTooltip?: boolean

Display the tooltip folowing the pointer.

Default: true

displayUnits?: boolean

Display the distance and elevation units alongside the labels.

Default: true

distanceGridColor?: string

Color of the distance grid lines.

Default: "#0001" (partially transparent black)

elevationGridColor?: string

Color of the elevation drig lines.

Default: "#0001" (partially transparent black)

fontSize?: number

Font size applied to axes labels and tooltip.

Default: 12

forceComputeElevation?: boolean

If true, will force the computation of the elevation of the GeoJSON data provided to the .setData() method, even if they already contain elevation (possibly from GPS while recording). If false, the elevation will only be computed if missing from the positions.

Default: false

labelColor?: string

Color of the elevation and distance labels.

Default: "#0009" (partially transparent black)

onChangeView?: ((windowedLineString: LineString) => void) | null

Callback function to call when the chart is zoomed or panned. The argument windowedLineString is the GeoJSON LineString corresponding to the portion of the route visible in the elevation chart.

Default: null

onClick?: ((data: CallbackData) => void) | null

Callback function to call when the the elevation chart is clicked.

Default: null

onMove?: ((data: CallbackData) => void) | null

Callback function to call when the pointer is moving on the elevation chart.

Default: null

paddingBottom?: number

Padding at the bottom of the chart, in number of pixels.

Default: 10

paddingLeft?: number

Padding at the left of the chart, in number of pixels.

Default: 10

paddingRight?: number

Padding at the right of the chart, in number of pixels.

Default: 10

paddingTop?: number

Padding at the top of the chart, in number of pixels.

Default: 30

profileBackgroundColor?: string | null

Color of the elevation profile background (below the profile line) Can be null to not display any backgound color.

Default: "#66ccff22"

profileLineColor?: string | null

Color of the elevation profile line. Can be null to not display the line and rely on the background color only.

Default: "#66ccff"

profileLineWidth?: number

Width of the elevation profile line.

Default: 1.5

tooltipBackgroundColor?: string

Color of the tooltip background.

Default: "#000A" (partially transparent black)

tooltipDisplayDistance?: boolean

Display the distance information inside the tooltip if true.

Default: true

tooltipDisplayDPlus?: boolean

Display the D+ (cumulated positive ascent) inside the tooltip if true.

Default: true

tooltipDisplayElevation?: boolean

Display the elevation information inside the tooltip if true.

Default: true

tooltipDisplayGrade?: boolean

Display the slope grade in percentage inside the tooltip if true.

Default: true

tooltipTextColor?: string

Color of the text inside the tooltip.

Default: "#fff"

unit?: "metric" | "imperial"

Unit system to use. If "metric", elevation and D+ will be in meters, distances will be in km. If "imperial", elevation and D+ will be in feet, distances will be in miles.

Default: "metric"

Was this helpful?

SDK JS
Modules
Reference
types
ElevationProfileOptions