Class: BingComponent
Defined in: src/sdk/components/bing/BingComponent.tsx:119
A FSComponent that displays the MSFS Bing Map, weather radar, and 3D terrain.
Extends
Constructors
Constructor
new BingComponent(
props):BingComponent
Defined in: src/sdk/components/FSComponent.ts:73
Creates an instance of a DisplayComponent.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | BingComponentProps | The propertis of the component. |
Returns
BingComponent
Inherited from
Properties
context?
optionalcontext: [] =undefined
Defined in: src/sdk/components/FSComponent.ts:64
The context on this component, if any.
Inherited from
contextType?
readonlyoptionalcontextType: readonly [] =undefined
Defined in: src/sdk/components/FSComponent.ts:67
The type of context for this component, if any.
Inherited from
props
props:
BingComponentProps&ComponentProps
Defined in: src/sdk/components/FSComponent.ts:61
The properties of the component.
Inherited from
DEFAULT_3D_FOV
readonlystaticDEFAULT_3D_FOV:50=50
Defined in: src/sdk/components/bing/BingComponent.tsx:131
The default field of view for 3D Bing instances (those using EBingMode.HORIZON or EBingMode.TOPVIEW), in degrees.
DEFAULT_RESOLUTION
readonlystaticDEFAULT_RESOLUTION:1024=1024
Defined in: src/sdk/components/bing/BingComponent.tsx:121
The default resolution of the Bing Map along both horizontal and vertical axes, in pixels.
DEFAULT_WEATHER_COLORS
readonlystaticDEFAULT_WEATHER_COLORS: readonly readonly [number,number][]
Defined in: src/sdk/components/bing/BingComponent.tsx:123
MAX_RADIUS
readonlystaticMAX_RADIUS:5000000=5e6
Defined in: src/sdk/components/bing/BingComponent.tsx:134
The maximum supported radius, in meters.
Methods
destroy()
destroy():
void
Defined in: src/sdk/components/bing/BingComponent.tsx:655
Destroys this component.
Returns
void
Overrides
getContext()
protectedgetContext(context):never
Defined in: src/sdk/components/FSComponent.ts:106
Gets a context data subscription from the context collection.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | never | The 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
isAwake()
isAwake():
boolean
Defined in: src/sdk/components/bing/BingComponent.tsx:211
Checks whether this Bing component is awake.
Returns
boolean
whether this Bing component is awake.
isBound()
isBound():
boolean
Defined in: src/sdk/components/bing/BingComponent.tsx:203
Checks whether this Bing component has been bound.
Returns
boolean
whether this Bing component has been bound.
onAfterRender()
onAfterRender():
void
Defined in: src/sdk/components/bing/BingComponent.tsx:216
A callback that is called after the component is rendered.
Returns
void
Overrides
DisplayComponent.onAfterRender
onBeforeRender()
onBeforeRender():
void
Defined in: src/sdk/components/FSComponent.ts:80
A callback that is called before the component is rendered.
Returns
void
Inherited from
DisplayComponent.onBeforeRender
render()
render():
VNode
Defined in: src/sdk/components/bing/BingComponent.tsx:648
Renders the component.
Returns
A JSX element to be rendered.
Overrides
resetImgSrc()
resetImgSrc():
void
Defined in: src/sdk/components/bing/BingComponent.tsx:691
Resets the img element's src attribute.
Returns
void
set3DMapCameraTransform()
set3DMapCameraTransform(
pos,altitudeRef,offset,rotation,rotationRef):void
Defined in: src/sdk/components/bing/BingComponent.tsx:549
Sets this component's 3D map camera transform parameters. This method can only be used for components whose mode
is set to EBingMode.HORIZON.
Parameters
| Parameter | Type | Description |
|---|---|---|
pos | LatLongAlt | null | The camera's nominal position. If null, then the nominal position will sync to the aircraft's position. |
altitudeRef | Ellipsoid | Geoid | null | The altitude reference to use for the camera's nominal position. If null, then the default reference (SimAltitudeReference.Geoid) is used. Ignored if pos is null. |
offset | Readonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">> | null | The camera's offset from its nominal position, as [x, y, z] in meters in the camera's reference frame after rotation is applied. The positive x axis points to the left. The positive y axis points upward. The positive z axis points forward. If null, then no offset is applied. |
rotation | PitchBankHeading | null | The camera's rotation, whose reference frame depends on the value of rotationRef. If null, then the rotation will sync to the aircraft's attitude. |
rotationRef | BingCameraRotationReference | null | The reference frame for the camera rotation. If null, then the default reference (BingCameraRotationReference.World) is used. Ignored if rotation is null. |
Returns
void
Throws
Error if this component's mode is not EBingMode.HORIZON.
setPositionRadius()
setPositionRadius(
pos,radius):void
Defined in: src/sdk/components/bing/BingComponent.tsx:521
Sets the center position and radius of this Bing component.
Parameters
| Parameter | Type | Description |
|---|---|---|
pos | LatLong | The center position. |
radius | number | The radius, in meters. |
Returns
void
sleep()
sleep():
void
Defined in: src/sdk/components/bing/BingComponent.tsx:495
Puts this Bing component to sleep. While asleep, this component cannot make changes to the Bing instance to which it is bound.
Returns
void
wake()
wake():
void
Defined in: src/sdk/components/bing/BingComponent.tsx:452
Wakes this Bing component. Upon awakening, this component will synchronize its state to the Bing instance to which it is bound.
Returns
void
createEarthColorsArray()
staticcreateEarthColorsArray(waterColor,terrainColors,minElevation,maxElevation,stepCount):number[]
Defined in: src/sdk/components/bing/BingComponent.tsx:806
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
| Parameter | Type | Default value | Description |
|---|---|---|---|
waterColor | string | undefined | The desired water color, as a hex string with the format #hhhhhh. |
terrainColors | object[] | undefined | An array of desired terrain colors at specific elevations. Elevations should be specified in feet and colors as hex strings with the format #hhhhhh. |
minElevation | number | 0 | The minimum elevation to which to assign a color, in feet. Defaults to 0. |
maxElevation | number | 30000 | The maximum elevation to which to assign a color, in feet. Defaults to 30000. |
stepCount | number | 61 | The number of terrain color steps. Defaults to 61. |
Returns
number[]
a full Bing component earth colors array.
hexaToRGBAColor()
statichexaToRGBAColor(hexColor):number
Defined in: src/sdk/components/bing/BingComponent.tsx:751
Converts an HTML hex color string to a numerical RGBA value, as R + G * 256 + B * 256^2 + A * 256^3.
Parameters
| Parameter | Type | Description |
|---|---|---|
hexColor | string | The 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.
hexaToRGBColor()
statichexaToRGBColor(hexColor):number
Defined in: src/sdk/components/bing/BingComponent.tsx:705
Converts an HTML hex color string to a numerical RGB value, as R + G * 256 + B * 256^2.
Parameters
| Parameter | Type | Description |
|---|---|---|
hexColor | string | The 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.
rgbaColor()
staticrgbaColor(r,g,b,a):number
Defined in: src/sdk/components/bing/BingComponent.tsx:790
Converts RGBA color components to a numerical RGBA value, as R + G * 256 + B * 256^2 + A * 256^3.
Parameters
| Parameter | Type | Description |
|---|---|---|
r | number | The red component, from 0 to 255. |
g | number | The green component, from 0 to 255. |
b | number | The blue component, from 0 to 255. |
a | number | The 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.
rgbaToHexaColor()
staticrgbaToHexaColor(rgba,poundPrefix):string
Defined in: src/sdk/components/bing/BingComponent.tsx:773
Converts a numerical RGBA value to an HTML hex color string.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
rgba | number | undefined | The numerical RGBA value to convert, as R + G * 256 + B * 256^2 + A * 256^3. |
poundPrefix | boolean | true | Whether 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.
rgbColor()
staticrgbColor(r,g,b):number
Defined in: src/sdk/components/bing/BingComponent.tsx:741
Converts RGB color components to a numerical RGB value, as R + G * 256 + B * 256^2.
Parameters
| Parameter | Type | Description |
|---|---|---|
r | number | The red component, from 0 to 255. |
g | number | The green component, from 0 to 255. |
b | number | The blue component, from 0 to 255. |
Returns
number
The numerical RGB value of the specified components, as R + G * 256 + B * 256^2.
rgbToHexaColor()
staticrgbToHexaColor(rgb,poundPrefix):string
Defined in: src/sdk/components/bing/BingComponent.tsx:726
Converts a numerical RGB value to an HTML hex color string.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
rgb | number | undefined | The numerical RGB value to convert, as R + G * 256 + B * 256^2. |
poundPrefix | boolean | true | Whether 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.