Skip to main content

Class: GarminChartDisplay

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:107

A Garmin terminal (airport) chart display. The display renders up to one chart page or sub-area of a chart page at a time. The displayed chart can be scaled, rotated, and panned (translated). Optional geo-referencing data is also supported.

The display also renders its child nodes on top of the displayed chart. Any descendant components that implement the GarminChartDisplayLayer interface (that do not descend from another descendant component of the display) are attached to the display once the display is rendered and can listen to various callbacks. Please refer to the interface documentation for more information on these callbacks.

Extends

Constructors

Constructor

new GarminChartDisplay(props): GarminChartDisplay

Defined in: src/sdk/components/FSComponent.ts:73

Creates an instance of a DisplayComponent.

Parameters

ParameterTypeDescription
propsGarminChartDisplayPropsThe propertis of the component.

Returns

GarminChartDisplay

Inherited from

DisplayComponent.constructor

Properties

context?

optional context: [] = undefined

Defined in: src/sdk/components/FSComponent.ts:64

The context on this component, if any.

Inherited from

DisplayComponent.context


contextType?

readonly optional contextType: readonly [] = undefined

Defined in: src/sdk/components/FSComponent.ts:67

The type of context for this component, if any.

Inherited from

DisplayComponent.contextType


props

props: GarminChartDisplayProps & ComponentProps

Defined in: src/sdk/components/FSComponent.ts:61

The properties of the component.

Inherited from

DisplayComponent.props

Methods

changeChartPan()

changeChartPan(dx, dy, allowOverscroll): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:493

Changes this display's chart panning offset. The amount by which to move, specified by the dx and dy parameters, is interpreted in the display's coordinate system after rotation and scaling have been applied to the chart. For example, a change in offset of dx = 5, dy = -5 always moves the chart 5 pixels to the right and 5 pixels up in the display, regardless of the display's zoom level or rotation values. If there is no displayed chart or if this display's area (width multiplied by height) is zero, then this method does nothing. Any changes to this display made by this method will not take effect until the next time the display is updated.

Parameters

ParameterTypeDefault valueDescription
dxnumberundefinedThe amount to change the offset along the display's x axis, in pixels. This value will move the displayed chart along the x axis of the display.
dynumberundefinedThe amount to change the offset along the display's y axis, in pixels. This value will move the displayed chart along the y axis of the display.
allowOverscrollbooleanfalseWhether to allow the chart to be panned into the overscroll zone. Defaults to false.

Returns

void


changeChartRotation()

changeChartRotation(delta): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:451

Changes this display's chart rotation angle. If there is no displayed chart or if this display's area (width multiplied by height) is zero, then this method does nothing. Any changes to this display made by this method will not take effect until the next time the display is updated.

A rotation angle of zero results in the chart being displayed "upright", with positive angles rotating the chart clockwise.

Parameters

ParameterTypeDescription
deltanumberThe amount by which to change the rotation angle, in degrees.

Returns

void


changeChartZoom()

Call Signature

changeChartZoom(delta): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:383

Changes this display's chart zoom level by a given amount. The final zoom level will be clamped between the minimum and maximum allowed values. The minimum value is the greatest zoom level at which the entire displayed chart area fits within the display. The maximum value is set via this display's maxZoomLevel prop. If there is no displayed chart or if this display's area (width multiplied by height) is zero, then this method does nothing. Any changes to this display made by this method will not take effect until the next time the display is updated.

A zoom level of zero scales the displayed chart area such that the displayed width of the chart area equals the width of the display. Every unit increase in zoom level increases the scaling applied to the displayed chart area by a factor of 2.

Parameters
ParameterTypeDescription
deltanumberThe amount by which to change the zoom level.
Returns

void

Call Signature

changeChartZoom(delta, step): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:402

Changes this display's chart zoom level by a given amount while quantizing the final zoom level. The final zoom level will be clamped between the minimum and maximum allowed values. The minimum value is the greatest zoom level at which the entire displayed chart area fits within the display. The maximum value is set via this display's maxZoomLevel prop. If there is no displayed chart or if this display's area (width multiplied by height) is zero, then this method does nothing. Any changes to this display made by this method will not take effect until the next time the display is updated.

A zoom level of zero scales the displayed chart area such that the displayed width of the chart area equals the width of the display. Every unit increase in zoom level increases the scaling applied to the displayed chart area by a factor of 2.

