Class: MapSystemBuilder<Modules, Layers, Controllers, Context>
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
Name | Type |
---|---|
Modules | extends ModuleRecord = any |
Layers | extends LayerRecord = any |
Controllers | extends ControllerRecord = any |
Context | extends ContextRecord = any |
Constructors
constructor
• new MapSystemBuilder<Modules
, Layers
, Controllers
, Context
>(bus
): MapSystemBuilder
<Modules
, Layers
, Controllers
, Context
>
Creates an instance of a map system builder.
Type parameters
Name | Type |
---|---|
Modules | extends ModuleRecord = any |
Layers | extends LayerRecord = any |
Controllers | extends ControllerRecord = any |
Context | extends ContextRecord = any |
Parameters
Name | Type | Description |
---|---|---|
bus | EventBus | This builder's event bus. |
Returns
MapSystemBuilder
<Modules
, Layers
, Controllers
, Context
>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:246
Properties
bus
• Readonly
bus: EventBus
This builder's event bus.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:246
contextFactories
• Protected
Readonly
contextFactories: Map
<string
, ContextFactory
>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:214
controllerFactories
• Protected
Readonly
controllerFactories: Map
<string
, ControllerFactory
>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:213
deadZone
• Protected
Optional
deadZone: Subscribable
<Readonly
<Omit
<Float64Array
, "set"
| "sort"
| "copyWithin"
>>>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:219
destroyCallbacks
• Protected
Readonly
destroyCallbacks: Map
<string
, (context
: MapSystemContext
<any
, any
, any
, any
>) => void
>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:216
initCallbacks
• Protected
Readonly
initCallbacks: Map
<string
, (context
: MapSystemContext
<any
, any
, any
, any
>) => void
>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:215
layerFactories
• Protected
Readonly
layerFactories: Map
<string
, LayerFactory
>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:212
moduleFactories
• Protected
Readonly
moduleFactories: Map
<string
, ModuleFactory
>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:211
nominalRangeEndpoints
• Protected
Optional
nominalRangeEndpoints: Readonly
<Omit
<Float64Array
, "set"
| "sort"
| "copyWithin"
>>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:221
projectedSize
• Protected
projectedSize: Subscribable
<Readonly
<Omit
<Float64Array
, "set"
| "sort"
| "copyWithin"
>>>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:218
range
• Protected
Optional
range: number
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:222
targetOffset
• Protected
Optional
targetOffset: Readonly
<Omit
<Float64Array
, "set"
| "sort"
| "copyWithin"
>>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:220
RESTRICTED_CONTEXT_KEYS
▪ Static
Protected
Readonly
RESTRICTED_CONTEXT_KEYS: Set
<string
>
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:199
Accessors
controllerCount
• get
controllerCount(): number
The number of map controllers added to this builder.
Returns
number
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:238
layerCount
• get
layerCount(): number
The number of map layers added to this builder.
Returns
number
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:232
moduleCount
• get
moduleCount(): number
The number of map model modules added to this builder.
Returns
number
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:226
Methods
build
▸ build<UseModules
, UseLayers
, UseControllers
, UseContext
>(cssClass?
): CompiledMapSystem
<DefaultIfAny
<UseModules
, Modules
>, DefaultIfAny
<UseLayers
, Layers
>, DefaultIfAny
<UseControllers
, Controllers
>, DefaultIfAny
<UseContext
, Context
>>
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
Name | Type |
---|---|
UseModules | extends ModuleRecord = any |
UseLayers | extends LayerRecord = any |
UseControllers | extends ControllerRecord = any |
UseContext | extends ContextRecord = any |
Parameters
Name | Type | Description |
---|---|---|
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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:1265
buildContext
▸ buildContext(): { bus
: EventBus
; deadZone
: Subscribable
<Readonly
<Omit
<Float64Array
, "set"
| "sort"
| "copyWithin"
>>> ; model
: MapModel
<any
> ; projectedSize
: Subscribable
<Readonly
<Omit
<Float64Array
, "set"
| "sort"
| "copyWithin"
>>> ; projection
: MapProjection
; getController
: <K>(key
: K
) => any
; getLayer
: <K>(key
: K
) => any
} & Readonly
<any
> & { setController
: <K>(key
: K
, controller
: any
) => void
; setLayer
: <K>(key
: K
, layer
: any
) => void
}
Builds a new map context. The map context will be initialized with all context properties and modules added to this builder.
Returns
{ bus
: EventBus
; deadZone
: Subscribable
<Readonly
<Omit
<Float64Array
, "set"
| "sort"
| "copyWithin"
>>> ; model
: MapModel
<any
> ; projectedSize
: Subscribable
<Readonly
<Omit
<Float64Array
, "set"
| "sort"
| "copyWithin"
>>> ; projection
: MapProjection
; getController
: <K>(key
: K
) => any
; getLayer
: <K>(key
: K
) => any
} & Readonly
<any
> & { setController
: <K>(key
: K
, controller
: any
) => void
; setLayer
: <K>(key
: K
, layer
: any
) => void
}
The new map context.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:1494
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
>>
Configures this builder using a custom build step.
Type parameters
Name | Type |
---|---|
Builder | extends MapSystemCustomBuilder <any [], any , any , any > |
UseModules | any |
UseLayers | extends LayerRecord = any |
UseContext | any |
Parameters
Name | Type | Description |
---|---|---|
builder | Builder | A function which defines a custom build step. |
...args | CustomBuilderArgs <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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:1230
withAirspaces
▸ withAirspaces(cache
, showTypes
, selectRenderer
, renderOrder?
, options?
, order?
): this
Configures this builder to generate a map which displays airspaces.
Adds the following...
Context properties:
[MapSystemKeys.AirspaceManager]: GenericAirspaceRenderManager
Modules:
[MapSystemKeys.Airspace]: MapAirspaceModule
Layers:
[MapSystemKeys.Airspace]: MapAirspaceLayer
Parameters
Name | Type | Description |
---|---|---|
cache | LodBoundaryCache | The airspace cache to use to store airspaces retrieved for rendering. |
showTypes | MapAirspaceShowTypes | The 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 : LodBoundary ) => MapAirspaceRenderer | A function which selects a MapAirspaceRenderer |
renderOrder | (a : LodBoundary , b : LodBoundary ) => number | A 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? | number | The 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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:1120
withAutopilotProps
▸ withAutopilotProps(propertiesToBind?
, updateFreq?
): this
Configures this builder to add a module describing the player airplane's autopilot properties, and optionally binds the module's properties to data received over the event bus.
Adds the following...
Modules:
[MapSystemKeys.AutopilotProps]: MapAutopilotPropsModule
Controllers:
[MapSystemKeys.AutopilotProps]: MapAutopilotPropsController
(optional)
Parameters
Name | Type | Description |
---|---|---|
propertiesToBind? | Iterable <MapAutopilotPropsKey > | Properties on the autopilot module to bind to data received over the event bus. |
updateFreq? | number | Subscribable <number > | The update frequency, in hertz, of the data bindings, or a subscribable which provides it. If not defined, the data bindings will update every frame. Ignored if propertiesToBind is undefined. |
Returns
this
This builder, after it has been configured.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:736
withBindings
▸ withBindings<UseModules
, UseLayers
, UseContext
>(key
, bindings
, onDestroy?
): this
Configures this builder to add a controller which maintains a list of bindings from source to target subscribables.
Type parameters
Name | Type |
---|---|
UseModules | extends ModuleRecord = any |
UseLayers | extends LayerRecord = any |
UseContext | extends ContextRecord = any |
Parameters
Name | Type | Description |
---|---|---|
key | string | The key of the controller. |
bindings | (context : MapSystemContext <DefaultIfAny <UseModules , Modules >, DefaultIfAny <UseLayers , Layers >, EmptyRecord , DefaultIfAny <UseContext , Context >>) => Iterable <MapBinding > | The bindings to maintain. |
onDestroy? | () => void | A function to execute when the controller is destroyed. |
Returns
this
This builder, after it has been configured.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:492
withBing
▸ withBing(bingId
, delay?
, mode?
, order?
, cssClass?
, opacity?
): this
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
Name | Type | Default value | Description |
---|---|---|---|
bingId | string | undefined | The ID to assign to the Bing Map instance bound to the layer. |
delay | number | 0 | The delay, in milliseconds, to wait after the Bing layer has been rendered before attempting to bind a Bing Map instance. |
mode? | EBingMode | undefined | The mode of the map, optional. If omitted, will be EBingMode.PLANE. |
order? | number | undefined | The 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 > | undefined | The CSS class(es) to apply to the root of the map bing layer. |
opacity? | Subscribable <number > | undefined | The opacity to apply to the layer. If not defined, control of opacity will be left to CSS. |
Returns
this
This builder, after it has been configured.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:813
withClockUpdate
▸ withClockUpdate(updateFreq
): this
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
Name | Type | Description |
---|---|---|
updateFreq | number | Subscribable <number > | The map's update frequency, in hertz, or a subscribable which provides it. |
Returns
this
This builder, after it has been configured.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:522
withContext
▸ withContext<UseContext
>(key
, factory
): this
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
Name | Type |
---|---|
UseContext | extends ContextRecord = any |
Parameters
Name | Type | Description |
---|---|---|
key | string | The key of the property to add. |
factory | (context : MapSystemContext <Record <never , never >, Record <never , never >, Record <never , never >, DefaultIfAny <UseContext , Context >>) => any | A function which creates the value of the property. |
Returns
this
This builder, after the context property has been added.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:399
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
>>
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
Name | Type |
---|---|
Controller | extends MapSystemController <any , any , any , any > |
UseModules | extends ModuleRecord = any |
UseLayers | extends LayerRecord = any |
UseControllers | extends ControllerRecord = any |
UseContext | extends ContextRecord = any |
Parameters
Name | Type | Description |
---|---|---|
key | string | The key of the controller. |
factory | (context : MapSystemContext <DefaultIfAny <UseModules , Modules >, DefaultIfAny <UseLayers , Layers >, DefaultIfAny <UseControllers , Controllers >, DefaultIfAny <UseContext , Context >>) => Controller | A 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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:361
withDeadZone
▸ withDeadZone(deadZone
): this
Configures this builder to generate a map with a given dead zone.
Parameters
Name | Type | Description |
---|---|---|
deadZone | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | Subscribable <Readonly <Omit <Float64Array , "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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:273
withDestroy
▸ withDestroy<UseModules
, UseLayers
, UseControllers
, UseContext
>(key
, callback
): this
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
Name | Type |
---|---|
UseModules | extends ModuleRecord = any |
UseLayers | extends LayerRecord = any |
UseControllers | extends ControllerRecord = any |
UseContext | extends ContextRecord = any |
Parameters
Name | Type | Description |
---|---|---|
key | string | The key of the callback. |
callback | (context : MapSystemContext <DefaultIfAny <UseModules , Modules >, DefaultIfAny <UseLayers , Layers >, DefaultIfAny <UseControllers , Controllers >, DefaultIfAny <UseContext , Context >>) => void | The callback function to add. |
Returns
this
This builder, after the callback has been added.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:446
withFlightPlan
▸ withFlightPlan(configure
, flightPlanner
, planIndex
, enableTextCulling?
, order?
, cssClass?
): this
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 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
Name | Type | Default value | Description |
---|---|---|---|
configure | (builder : FlightPlanDisplayBuilder , context : MapSystemContext <{ flightPlan : MapFlightPlanModule }, any , any , { flightPathRenderer : MapSystemPlanRenderer ; iconFactory : MapSystemIconFactory ; labelFactory : MapSystemLabelFactory ; waypointRenderer : MapSystemWaypointsRenderer }>) => void | undefined | A function to configure the waypoint display. |
flightPlanner | FlightPlanner <any > | undefined | The flight planner. |
planIndex | number | undefined | The index of the flight plan to display. |
enableTextCulling | boolean | false | Whether to enable text culling on the text manager. |
order? | number | undefined | The 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 > | undefined | The CSS class(es) to apply to the flight plan canvas elements. |
Returns
this
This builder, after it has been configured.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:1005
withFollowAirplane
▸ withFollowAirplane(): this
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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:578
withInit
▸ withInit<UseModules
, UseLayers
, UseControllers
, UseContext
>(key
, callback
): this
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
Name | Type |
---|---|
UseModules | extends ModuleRecord = any |
UseLayers | extends LayerRecord = any |
UseControllers | extends ControllerRecord = any |
UseContext | extends ContextRecord = any |
Parameters
Name | Type | Description |
---|---|---|
key | string | The key of the callback. |
callback | (context : MapSystemContext <DefaultIfAny <UseModules , Modules >, DefaultIfAny <UseLayers , Layers >, DefaultIfAny <UseControllers , Controllers >, DefaultIfAny <UseContext , Context >>) => void | The callback function to add. |
Returns
this
This builder, after the callback has been added.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:419
withLayer
▸ withLayer<L
, UseModules
, UseContext
>(key
, factory
, order?
): ConditionalReturn
<DefaultIfAny
<UseModules
, Modules
>, RequiredLayerModules
<L
>, any
, any
, any
, any
, MapSystemBuilder
<Modules
, Layers
, Controllers
, Context
>>
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
Name | Type |
---|---|
L | extends MapLayer <MapLayerProps <any >> = any |
UseModules | extends ModuleRecord = any |
UseContext | extends ContextRecord = any |
Parameters
Name | Type | Description |
---|---|---|
key | string | The key of the layer. |
factory | (context : MapSystemContext <DefaultIfAny <UseModules , Modules >, EmptyRecord , EmptyRecord , DefaultIfAny <UseContext , Context >>) => VNode | A function which renders the layer as a VNode. |
order? | number | The 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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:334
withLayerOrder
▸ withLayerOrder(key
, order
): this
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
Name | Type | Description |
---|---|---|
key | keyof Layers & string | The key of the layer to which to assign the order value. |
order | number | The order value to assign. |
Returns
this
This builder, after the order value has been assigned.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:473
withModule
▸ withModule(key
, factory
): this
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.
Parameters
Name | Type | Description |
---|---|---|
key | string | The key (name) of the module. |
factory | () => any | A function which creates the module. |
Returns
this
This builder, after the map module has been added.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:316
withNearestWaypoints
▸ withNearestWaypoints(configure
, enableTextCulling?
, order?
, cssClass?
): this
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 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
Name | Type | Default value | Description |
---|---|---|---|
configure | (builder : WaypointDisplayBuilder ) => void | undefined | A function to configure the waypoint display. |
enableTextCulling | boolean | false | Whether to enable text culling on the text manager. |
order? | number | undefined | The 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 > | undefined | The CSS class(es) to apply to the root of the nearest waypoints layer. |
Returns
this
This builder, after it has been configured.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:911
withOwnAirplaneIcon
▸ withOwnAirplaneIcon(iconSize
, iconFilePath
, iconAnchor
, cssClass?
, order?
): this
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
Name | Type | Description |
---|---|---|
iconSize | number | Subscribable <number > | The size of the icon, in pixels. |
iconFilePath | string | Subscribable <string > | The path to the icon's image asset, or a subscribable which provides it. |
iconAnchor | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | Subscribable <Readonly <Omit <Float64Array , "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? | number | The 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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:641
withOwnAirplaneIconOrientation
▸ withOwnAirplaneIconOrientation<UseModules
>(desiredOrientation
): ConditionalReturn
<DefaultIfAny
<UseModules
, Modules
>, MapOwnAirplaneIconOrientationControllerModules
, any
, any
, any
, any
, MapSystemBuilder
<Modules
, Layers
, Controllers
, Context
>>
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
Name | Type |
---|---|
UseModules | any |
Parameters
Name | Type | Description |
---|---|---|
desiredOrientation | MapOwnAirplaneIconOrientation | 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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:678
withOwnAirplanePropBindings
▸ withOwnAirplanePropBindings<UseModules
>(properties
, updateFreq
): ConditionalReturn
<DefaultIfAny
<UseModules
, Modules
>, MapOwnAirplanePropsControllerModules
, any
, any
, any
, any
, MapSystemBuilder
<Modules
, Layers
, Controllers
, Context
>>
Configures this builder to bind properties in an added MapOwnAirplanePropsModule to data derived from event bus events.
Requires the module [MapSystemKeys.OwnAirplaneProps]: MapOwnAirplanePropsModule
.
Adds the controller [MapSystemKeys.OwnAirplaneProps]: MapOwnAirplanePropsController
.
Type parameters
Name | Type |
---|---|
UseModules | any |
Parameters
Name | Type | Description |
---|---|---|
properties | Iterable <MapOwnAirplanePropsKey > | The properties to bind. |
updateFreq | number | Subscribable <number > | The update frequency, in hertz, or a subscribable which provides it. |
Returns
ConditionalReturn
<DefaultIfAny
<UseModules
, Modules
>, MapOwnAirplanePropsControllerModules
, any
, any
, any
, any
, MapSystemBuilder
<Modules
, Layers
, Controllers
, Context
>>
This builder, after it has been configured.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:704
withProjectedSize
▸ withProjectedSize(size
): this
Configures this builder to generate a map with a given projected window size.
Parameters
Name | Type | Description |
---|---|---|
size | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | Subscribable <Readonly <Omit <Float64Array , "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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:263
withRange
▸ withRange(range
): this
Configures this build to generate a map with a specific initial range.
Parameters
Name | Type | Description |
---|---|---|
range | NumberUnitInterface <Distance , Unit <Distance >> | The initial range. |
Returns
this
This builder, after it has been configured.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:304
withRangeControlModerator
▸ withRangeControlModerator(): this
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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:556
withRangeEndpoints
▸ withRangeEndpoints(endpoints
): this
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
Name | Type | Description |
---|---|---|
endpoints | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The initial range endpoints, as [x1, y1, x2, y2] . |
Returns
this
This builder, after it has been configured.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:294
withRotation
▸ withRotation(): this
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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:609
withRotationControlModerator
▸ withRotationControlModerator(): this
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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:546
withTargetControlModerator
▸ withTargetControlModerator(): this
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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:536
withTargetOffset
▸ withTargetOffset(offset
): this
Configures this builder to generate a map with an initial projected target offset.
Parameters
Name | Type | Description |
---|---|---|
offset | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The initial projected target offset, as [x, y] in pixels. |
Returns
this
This builder, after it has been configured.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:283
withTextLayer
▸ withTextLayer(enableCulling
, order?
, cssClass?
): this
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
Name | Type | Description |
---|---|---|
enableCulling | boolean | Whether to enable text culling. Defaults to false . |
order? | number | The 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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:773
withTraffic
▸ withTraffic<UseModules
, UseLayers
, UserControllers
, UseContext
>(tcas
, iconFactory
, initCanvasStyles?
, offScaleOobOptions?
, order?
, cssClass?
): this
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
Name | Type |
---|---|
UseModules | extends ModuleRecord = any |
UseLayers | extends LayerRecord = any |
UserControllers | extends ControllerRecord = any |
UseContext | extends ContextRecord = any |
Parameters
Name | Type | Description |
---|---|---|
tcas | Tcas <AbstractTcasIntruder , TcasSensitivity <TcasIntruder >> | The TCAS used by the traffic display. |
iconFactory | MapTrafficIntruderIconFactory <DefaultIfAny <UseModules , Modules >, DefaultIfAny <UseLayers , Layers >, DefaultIfAny <UserControllers , Controllers >, DefaultIfAny <UseContext , Context >> | A function which creates intruder icons for the traffic display. |
initCanvasStyles? | (context : CanvasRenderingContext2D ) => void | A function which initializes global canvas styles for the traffic display. |
offScaleOobOptions? | (context : MapSystemContext <DefaultIfAny <UseModules , Modules >, DefaultIfAny <UseLayers , Layers >, DefaultIfAny <UserControllers , Controllers >, DefaultIfAny <UseContext , Context >>) => TrafficOffScaleOobOptions | A function which generates options for handling off-scale and out-of-bounds intruders. |
order? | number | The 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.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:1175
withWaypoints
▸ withWaypoints<UseContext
>(): DefaultIfAny
<UseContext
, Context
> extends { textManager
: MapCullableTextLabelManager
} ? MapSystemBuilder
<Modules
, Layers
, Controllers
, Context
> : never
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
Name | Type |
---|---|
UseContext | any |
Returns
DefaultIfAny
<UseContext
, Context
> extends { textManager
: MapCullableTextLabelManager
} ? MapSystemBuilder
<Modules
, Layers
, Controllers
, Context
> : never
This builder, after it has been configured.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:859
create
▸ create(bus
): MapSystemBuilder
<any
, any
, any
, any
>
Creates a new Garmin map builder. The builder is initialized with a default projected size of [100, 100]
pixels.
Parameters
Name | Type | Description |
---|---|---|
bus | EventBus | The event bus. |
Returns
MapSystemBuilder
<any
, any
, any
, any
>
A new Garmin map builder.
Defined in
src/sdk/components/mapsystem/MapSystemBuilder.tsx:254