Skip to main content

Class: MapSystemBuilder<Modules, Layers, Controllers, Context>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:326

Builds maps. Each builder is configured with a series of build steps which collectively define how the builder compiles finished maps. In addition to defining basic map properties such as size and range, build steps can also customize map behavior and appearance through adding map model modules, layers, and controllers.

Each map compiled by the builder is associated with a MapSystemContext, which holds references to the map projection, map model, all layers and controllers, and other data associated with the map. Layers and controllers have access to the context when they are created during compilation, and a reference to the context is stored with the compiled map.

A single builder can compile multiple maps. Each compiled map is a separate entity, with its own model, layers, controllers, and context.

Type Parameters​

Type ParameterDefault type
Modules extends ModuleRecordany
Layers extends LayerRecordany
Controllers extends ControllerRecordany
Context extends ContextRecordany

Constructors​

Constructor​

protected new MapSystemBuilder<Modules, Layers, Controllers, Context>(bus): MapSystemBuilder<Modules, Layers, Controllers, Context>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:381

Creates an instance of a map system builder.

Parameters​

ParameterTypeDescription
busEventBusThis builder's event bus.

Returns​

MapSystemBuilder<Modules, Layers, Controllers, Context>

Properties​

bus​

readonly bus: EventBus

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:381

This builder's event bus.


contextFactories​

protected readonly contextFactories: Map<string, ContextFactory>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:348


controllerFactories​

protected readonly controllerFactories: Map<string, ControllerFactory>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:347


deadZone?​

protected optional deadZone: Subscribable<Readonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">>>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:354


destroyCallbacks​

protected readonly destroyCallbacks: Map<string, (context) => void>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:351


initCallbacks​

protected readonly initCallbacks: Map<string, (context) => void>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:349


layerFactories​

protected readonly layerFactories: Map<string, LayerFactory>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:346


moduleFactories​

protected readonly moduleFactories: Map<string, ModuleFactory>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:345


nominalRangeEndpoints?​

protected optional nominalRangeEndpoints: Readonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:356


onAfterRenderCallbacks​

protected readonly onAfterRenderCallbacks: Map<string, (context) => void>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:350


projectedSize​

protected projectedSize: Subscribable<Readonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">>>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:353


range?​

protected optional range: number

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:357


targetOffset?​

protected optional targetOffset: Readonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:355


RESTRICTED_CONTEXT_KEYS​

protected readonly static RESTRICTED_CONTEXT_KEYS: Set<string>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:333

Accessors​

controllerCount​

Get Signature​

get controllerCount(): number

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:373

The number of map controllers added to this builder.

Returns​

number


layerCount​

Get Signature​

get layerCount(): number

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:367

The number of map layers added to this builder.

Returns​

number


moduleCount​

Get Signature​

get moduleCount(): number

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:361

The number of map model modules added to this builder.

Returns​

number

Methods​

build()​

build<UseModules, UseLayers, UseControllers, UseContext>(cssClass?): CompiledMapSystem<DefaultIfAny<UseModules, Modules>, DefaultIfAny<UseLayers, Layers>, DefaultIfAny<UseControllers, Controllers>, DefaultIfAny<UseContext, Context>>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:1748

Compiles a map. The compiled map consists of a map context, a rendered map (as a VNode), and a node reference to the rendered map component.

The compiled map will be bound to a model (accessible through the map context) which contains all the modules added to this builder.

The map will also contain all layers added to this builder, with layers assigned lower order values appearing below layers assigned greater order values. The layers can be retrieved by their keys from the map context.

All controllers added to this builder will be created with the map and hooked up to the map's lifecycle callbacks. The controllers can be retrieved by their keys from the map context.

Type Parameters​

Type ParameterDefault type
UseModules extends ModuleRecordany
UseLayers extends LayerRecordany
UseControllers extends ControllerRecordany
UseContext extends ContextRecordany

Parameters​

ParameterTypeDescription
cssClass?string | SubscribableSet<string>The CSS class(es) to apply to the root of the rendered map component.

Returns​

CompiledMapSystem<DefaultIfAny<UseModules, Modules>, DefaultIfAny<UseLayers, Layers>, DefaultIfAny<UseControllers, Controllers>, DefaultIfAny<UseContext, Context>>

A compiled map.


buildContext()​

protected buildContext(): object & Readonly<any> & object

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:1989

Builds a new map context. The map context will be initialized with all context properties and modules added to this builder.

Returns​

The new map context.


with()​

with<Builder, UseModules, UseLayers, UseContext>(builder, ...args): ConditionalReturn<DefaultIfAny<UseModules, Modules>, RequiredCustomBuilderModules<Builder>, DefaultIfAny<UseLayers, Layers>, RequiredCustomBuilderLayers<Builder>, DefaultIfAny<UseContext, Context>, RequiredCustomBuilderContext<Builder>, MapSystemBuilder<Modules, Layers, Controllers, Context>>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:1713