Parameters
ParameterTypeDescription
deltanumberThe amount by which to change the zoom level, interpreted as a multiple of step.
stepnumberThe amount to which the final zoom level should be quantized. The final zoom level will be restricted to be an integer multiple of this value unless it is clamped to the minimum or maximum allowed zoom level. If changing the initial zoom level by delta * step results in a final zoom level that is not properly quantized, then the final zoom level will be set to the integer multiple of step between the initial and final zoom levels (inclusive) that is closest to the final zoom level.
Returns

void


destroy()

destroy(): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:1321

Destroys this component.

Returns

void

Overrides

DisplayComponent.destroy


getContext()

protected getContext(context): never

Defined in: src/sdk/components/FSComponent.ts:106

Gets a context data subscription from the context collection.

Parameters

ParameterTypeDescription
contextneverThe context to get the subscription for.

Returns

never

The requested context.

Throws

An error if no data for the specified context type could be found.

Inherited from

DisplayComponent.getContext


onAfterRender()

onAfterRender(): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:280

A callback that is called after the component is rendered.

Returns

void

Overrides

DisplayComponent.onAfterRender


onBeforeRender()

onBeforeRender(): void

Defined in: src/sdk/components/FSComponent.ts:80

A callback that is called before the component is rendered.

Returns

void

Inherited from

DisplayComponent.onBeforeRender


render()

render(): VNode

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:1257

Renders the component.

Returns

VNode

A JSX element to be rendered.

Overrides

DisplayComponent.render


resetChartPan()

resetChartPan(): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:464

Resets this display's chart panning offset to zero along both the x and y axes. If there is no displayed chart or if this display's area (width multiplied by height) is zero, then this method does nothing. Any changes to this display made by this method will not take effect until the next time the display is updated.

The panning offset is the offset of the center of the displayed chart area from the center of the display, as [x, y] in the chart's internal coordinate system. An offset of [0, 0] indicates the displayed chart area is centered in the display window.

Returns

void


setChartRotation()

setChartRotation(rotation): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:429

Sets this display's chart rotation angle. If there is no displayed chart or if this display's area (width multiplied by height) is zero, then this method does nothing. Any changes to this display made by this method will not take effect until the next time the display is updated.

A rotation angle of zero results in the chart being displayed "upright", with positive angles rotating the chart clockwise.

Parameters

ParameterTypeDescription
rotationnumberThe rotation angle to set, in degrees.

Returns

void


setChartZoom()

setChartZoom(zoom): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:358

Sets this display's chart zoom level. The zoom level will be clamped between the minimum and maximum allowed values. The minimum value is the greatest zoom level at which the entire displayed chart area fits within the display. The maximum value is set via this display's maxZoomLevel prop. If there is no displayed chart or if this display's area (width multiplied by height) is zero, then this method does nothing. Any changes to this display made by this method will not take effect until the next time the display is updated.

A zoom level of zero scales the displayed chart area such that the displayed width of the chart area equals the width of the display. Every unit increase in zoom level increases the scaling applied to the displayed chart area by a factor of 2.

Parameters

ParameterTypeDescription
zoomnumberThe zoom level to set.

Returns

void


setFitWidth()

setFitWidth(): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:558

Resets this display's chart zoom level, chart rotation angle, and panning offset along the x axis to zero (the offset along the y axis will remain unchanged). This has the effect of rotating the displayed chart to be "upright", centering the chart area in the display along the x axis (horizontally), and scaling the chart such that the width of the displayed chart area exactly fits in the width of the display. If there is no displayed chart or if this display's area (width multiplied by height) is zero, then this method does nothing. Any changes to this display made by this method will not take effect until the next time the display is updated.

Returns

void


setOverscrollSnapbackInhibit()

setOverscrollSnapbackInhibit(inhibit): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:538

Sets whether to inhibit automatic overscroll snap-back. When the chart is panned into the overscroll zone, overscroll snap-back gradually moves the chart out of the overscroll zone and back into the non-overscroll panning bounds every time update() is called. Inhibiting snap-back prevents this from happening and allows the chart to stay panned within the overscroll zone indefinitely.

Parameters

ParameterTypeDescription
inhibitbooleanWhether to inhibit automatic overscroll snap-back.

Returns

void


update()

update(time): void

Defined in: src/garminsdk/components/charts/GarminChartDisplay.tsx:574

Updates this display.

Parameters

ParameterTypeDescription
timenumberThe current real (operating system) time, as a Javascript timestamp.

Returns

void