Skip to main content

Class: BingComponent

A FSComponent that displays the MSFS Bing Map, weather radar, and 3D terrain.

Hierarchy

Constructors

constructor

new BingComponent(props): BingComponent

Creates an instance of a DisplayComponent.

Parameters

NameTypeDescription
propsBingComponentPropsThe propertis of the component.

Returns

BingComponent

Inherited from

DisplayComponent.constructor

Defined in

src/sdk/components/FSComponent.ts:73

Properties

context

Optional context: [] = undefined

The context on this component, if any.

Inherited from

DisplayComponent.context

Defined in

src/sdk/components/FSComponent.ts:64


contextType

Optional Readonly contextType: readonly [] = undefined

The type of context for this component, if any.

Inherited from

DisplayComponent.contextType

Defined in

src/sdk/components/FSComponent.ts:67


props

props: BingComponentProps & ComponentProps

The properties of the component.

Inherited from

DisplayComponent.props

Defined in

src/sdk/components/FSComponent.ts:61


DEFAULT_RESOLUTION

Static Readonly DEFAULT_RESOLUTION: 1024

The default resolution of the Bing Map along both horizontal and vertical axes, in pixels.

Defined in

src/sdk/components/bing/BingComponent.tsx:105


DEFAULT_WEATHER_COLORS

Static Readonly DEFAULT_WEATHER_COLORS: readonly readonly [number, number][]

Defined in

src/sdk/components/bing/BingComponent.tsx:107

Methods

destroy

destroy(): void

Destroys this component.

Returns

void

Overrides

DisplayComponent.destroy

Defined in

src/sdk/components/bing/BingComponent.tsx:469


getContext

getContext(context): never

Gets a context data subscription from the context collection.

Parameters

NameTypeDescription
contextneverThe context to get the subscription for.

Returns

never

The requested context.

Throws

An error if no data for the specified context type could be found.

Inherited from

DisplayComponent.getContext

Defined in

src/sdk/components/FSComponent.ts:106


isAwake

isAwake(): boolean

Checks whether this Bing component is awake.

Returns

boolean

whether this Bing component is awake.

Defined in

src/sdk/components/bing/BingComponent.tsx:259


isBound

isBound(): boolean

Checks whether this Bing component has been bound.

Returns

boolean

whether this Bing component has been bound.

Defined in

src/sdk/components/bing/BingComponent.tsx:251


onAfterRender

onAfterRender(): void

A callback that is called after the component is rendered.

Returns

void

Overrides

DisplayComponent.onAfterRender

Defined in

src/sdk/components/bing/BingComponent.tsx:264


onBeforeRender

onBeforeRender(): void

A callback that is called before the component is rendered.

Returns

void

Inherited from

DisplayComponent.onBeforeRender

Defined in

src/sdk/components/FSComponent.ts:80


render

render(): VNode

Renders the component.

Returns

VNode

A JSX element to be rendered.

Overrides

DisplayComponent.render

Defined in

src/sdk/components/bing/BingComponent.tsx:462


resetImgSrc

resetImgSrc(): void

Resets the img element's src attribute.

Returns

void

Defined in

src/sdk/components/bing/BingComponent.tsx:502


setPositionRadius

setPositionRadius(pos, radius): void

Sets the center position and radius.

Parameters

NameTypeDescription
posLatLongThe center position.
radiusnumberThe radius, in meters.

Returns

void

Defined in

src/sdk/components/bing/BingComponent.tsx:448


sleep

sleep(): void

Puts this Bing component to sleep. While asleep, this component cannot make changes to the Bing instance to which it is bound.

Returns

void

Defined in

src/sdk/components/bing/BingComponent.tsx:422


wake

wake(): void

Wakes this Bing component. Upon awakening, this component will synchronize its state to the Bing instance to which it is bound.

Returns

void

Defined in

src/sdk/components/bing/BingComponent.tsx:393


createEarthColorsArray

createEarthColorsArray(waterColor, terrainColors, minElevation?, maxElevation?, stepCount?): number[]