Configures this builder using a custom build step.

Type Parameters​

Type ParameterDefault type
Builder extends MapSystemCustomBuilder<any[], any, any, any>-
UseModulesany
UseLayers extends LayerRecordany
UseContextany

Parameters​

ParameterTypeDescription
builderBuilderA function which defines a custom build step.
...argsCustomBuilderArgs<Builder>Arguments to pass to the custom build function.

Returns​

ConditionalReturn<DefaultIfAny<UseModules, Modules>, RequiredCustomBuilderModules<Builder>, DefaultIfAny<UseLayers, Layers>, RequiredCustomBuilderLayers<Builder>, DefaultIfAny<UseContext, Context>, RequiredCustomBuilderContext<Builder>, MapSystemBuilder<Modules, Layers, Controllers, Context>>

This builder, after it has been configured.


withAirspaces()​

withAirspaces(cache, showTypes, selectRenderer, renderOrder, options?, order?): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:1599

Configures this builder to generate a map which displays airspaces.

If a facility loader has been added to the map context under the MapSystemKeys.FacilityLoader key, then it will be used to retrieve airspaces. Otherwise, a new default facility loader instance will be used instead.

Adds the following...

Context properties:

  • [MapSystemKeys.AirspaceManager]: GenericAirspaceRenderManager

Modules:

  • [MapSystemKeys.Airspace]: MapAirspaceModule

Layers:

  • [MapSystemKeys.Airspace]: MapAirspaceLayer

Parameters​

ParameterTypeDescription
cacheLodBoundaryCacheThe airspace cache to use to store airspaces retrieved for rendering.
showTypesMapAirspaceShowTypesThe airspace show types to define in the airspace module. Each show type will be assigned a Subject in the show property of the module. The Subject controls the visibility of airspace types included in its show type. Airspace types that are not included in any defined show type will never be displayed.
selectRenderer(airspace) => MapAirspaceRendererA function which selects a MapAirspaceRenderer
renderOrder(a, b) => numberA function which determines the rendering order of airspaces. The function should return a negative number when airspace a should be rendered before (below) airspace b, a positive number when airspace a should be rendered after (above) airspace b, and 0 when the relative render order of the two airspaces does not matter. If not defined, there will be no guarantee on the order in which airspaces are rendered.
options?Partial<Pick<MapAirspaceLayerProps, "maxSearchRadius" | "maxSearchItemCount" | "searchDebounceDelay" | "renderTimeBudget">>Options for the airspace layer. Option defaults are as follows: * maxSearchRadius: 10 nautical miles * maxSearchItemCount: 100 * searchDebounceDelay: 500 (milliseconds) * renderTimeBudget: 0.2 (milliseconds)
order?numberThe order to assign to the airspace layer. Layers with lower assigned order will be attached to the map before and appear below layers with greater assigned order values. Defaults to the number of layers already added to this builder.

Returns​

this

This builder, after it has been configured.


withAutopilotProps()​

withAutopilotProps(bindings?, updateFreq?): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:951

Configures this builder to add a module describing the player airplane's autopilot properties, and optionally binds the module's properties to external data.

Adds the following...

Modules:

  • [MapSystemKeys.AutopilotProps]: MapAutopilotPropsModule

Controllers:

  • [MapSystemKeys.AutopilotProps]: MapAutopilotPropsController (optional)

Parameters​

ParameterTypeDescription
bindings?Iterable<MapAutopilotPropsKey | MapAutopilotPropsControllerBinding, any, any>An iterable containing definitions of the bindings to create between the autopilot module's properties and external data. If not defined, then no bindings will be created.
updateFreq?number | Subscribable<number | null> | nullThe default frequency, in hertz, at which to update the module props from their bound data sources. This frequency, if defined, is applied to all bindings that do not explicitly define their own update frequencies. If the frequency is null, then updates will not be throttled by frequency - each property will be updated as soon as the value of its data source changes. If the frequency is not null, then each property will only be updated when the controller's onBeforeUpdated() method is called, and the frequency of updates will not exceed updateFreq. Ignored if bindings is undefined.

Returns​

this

This builder, after it has been configured.


withBindings()​

withBindings<UseModules, UseLayers, UseContext>(key, bindings, onDestroy?): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:659

Configures this builder to add a controller which maintains a list of bindings from source to target subscribables.

Type Parameters​

Type ParameterDefault type
UseModules extends ModuleRecordany
UseLayers extends LayerRecordany
UseContext extends ContextRecordany

Parameters​

ParameterTypeDescription
keystringThe key of the controller.
bindings(context) => Iterable<MapBinding>The bindings to maintain.
onDestroy?() => voidA function to execute when the controller is destroyed.

