Skip to main content

Class: MapRangeController

Controls map range.

Hierarchy

Constructors

constructor

new MapRangeController(context, nauticalRangeArray?, metricRangeArray?, settingManager?, useSetting?): MapRangeController

Constructor.

Parameters

NameTypeDescription
contextMapSystemContext<MapRangeControllerModules, any, any, any>This controller's map context.
nauticalRangeArray?readonly NumberUnitInterface<Distance, Unit<Distance>>[]The map range array this controller sets for nautical distance mode. If not defined, this controller will not change the range array when entering nautical distance mode.
metricRangeArray?readonly NumberUnitInterface<Distance, Unit<Distance>>[]The map range array this controller sets for metric distance mode. If not defined, this controller will not change the range array when entering metric distance mode.
settingManager?UserSettingManager<MapRangeControllerSettings>A setting manager containing the map range index setting. If not defined, map range will be set directly through the map model.
useSetting?Subscribable<boolean>A subscribable which provides whether to control map range via the user setting. If not defined, map range will always be controlled via the user setting. Ignored if settingManager is undefined.

Returns

MapRangeController

Overrides

MapSystemController\<MapRangeControllerModules\>.constructor

Defined in

src/garminsdk/components/map/controllers/MapRangeController.ts:55

Properties

context

Protected Readonly context: MapSystemContext<MapRangeControllerModules, any, any, any>

Inherited from

MapSystemController.context

Defined in

src/sdk/components/mapsystem/MapSystemController.ts:24

Accessors

isAlive

get isAlive(): boolean

Whether this controller is alive.

Returns

boolean

Inherited from

MapSystemController.isAlive

Defined in

src/sdk/components/mapsystem/MapSystemController.ts:20

Methods

changeRangeIndex

changeRangeIndex(delta, bypassUserSetting?): number

Changes the map range index by a given amount. If the change results in an index that is out of bounds, it will be clamped before being set.

Parameters

NameTypeDefault valueDescription
deltanumberundefinedThe change to apply to the index.
bypassUserSettingbooleanfalseWhether to bypass the map range index user setting, if one is defined for this controller, and change the range index directly on the map range module. Defaults to false.

Returns

number

The final index that was set.

Defined in

src/garminsdk/components/map/controllers/MapRangeController.ts:129


destroy

destroy(): void

Returns

void

Inherit Doc

Overrides

MapSystemController.destroy

Defined in

src/garminsdk/components/map/controllers/MapRangeController.ts:139


onAfterMapRender

onAfterMapRender(): void

Returns

void

Inherit Doc

Overrides

MapSystemController.onAfterMapRender

Defined in

src/garminsdk/components/map/controllers/MapRangeController.ts:68


onAfterUpdated

onAfterUpdated(time, elapsed): void

This method is called immediately after this controller's map updates its layers.

Parameters

NameTypeDescription
timenumberThe current time, as a Javascript timestamp.
elapsednumberThe elapsed time, in milliseconds, since the last update.

Returns

void

Inherited from

MapSystemController.onAfterUpdated

Defined in

src/sdk/components/mapsystem/MapSystemController.ts:78


onBeforeUpdated

onBeforeUpdated(time, elapsed): void

This method is called immediately before this controller's map updates its layers.

Parameters

NameTypeDescription
timenumberThe current time, as a Javascript timestamp.
elapsednumberThe elapsed time, in milliseconds, since the last update.

Returns

void

Inherited from

MapSystemController.onBeforeUpdated

Defined in

src/sdk/components/mapsystem/MapSystemController.ts:68


onDeadZoneChanged

onDeadZoneChanged(deadZone): void

This method is called when the dead zone of this controller's map changes.

Parameters

NameTypeDescription
deadZoneReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The map's new dead zone.

Returns

void

Inherited from

MapSystemController.onDeadZoneChanged

Defined in

src/sdk/components/mapsystem/MapSystemController.ts:48


onMapDestroyed

onMapDestroyed(): void

Returns

void

Inherit Doc

Overrides

MapSystemController.onMapDestroyed

Defined in

src/garminsdk/components/map/controllers/MapRangeController.ts:134


onMapProjectionChanged

onMapProjectionChanged(mapProjection, changeFlags): void

This method is called when the projection of this controller's map changes.

Parameters

NameTypeDescription
mapProjectionMapProjectionThe map projection.
changeFlagsnumberBit flags describing the type of change.

Returns

void

Inherited from

MapSystemController.onMapProjectionChanged

Defined in

src/sdk/components/mapsystem/MapSystemController.ts:58


onSleep

onSleep(): void

This method is called when this controller's map is put to sleep.

Returns

void

Inherited from

MapSystemController.onSleep

Defined in

src/sdk/components/mapsystem/MapSystemController.ts:92


onWake

onWake(): void

This method is called when this controller's map is awakened.

Returns

void

Inherited from

MapSystemController.onWake

Defined in

src/sdk/components/mapsystem/MapSystemController.ts:85


setRangeIndex

setRangeIndex(index, bypassUserSetting?): number

Sets the map range index. If the index is out of bounds, it will be clamped before being set.

Parameters

NameTypeDefault valueDescription
indexnumberundefinedThe index to set.
bypassUserSettingbooleanfalseWhether to bypass the map range index user setting, if one is defined for this controller, and set the range index directly on the map range module. Defaults to false.

Returns

number

The index that was set.

Defined in

src/garminsdk/components/map/controllers/MapRangeController.ts:109