Skip to main content

Class: MapFlightPlanFocusCalculator

Defined in: src/garminsdk/components/map/flightplan/MapFlightPlanFocusCalculator.ts:16

Calculates map projection parameters to fit flight plan foci.

Constructors

Constructor

new MapFlightPlanFocusCalculator(mapProjection): MapFlightPlanFocusCalculator

Defined in: src/garminsdk/components/map/flightplan/MapFlightPlanFocusCalculator.ts:24

Constructor.

Parameters

ParameterTypeDescription
mapProjectionMapProjectionThis calculator's map projection.

Returns

MapFlightPlanFocusCalculator

Methods

calculateRangeTarget()

calculateRangeTarget(focus, margins, ppos, out): MapFieldOfView

Defined in: src/garminsdk/components/map/flightplan/MapFlightPlanFocusCalculator.ts:38

Calculates a maximum range and target center for a given flight plan focus such that the terminators of all legs in the focus are visible in this calculator's map projection. If there is only one leg terminator in the specified focus, the calculated range will be equal to 0. If a range and target could not be calculated, NaN will be written to the results.

Parameters

ParameterTypeDescription
focusFlightPlanFocusThe array of legs on which to focus.
marginsFloat64ArrayThe margins around the projected map boundaries to respect. Expressed as [left, top, right, bottom].
pposLatLonInterfaceThe current position of the airplane.
outMapFieldOfViewThe object to which to write the results.

Returns

MapFieldOfView

The calculated range and target for the specified focus.