Returns​

this

This builder, after it has been configured.


withBing()​

withBing(bingId, options?, order?, cssClass?): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:1028

Configures this builder to generate a map which displays Bing Map terrain and weather.

Adds the following...

Modules:

  • [MapSystemKeys.TerrainColors]: MapTerrainColorsModule
  • [MapSystemKeys.Weather]: MapWxrModule

Layers:

  • [MapSystemKeys.Bing]: MapBingLayer

Parameters​

ParameterTypeDescription
bingIdstringThe ID to assign to the Bing Map instance bound to the layer.
options?Readonly<MapSystemBuilderBingLayerOptions>Options with which to configure the layer.
order?numberThe order value to assign to the Bing layer. Layers with lower assigned order will be attached to the map before and appear below layers with greater assigned order values. Defaults to the number of layers already added to the map builder.
cssClass?string | SubscribableSet<string>The CSS class(es) to apply to the flight plan canvas elements.

Returns​

this

This builder, after it has been configured.


withClockUpdate()​

withClockUpdate(updateFreq): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:689

Configures this builder to generate a map which is updated at a regular frequency based on event bus clock events.

Adds the following...

Context properties:

  • 'updateFreq': Subscribable<number>

Controllers:

  • [MapSystemKeys.ClockUpdate]: MapClockUpdateController.

Parameters​

ParameterTypeDescription
updateFreqnumber | Subscribable<number>The map's update frequency, in hertz, or a subscribable which provides it.

Returns​

this

This builder, after it has been configured.


withContext()​

withContext<UseContext>(key, factory): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:537

Adds a context property to this builder. When the builder compiles its map, all added properties will be available on the context. Properties are created on the context in the order they were added to the builder, and property factories have access to previously created properties on the context. If an existing property has been added to this builder with the same key, it will be replaced.

Type Parameters​

Type ParameterDefault type
UseContext extends ContextRecordany

Parameters​

ParameterTypeDescription
keystringThe key of the property to add.
factory(context) => anyA function which creates the value of the property.

Returns​

this

This builder, after the context property has been added.


withController()​

withController<Controller, UseModules, UseLayers, UseControllers, UseContext>(key, factory): ConditionalReturn<DefaultIfAny<UseModules, Modules>, RequiredControllerModules<Controller>, DefaultIfAny<UseLayers, Layers>, RequiredControllerLayers<Controller>, DefaultIfAny<UseContext, Context>, RequiredControllerContext<Controller>, MapSystemBuilder<Modules, Layers, Controllers, Context>>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:499

Adds a controller to this builder. When this builder compiles its map, all added controllers will be created and hooked up to the map's lifecycle callbacks. If an existing controller has been added to this builder with the same key, it will be replaced.

Type Parameters​

Type ParameterDefault type
Controller extends MapSystemController<any, any, any, any>-
UseModules extends ModuleRecordany
UseLayers extends LayerRecordany
UseControllers extends ControllerRecordany
UseContext extends ContextRecordany

Parameters​

ParameterTypeDescription
keystringThe key of the controller.
factory(context) => ControllerA function which creates the controller.

Returns​

ConditionalReturn<DefaultIfAny<UseModules, Modules>, RequiredControllerModules<Controller>, DefaultIfAny<UseLayers, Layers>, RequiredControllerLayers<Controller>, DefaultIfAny<UseContext, Context>, RequiredControllerContext<Controller>, MapSystemBuilder<Modules, Layers, Controllers, Context>>

This builder, after the map layer has been added, or never if this builder does not have all the modules required by the controller.


withDeadZone()​

withDeadZone(deadZone): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:408

Configures this builder to generate a map with a given dead zone.

Parameters​

ParameterTypeDescription
deadZoneReadonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">> | Subscribable<Readonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">>>The dead zone, as [left, top, right, bottom] in pixels, or a subscribable which provides it.

Returns​

this

This builder, after it has been configured.


withDestroy()​

withDestroy<UseModules, UseLayers, UseControllers, UseContext>(key, callback): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:613

Configures this builder to execute a callback function after a built map is destroyed. If an existing callback has been added to this builder with the same key, it will be replaced.

Type Parameters​

Type ParameterDefault type
UseModules extends ModuleRecordany
UseLayers extends LayerRecordany
UseControllers extends ControllerRecordany
UseContext extends ContextRecordany

Parameters​

ParameterTypeDescription
keystringThe key of the callback.
callback(context) => voidThe callback function to add.

Returns​

this

This builder, after the callback has been added.


withFlightPlan()​

withFlightPlan(configure, flightPlanner, planIndex, enableTextCulling, order?, cssClass?): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:1243

