Skip to main content

Class: MapModel<M>

Defined in: src/sdk/components/map/MapModel.ts:5

A model for maps. Specific functionality is added by adding one or more modules to the model. Each module added to the model is assigned a name which is used to retrieve it from the model.

Type Parameters

Type Parameter
M

Constructors

Constructor

new MapModel<M>(): MapModel<M>

Returns

MapModel<M>

Methods

addModule()

addModule<K>(name, module): void

Defined in: src/sdk/components/map/MapModel.ts:45

Adds a module to this model.

Type Parameters

Type Parameter
K extends string

Parameters

ParameterTypeDescription
nameKThe name of the module to add.
moduleM[K]The module to add.

Returns

void


getModule()

Gets a module instance from the model and assigns it to the provided type.

Param

The module to get or the name of the module.

Throws

An error if

Call Signature

getModule<K>(name): M[K]

Defined in: src/sdk/components/map/MapModel.ts:13

Gets a module from this model.

Type Parameters
Type Parameter
K extends string
Parameters
ParameterTypeDescription
nameKThe name of the module.
Returns

M[K]

A module.

Call Signature

getModule<T>(module): T

Defined in: src/sdk/components/map/MapModel.ts:21

Gets a module instance from the model and assigns it to the provided type.

Type Parameters
Type Parameter
T
Parameters
ParameterTypeDescription
module(...args) => TThe module to get.
Returns

T

The requested map data module.