Creates a full Bing component earth colors array. The earth colors array will contain the specified water color and terrain colors (including interpolated values between the explicitly defined ones, as necessary).

Parameters

NameTypeDefault valueDescription
waterColorstringundefinedThe desired water color, as a hex string with the format #hhhhhh.
terrainColors{ color: string ; elev: number }[]undefinedAn array of desired terrain colors at specific elevations. Elevations should be specified in feet and colors as hex strings with the format #hhhhhh.
minElevationnumber0The minimum elevation to which to assign a color, in feet. Defaults to 0.
maxElevationnumber30000The maximum elevation to which to assign a color, in feet. Defaults to 30000.
stepCountnumber61The number of terrain color steps. Defaults to 61.

Returns

number[]

a full Bing component earth colors array.

Defined in

src/sdk/components/bing/BingComponent.tsx:617


hexaToRGBAColor

hexaToRGBAColor(hexColor): number

Converts an HTML hex color string to a numerical RGBA value, as R + G * 256 + B * 256^2 + A * 256^3.

Parameters

NameTypeDescription
hexColorstringThe hex color string to convert.

Returns

number

The numerical RGBA value equivalent of the specified hex color string, as R + G * 256 + B * 256^2 + A * 256^3.

Defined in

src/sdk/components/bing/BingComponent.tsx:562


hexaToRGBColor

hexaToRGBColor(hexColor): number

Converts an HTML hex color string to a numerical RGB value, as R + G * 256 + B * 256^2.

Parameters

NameTypeDescription
hexColorstringThe hex color string to convert.

Returns

number

The numerical RGB value equivalent of the specified hex color string, as R + G * 256 + B * 256^2.

Defined in

src/sdk/components/bing/BingComponent.tsx:516


rgbColor

rgbColor(r, g, b): number

Converts RGB color components to a numerical RGB value, as R + G * 256 + B * 256^2.

Parameters

NameTypeDescription
rnumberThe red component, from 0 to 255.
gnumberThe green component, from 0 to 255.
bnumberThe blue component, from 0 to 255.

Returns

number

The numerical RGB value of the specified components, as R + G * 256 + B * 256^2.

Defined in

src/sdk/components/bing/BingComponent.tsx:552


rgbToHexaColor

rgbToHexaColor(rgb, poundPrefix?): string

Converts a numerical RGB value to an HTML hex color string.

Parameters

NameTypeDefault valueDescription
rgbnumberundefinedThe numerical RGB value to convert, as R + G * 256 + B * 256^2.
poundPrefixbooleantrueWhether to include the pound (#) prefix in the converted string. Defaults to true.

Returns

string

The HTML hex color string equivalent of the specified numerical RGB value.

Defined in

src/sdk/components/bing/BingComponent.tsx:537


rgbaColor

rgbaColor(r, g, b, a): number

Converts RGBA color components to a numerical RGBA value, as R + G * 256 + B * 256^2 + A * 256^3.

Parameters

NameTypeDescription
rnumberThe red component, from 0 to 255.
gnumberThe green component, from 0 to 255.
bnumberThe blue component, from 0 to 255.
anumberThe alpha component, from 0 to 255.

Returns

number

The numerical RGBA value of the specified components, as R + G * 256 + B * 256^2 + A * 256^3.

Defined in

src/sdk/components/bing/BingComponent.tsx:601


rgbaToHexaColor

rgbaToHexaColor(rgba, poundPrefix?): string

Converts a numerical RGBA value to an HTML hex color string.

Parameters

NameTypeDefault valueDescription
rgbanumberundefinedThe numerical RGBA value to convert, as R + G * 256 + B * 256^2 + A * 256^3.
poundPrefixbooleantrueWhether to include the pound (#) prefix in the converted string. Defaults to true.

Returns

string

The HTML hex color string equivalent of the specified numerical RGBA value.

Defined in

src/sdk/components/bing/BingComponent.tsx:584