Configures this builder to generate a map which displays a flight plan. Waypoints displayed as part of the flight plan are rendered by a MapSystemWaypointsRenderer.

If a facility loader has been added to the map context under the MapSystemKeys.FacilityLoader key, then it will be used to retrieve facilities for the display of flight pan waypoints. Otherwise, a new default facility loader instance will be used instead.

Airport waypoints registered to the waypoint renderer by the flight plan layer will have at least as much data available from them as described by the AirportFacilityDataFlags bitflags saved to the map context's MapSystemKeys.WaypointRendererAirportDataFlags property. If the context property does not exist, then all possible data will be made available from the airport waypoints.

If a text layer has already been added to the builder, its order will be changed so that it is rendered above the waypoint layer. Otherwise, a text layer will be added to the builder after the waypoint layer.

Adds the following...

Context properties:

  • [MapSystemKeys.FlightPlanner]: FlightPlanner
  • [MapSystemKeys.TextManager]: MapCullableTextLabelManager
  • [MapSystemKeys.IconFactory]: MapSystemIconFactory
  • [MapSystemKeys.LabelFactory]: MapSystemLabelFactory
  • [MapSystemKeys.FlightPathRenderer]: MapSystemPlanRenderer

Modules:

  • [MapSystemKeys.FlightPlan]: MapFlightPlanModule

Layers:

  • `${[MapSystemKeys.FlightPlan]}${planIndex}`: MapSystemFlightPlanLayer
  • [MapSystemKeys.TextLayer]: MapCullableTextLayer

Controllers:

  • [MapSystemKeys.FlightPlan]: MapFlightPlanController

Parameters​

ParameterTypeDefault valueDescription
configure(builder, context) => voidundefinedA function to configure the waypoint display.
flightPlannerFlightPlannerundefinedThe flight planner.
planIndexnumberundefinedThe index of the flight plan to display.
enableTextCullingbooleanfalseWhether to enable text culling on the text manager.
order?numberundefinedThe order to assign to the plan layer. Layers with lower assigned order will be attached to the map before and appear below layers with greater assigned order values. Defaults to the number of layers already added to this builder.
cssClass?string | SubscribableSet<string>undefinedThe CSS class(es) to apply to the flight plan canvas elements.

Returns​

this

This builder, after it has been configured.


withFollowAirplane()​

withFollowAirplane(): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:745

Configures this builder to generate a map whose projection target follows the player airplane. The follow airplane behavior will be active if and only if the controller owns the projection target control resource. The controller's priority for the resource is 0.

Adds the following...

Context properties:

  • [MapSystemKeys.TargetControl]: ResourceModerator<void>

Modules:

  • [MapSystemKeys.OwnAirplaneProps]: MapOwnAirplanePropsModule
  • [MapSystemKeys.FollowAirplane]: MapFollowAirplaneModule

Controllers:

  • [MapSystemKeys.FollowAirplane]: MapFollowAirplaneController

Returns​

this

This builder, after it has been configured.


withInit()​

withInit<UseModules, UseLayers, UseControllers, UseContext>(key, callback): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:557

Configures this builder to execute a callback function immediately after it is finished compiling a map. If an existing callback has been added to this builder with the same key, it will be replaced.

Type Parameters​

Type ParameterDefault type
UseModules extends ModuleRecordany
UseLayers extends LayerRecordany
UseControllers extends ControllerRecordany
UseContext extends ContextRecordany

Parameters​

ParameterTypeDescription
keystringThe key of the callback.
callback(context) => voidThe callback function to add.

Returns​

this

This builder, after the callback has been added.


withLayer()​

withLayer<L, UseModules, UseContext>(key, factory, order?): ConditionalReturn<DefaultIfAny<UseModules, Modules>, RequiredLayerModules<L>, any, any, any, any, MapSystemBuilder<Modules, Layers, Controllers, Context>>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:472

Adds a map layer to this builder. When this builder compiles its map, all added layers will be created and attached to the map. Layers with a lower assigned order will be attached before and appear below layers with greater assigned order values. If an existing layer has been added to this builder with the same key, it will be replaced.

Type Parameters​

Type ParameterDefault type
L extends MapLayer<MapLayerProps<any>>any
UseModules extends ModuleRecordany
UseContext extends ContextRecordany

Parameters​

ParameterTypeDescription
keystringThe key of the layer.
factory(context) => VNodeA function which renders the layer as a VNode.
order?numberThe order assigned to the layer. Layers with lower assigned order will be attached to the map before and appear below layers with greater assigned order values. Defaults to the number of layers already added to this builder.

Returns​

ConditionalReturn<DefaultIfAny<UseModules, Modules>, RequiredLayerModules<L>, any, any, any, any, MapSystemBuilder<Modules, Layers, Controllers, Context>>

