Class: MapFieldOfViewCalculator
Calculates map projection parameters for fields of view which encompass sets of geographic points.
Constructors
constructor
• new MapFieldOfViewCalculator(maxIter?
, rangeTolerance?
): MapFieldOfViewCalculator
Constructor.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
maxIter | number | MapFieldOfViewCalculator.DEFAULT_MAX_ITER | The maximum number of iterations to perform when calculating fields of view. Defaults to MapFieldOfViewCalculator.DEFAULT_MAX_ITER. |
rangeTolerance | number | MapFieldOfViewCalculator.DEFAULT_RANGE_TOLERANCE | The error tolerance of calculated field of view ranges, as a fraction of the ideal range for each field of view. Defaults to MapFieldOfViewCalculator.DEFAULT_RANGE_TOLERANCE. |
Returns
Defined in
src/sdk/components/map/MapFieldOfViewCalculator.ts:37
Methods
calculateFov
▸ calculateFov(mapProjection
, focus
, margins
, out
): MapFieldOfView
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
Name | Type | Description |
---|---|---|
mapProjection | MapProjection | The projection of the map for which to calculate the field of view. |
focus | readonly LatLonInterface [] | An array of points comprising the focus of the field of view. |
margins | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The 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. |
out | MapFieldOfView | The object to which to write the results. |
Returns
The calculated field of view for the specified focus.
Defined in
src/sdk/components/map/MapFieldOfViewCalculator.ts:56