Skip to main content

Class: MapModel<M>

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

Name
M

Constructors

constructor

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

Type parameters

Name
M

Returns

MapModel<M>

Methods

addModule

addModule<K>(name, module): void

Adds a module to this model.

Type parameters

NameType
Kextends string

Parameters

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

Returns

void

Defined in

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


getModule

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

Gets a module from this model.

Type parameters

NameType
Kextends string

Parameters

NameTypeDescription
nameKThe name of the module.

Returns

M[K]

A module.

Defined in

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

getModule<T>(module): T

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

Type parameters

Name
T

Parameters

NameTypeDescription
module(...args: any) => TThe module to get.

Returns

T

The requested map data module.

Defined in

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