This builder, after the map layer has been added, or never if this builder does not have all the modules required by the layer.


withLayerOrder()​

withLayerOrder(key, order): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:640

Assigns an order value to a layer. Layers with a lower assigned order will be attached before and appear below layers with greater assigned order values.

Parameters​

ParameterTypeDescription
keykeyof Layers & stringThe key of the layer to which to assign the order value.
ordernumberThe order value to assign.

Returns​

this

This builder, after the order value has been assigned.


withModule()​

withModule<UseContext>(key, factory): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:451

Adds a map module to this builder. When this builder compiles its map, all added modules will be created and added to the map's model. If an existing module has been added to this builder with the same key, it will be replaced.

Type Parameters​

Type ParameterDefault type
UseContext extends ContextRecordany

Parameters​

ParameterTypeDescription
keystringThe key (name) of the module.
factory(context) => anyA function which creates the module.

Returns​

this

This builder, after the map module has been added.


withNearestWaypoints()​

withNearestWaypoints(configure, enableTextCulling, order?, cssClass?): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:1136

Configures this builder to generate a map which displays waypoints near the map center or target. Waypoints displayed in this manner are rendered by a MapSystemWaypointsRenderer.

If a facility loader has been added to the map context under the MapSystemKeys.FacilityLoader key, then it will be used to retrieve facilities for the display of nearest waypoints. Otherwise, a new default facility loader instance will be used instead.

Airport waypoints registered to the waypoint renderer by the waypoints layer will have at least as much data available from them as described by the AirportFacilityDataFlags bitflags saved to the map context's MapSystemKeys.WaypointRendererAirportDataFlags property. If the context property does not exist, then all possible data will be made available from the airport waypoints.

If a text layer has already been added to the builder, its order will be changed so that it is rendered above the waypoint layer. Otherwise, a text layer will be added to the builder after the waypoint layer.

Adds the following...

Context properties:

  • [MapSystemKeys.TextManager]: MapCullableTextLabelManager
  • [MapSystemKeys.IconFactory]: MapSystemIconFactory
  • [MapSystemKeys.LabelFactory]: MapSystemLabelFactory

Modules:

  • [MapSystemKeys.NearestWaypoints]: MapWaypointDisplayModule

Layers:

  • [MapSystemKeys.NearestWaypoints]: MapSystemWaypointsLayer
  • [MapSystemKeys.TextLayer]: MapCullableTextLayer

Parameters​

ParameterTypeDefault valueDescription
configure(builder) => voidundefinedA function to configure the waypoint display.
enableTextCullingbooleanfalseWhether to enable text culling on the text manager.
order?numberundefinedThe order to assign to the waypoint layer. Layers with lower assigned order will be attached to the map before and appear below layers with greater assigned order values. Defaults to the number of layers already added to this builder.
cssClass?string | SubscribableSet<string>undefinedThe CSS class(es) to apply to the root of the nearest waypoints layer.

Returns​

this

This builder, after it has been configured.


withOnAfterRender()​

withOnAfterRender<UseModules, UseLayers, UseControllers, UseContext>(key, callback): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:586

Configures this builder to execute a callback function immediately after the map has been rendered to DOM. The function is guaranteed to be called after the onAttached() callbacks of all map layers and the onAfterRender() callbacks of all map controllers have been called. If an existing callback has been added to this builder with the same key, it will be replaced.

Type Parameters​

Type ParameterDefault type
UseModules extends ModuleRecordany
UseLayers extends LayerRecordany
UseControllers extends ControllerRecordany
UseContext extends ContextRecordany

Parameters​

ParameterTypeDescription
keystringThe key of the callback.
callback(context) => voidThe callback function to add.

Returns​

this

This builder, after the callback has been added.


withOwnAirplaneIcon()​

withOwnAirplaneIcon(iconSize, iconFilePath, iconAnchor, cssClass?, order?): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:808

Configures this builder to generate a map which displays an icon depicting the position of the player airplane.

Adds the following...

Modules:

  • [MapSystemKeys.OwnAirplaneProps]: MapOwnAirplanePropsModule
  • [MapSystemKeys.OwnAirplaneIcon]: MapOwnAirplaneIconModule

Layers:

  • [MapSystemKeys.OwnAirplaneIcon]: MapOwnAirplaneLayer

Parameters​

ParameterTypeDescription
iconSizenumber | Subscribable<number>The size of the icon, in pixels.
iconFilePathstring | Subscribable<string>The path to the icon's image asset, or a subscribable which provides it.
iconAnchorReadonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">> | Subscribable<Readonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">>>The point on the icon that is anchored to the airplane's position, or a subscribable which provides it. The point is expressed as a 2-tuple relative to the icon's width and height, with [0, 0] at the top left and [1, 1] at the bottom right.
cssClass?string | SubscribableSet<string>The CSS class(es) to apply to the root of the airplane icon layer.
order?numberThe order assigned to the icon layer. Layers with lower assigned order will be attached to the map before and appear below layers with greater assigned order values. Defaults to the number of layers already added to this builder.

