Skip to main content

Class: MapFieldOfViewCalculator

Defined in: src/sdk/components/map/MapFieldOfViewCalculator.ts:33

Calculates map projection parameters for fields of view which encompass sets of geographic points.

Constructors

Constructor

new MapFieldOfViewCalculator(): MapFieldOfViewCalculator

Returns

MapFieldOfViewCalculator

Methods

calculateFov()

Call Signature

calculateFov(mapProjection, focus, margins, out): MapFieldOfView

Defined in: src/sdk/components/map/MapFieldOfViewCalculator.ts:54

Calculates a map field of view, consisting of a range and target location, which encompasses a given set of geographic points (the focus) with the smallest possible range. If there is only one point in the specified focus, then the calculated range will be equal to 0. If the specified focus contains zero points or a field of view could not be calculated, NaN will be written to the results.

Parameters
ParameterTypeDescription
mapProjectionMapProjectionThe projection of the map for which to calculate the field of view.
focusreadonly Readonly<LatLonInterface>[]An array of points comprising the focus of the field of view.
marginsReadonlyFloat64ArrayThe margins around the projected map boundaries to respect, as [left, top, right, bottom] in pixels. The field of view will be calculated in order to avoid placing any points in the focus outside of the margins.
outMapFieldOfViewThe object to which to write the results.
Returns

MapFieldOfView

The calculated field of view for the specified focus.

Call Signature

calculateFov(mapProjection, focus, margins, out): MapScaleFactorFieldOfView

Defined in: src/sdk/components/map/MapFieldOfViewCalculator.ts:73

Calculates a map field of view, consisting of a scale factor and target location, which encompasses a given set of geographic points (the focus) with the largest possible scale factor. If there is only one point in the specified focus, then the calculated scale factor will be equal to Infinity. If the specified focus contains zero points or a field of view could not be calculated, NaN will be written to the results.

Parameters
ParameterTypeDescription
mapProjectionMapProjectionThe projection of the map for which to calculate the field of view.
focusreadonly Readonly<LatLonInterface>[]An array of points comprising the focus of the field of view.
marginsReadonlyFloat64ArrayThe margins around the projected map boundaries to respect, as [left, top, right, bottom] in pixels. The field of view will be calculated in order to avoid placing any points in the focus outside of the margins.
outMapScaleFactorFieldOfViewThe object to which to write the results.
Returns

MapScaleFactorFieldOfView

The calculated field of view for the specified focus.