Returns​

this

This builder, after it has been configured.


withOwnAirplaneIconAndGhostIcon()​

withOwnAirplaneIconAndGhostIcon(options, cssClass?, order?): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:851

Configures this builder to generate a map which displays an icon depicting the position of the player airplane. Includes a configurable "ghost" icon which appears when the player airplane is out of bounds.

Adds the following...

Modules:

  • [MapSystemKeys.OwnAirplaneProps]: MapOwnAirplanePropsModule
  • [MapSystemKeys.OwnAirplaneIcon]: MapOwnAirplaneIconModule

Layers:

  • [MapSystemKeys.OwnAirplaneIcon]: MapOwnAirplaneWithGhostIconLayer

Parameters​

ParameterTypeDescription
optionsMapSystemOwnAirplaneWithGhostIconLayerOptionsThe options for this layer.
cssClass?string | SubscribableSet<string>The CSS class(es) to apply to the root of the airplane icon layer.
order?numberThe order assigned to the icon layer. Layers with lower assigned order will be attached to the map before and appear below layers with greater assigned order values. Defaults to the number of layers already added to this builder.

Returns​

this

This builder, after it has been configured.


withOwnAirplaneIconOrientation()​

withOwnAirplaneIconOrientation<UseModules>(desiredOrientation): ConditionalReturn<DefaultIfAny<UseModules, Modules>, MapOwnAirplaneIconOrientationControllerModules, any, any, any, any, MapSystemBuilder<Modules, Layers, Controllers, Context>>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:884

Configures this builder to add a controller which controls and optimizes the orientation of the own airplane icon in response to a desired orientation and the map rotation type. If the desired orientation matches the map rotation (e.g. both Heading Up), the icon orientation is set to Map Up; otherwise the orientation is set to the desired orientation.

Requires the modules [MapSystemKeys.OwnAirplaneIcon]: MapOwnAirplaneIconModule and [MapSystemKeys.Rotation]: MapRotationModule.

Adds the controller [MapSystemKeys.OwnAirplaneIconOrientation]: MapOwnAirplaneIconOrientationController.

Type Parameters​

Type ParameterDefault type
UseModulesany

Parameters​

ParameterTypeDescription
desiredOrientationMapOwnAirplaneIconOrientation | Subscribable<MapOwnAirplaneIconOrientation>The desired orientation of the own airplane icon.

Returns​

ConditionalReturn<DefaultIfAny<UseModules, Modules>, MapOwnAirplaneIconOrientationControllerModules, any, any, any, any, MapSystemBuilder<Modules, Layers, Controllers, Context>>

This builder, after it has been configured.


withOwnAirplanePropBindings()​

withOwnAirplanePropBindings<UseModules>(bindings, updateFreq?): ConditionalReturn<DefaultIfAny<UseModules, Modules>, MapOwnAirplanePropsControllerModules, any, any, any, any, MapSystemBuilder<Modules, Layers, Controllers, Context>>

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:914

Configures this builder to bind properties in an added MapOwnAirplanePropsModule to external data.

Requires the module [MapSystemKeys.OwnAirplaneProps]: MapOwnAirplanePropsModule.

Adds the controller [MapSystemKeys.OwnAirplaneProps]: MapOwnAirplanePropsController.

Type Parameters​

Type ParameterDefault type
UseModulesany

Parameters​

ParameterTypeDescription
bindingsIterable<MapOwnAirplanePropsKey | MapOwnAirplanePropsControllerBinding>An iterable containing definitions of the bindings to create.
updateFreq?number | Subscribable<number | null> | nullThe default frequency, in hertz, at which to update the module props from their bound data sources. This frequency, if defined, is applied to all bindings that do not explicitly define their own update frequencies. If the frequency is null, then updates will not be throttled by frequency - each property will be updated as soon as the value of its data source changes. If the frequency is not null, then each property will only be updated when the controller's onBeforeUpdated() method is called, and the frequency of updates will not exceed updateFreq.

Returns​

ConditionalReturn<DefaultIfAny<UseModules, Modules>, MapOwnAirplanePropsControllerModules, any, any, any, any, MapSystemBuilder<Modules, Layers, Controllers, Context>>

This builder, after it has been configured.


withProjectedSize()​

withProjectedSize(size): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:398

Configures this builder to generate a map with a given projected window size.

Parameters​

ParameterTypeDescription
sizeReadonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">> | Subscribable<Readonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">>>The size of the projected window, as [width, height] in pixels, or a subscribable which provides it.

Returns​

this

This builder, after it has been configured.


withRange()​

withRange(range): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:439

Configures this build to generate a map with a specific initial range.

Parameters​

ParameterTypeDescription
rangeNumberUnitInterface<Distance>The initial range.

Returns​

this

This builder, after it has been configured.


withRangeControlModerator()​

withRangeControlModerator(): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:723

Configures this builder to add a resource moderator for control of the map's range.

Adds the context property [MapSystemKeys.RangeControl]: ResourceModerator<void>.

Returns​

this

This builder, after the resource moderator has been added.


withRangeEndpoints()​

withRangeEndpoints(endpoints): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:429

Configures this builder to generate a map with specific initial range endpoints. The endpoints are defined relative to the width and height of the map's projected window, excluding the dead zone.

Parameters​

ParameterTypeDescription
endpointsReadonlyFloat64ArrayThe initial range endpoints, as [x1, y1, x2, y2].

Returns​

this

This builder, after it has been configured.


withRotation()​

withRotation(): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:776

Configures this builder to generate a map which supports common rotation behavior. The rotation behavior will be active if and only if the controller owns the rotation control resource. The controller's priority for the resource is 0.

Requires the module 'ownAirplaneProps': MapOwnAirplanePropsModule to support player airplane-derived rotation behavior, such as Heading Up and Track Up.

Adds the following...

Context properties:

  • '[MapSystemKeys.RotationControl]': ResourceModerator<void>

Modules:

  • [MapSystemKeys.Rotation]: MapRotationModule

Controllers:

  • [MapSystemKeys.Rotation]: MapRotationController

Returns​

this

This builder, after it has been configured.


withRotationControlModerator()​

withRotationControlModerator(): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:713

Configures this builder to add a resource moderator for control of the map's rotation.

Adds the context property [MapSystemKeys.RotationControl]: ResourceModerator<void>.

Returns​

this

This builder, after the resource moderator has been added.


withSharedFlightPlanDefinition()​

withSharedFlightPlanDefinition(planIndex, waypointFactory, configure): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:1530

Configures this builder to provide a definition for displaying a flight plan in a shared flight plan layer. The definition is added to the map stored in the map context under the MapSystemKeys.FlightPlan key.

Parameters​

ParameterTypeDescription
planIndexnumberThe index of the flight plan to display.
waypointFactoryMapSystemSharedFlightPlanWaypointFactoryA factory from which to get waypoints for flight plan legs to display.
configure(builder, context) => voidA function to configure the display of the flight plan.

Returns​

this

The map builder, after it has been configured.


withSharedFlightPlans()​

withSharedFlightPlans<UseContext>(flightPlanner, options?, order?, cssClass?): DefaultIfAny<UseContext, Context> extends object ? MapSystemBuilder<Modules, Layers, Controllers, Context> : never

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:1377

Configures this builder to generate a map which displays flight plans using a shared layer. Waypoints displayed as part of the flight plan are rendered by a MapSystemWaypointsRenderer.

Airport waypoints registered to the waypoint renderer by the flight plan layer will have at least as much data available from them as described by the AirportFacilityDataFlags bitflags saved to the map context's MapSystemKeys.WaypointRendererAirportDataFlags property. If the context property does not exist, then all possible data will be made available from the airport waypoints.

If a text layer has already been added to the builder, then its order will be changed so that it is rendered above the flight plan layer. Otherwise, a text layer will be added to the builder after the flight plan layer.

The flight plans to display are taken from the map context property under the MapSystemKeys.FlightPlan key. The property should be a map of MapSystemSharedFlightPlanDefinition objects, keyed by flight plan index. Each definition object describes the display of a single flight plan. It is recommended to use the withSharedFlightPlanDefinition() build step to add flight plans to display.

Requires the following context properties:

  • [MapSystemKeys.FacilityLoader]: FacilityLoader

Adds the following...

Context properties:

  • [MapSystemKeys.FlightPlanner]: FlightPlanner
  • [MapSystemKeys.TextManager]: MapCullableTextLabelManager
  • [MapSystemKeys.IconFactory]: MapSystemIconFactory
  • [MapSystemKeys.LabelFactory]: MapSystemLabelFactory
  • [MapSystemKeys.FlightPathRenderer]: MapSystemPlanRenderer

Modules:

  • [MapSystemKeys.FlightPlan]: MapFlightPlanModule

Layers:

  • [MapSystemKeys.FlightPlan]: MapSystemSharedFlightPlanLayer`
  • [MapSystemKeys.TextLayer]: MapCullableTextLayer

Controllers:

  • [MapSystemKeys.FlightPlan]: MapFlightPlanController

Type Parameters​

Type ParameterDefault type
UseContextany

Parameters​

ParameterTypeDescription
flightPlannerFlightPlannerThe flight planner.
options?Readonly<MapSystemSharedFlightPlansOptions>Options with which to configure the layer.
order?numberThe order to assign to the shared flight plan layer. Layers with lower assigned order will be attached to the map before and appear below layers with greater assigned order values. Defaults to the number of layers already added to this builder.
cssClass?string | SubscribableSet<string>CSS class(es) to apply to the shared flight plan layer.

Returns​

DefaultIfAny<UseContext, Context> extends object ? MapSystemBuilder<Modules, Layers, Controllers, Context> : never

This builder, after it has been configured.


withTargetControlModerator()​

withTargetControlModerator(): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:703

Configures this builder to add a resource moderator for control of the map's projection target.

Adds the context property [MapSystemKeys.TargetControl]: ResourceModerator<void>.

Returns​

this

This builder, after the resource moderator has been added.


withTargetOffset()​

withTargetOffset(offset): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:418

Configures this builder to generate a map with an initial projected target offset.

Parameters​

ParameterTypeDescription
offsetReadonlyFloat64ArrayThe initial projected target offset, as [x, y] in pixels.

Returns​

this

This builder, after it has been configured.


withTextLayer()​

withTextLayer(enableCulling, order?, cssClass?): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:988

Configures this builder to generate a map which includes a layer displaying text.

Adds the following...

Context properties:

  • [MapSystemKeys.TextManager]: MapCullableTextLabelManager

Layers:

  • [MapSystemKeys.TextLayer]: MapCullableTextLayer

Parameters​

ParameterTypeDescription
enableCullingbooleanWhether to enable text culling. Defaults to false.
order?numberThe order value to assign to the text layer. Layers with lower assigned order will be attached to the map before and appear below layers with greater assigned order values. Defaults to the number of layers already added to this builder.
cssClass?string | SubscribableSet<string>The CSS class(es) to apply to the text layer.

Returns​

this

This builder, after it has been configured.


withTraffic()​

withTraffic<UseModules, UseLayers, UserControllers, UseContext>(tcas, iconFactory, initCanvasStyles?, offScaleOobOptions?, order?, cssClass?): this

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:1658

Configures this builder to generate a map which displays TCAS intruders.

Adds the following...

Modules:

  • [MapSystemKeys.OwnAirplaneProps]: MapOwnAirplanePropsModule
  • [MapSystemKeys.Traffic]: MapTrafficModule

Layers:

  • [MapSystemKeys.Traffic]: MapSystemTrafficLayer

Type Parameters​

Type ParameterDefault type
UseModules extends ModuleRecordany
UseLayers extends LayerRecordany
UserControllers extends ControllerRecordany
UseContext extends ContextRecordany

Parameters​

ParameterTypeDescription
tcasTcasThe TCAS used by the traffic display.
iconFactoryMapTrafficIntruderIconFactory<DefaultIfAny<UseModules, Modules>, DefaultIfAny<UseLayers, Layers>, DefaultIfAny<UserControllers, Controllers>, DefaultIfAny<UseContext, Context>>A function which creates intruder icons for the traffic display.
initCanvasStyles?(context) => voidA function which initializes global canvas styles for the traffic display.
offScaleOobOptions?(context) => MapSystemBuilderTrafficOffScaleOobOptionsA function which generates options for handling off-scale and out-of-bounds intruders.
order?numberThe order to assign to the traffic layer. Layers with lower assigned order will be attached to the map before and appear below layers with greater assigned order values. Defaults to the number of layers already added to this builder.
cssClass?string | SubscribableSet<string>The CSS class(es) to apply to the root of the traffic component.

Returns​

this

This builder, after it has been configured.


withWaypoints()​

withWaypoints<UseContext>(): DefaultIfAny<UseContext, Context> extends object ? MapSystemBuilder<Modules, Layers, Controllers, Context> : never

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:1072

Configures this builder to generate a map which uses a MapSystemWaypointsRenderer to render waypoints.

Requires the [MapSystemKeys.TextManager]: MapCullableTextLabelManager context property.

Adds the [MapSystemKeys.WaypointRenderer]: MapSystemWaypointsRenderer context property.

Type Parameters​

Type ParameterDefault type
UseContextany

Returns​

DefaultIfAny<UseContext, Context> extends object ? MapSystemBuilder<Modules, Layers, Controllers, Context> : never

This builder, after it has been configured.


create()​

static create(bus): MapSystemBuilder

Defined in: src/sdk/components/mapsystem/MapSystemBuilder.tsx:389

Creates a new Garmin map builder. The builder is initialized with a default projected size of [100, 100] pixels.

Parameters​

ParameterTypeDescription
busEventBusThe event bus.

Returns​

MapSystemBuilder

A new Garmin map builder.