ProjectionImage

new Cesium.ProjectionImage(scene)

Video delivery category. Put pictures or videos into the scene to simulate the effect of advertising screens on buildings or large-screen TVs.
Name Type Description
scene Object optional Specify the scene object for analysis.
Throws:
Example:
//Create video delivery
var projectionImagee= new Cesium.ProjectionImage(scene);.

Members

direction : Number

Get or set the azimuth angle of the projector when the video is put, that is, the angle between the clockwise direction and the true north direction. The value range is 0°~360°.

distance : Number

Get or set the distance from the observation point to the projector.

hintLineColor : Color

Gets or sets the color of the prompt line when the video is put.

hintLineVisible : Color

Gets or sets the visibility of the prompt line when the video is put.

horizontalFov : Number

Gets or sets the horizontal viewing angle range of the projector when the video is put, unit: degree.

pitch : Number

Gets or sets the pitch angle of the projector when the video is cast. The angle refers to the angle between the camera direction and the water surface direction. The orientation is positive, and the unit is degree.

verticalFov : Number

Gets or sets the vertical viewing angle range of the projector when the video is put, unit: degree.

viewPosition : Array

Gets or sets the position of the observer of the video delivery. The location is represented by an array of longitude, latitude, and elevation.

visible : Boolean

Gets or sets whether the video delivery is visible, the default is true.
Default Value: true

visibleDistanceMax : Number

Gets or sets the maximum visible distance of the video.
Default Value: 500

Methods

staticCesium.ProjectionImage.fromInfo(scene, infoUrl, baseUrl)*

Read multiple videos from the file, that is, add multiple videos at the same time through the file for delivery.
Name Type Description
scene Scene Scenario
infoUrl String The address or path of the video attribute information file
baseUrl String optional Basic path. If it is added, it will be spliced into a path with the name of the video in the file. If it is not added, the parent path in the infoUrl file will be used as the baseUrl.
Returns:
Promise returns promise, including the created ProjectionImage object.
Example:
Cesium.ProjectionImage.fromInfo(scene, './data/allprojectionInfo.xml', './media/')

addClipRegion(options)Boolean

Add clipping polygons.
Name Type Description
options Object The parameter object contains the following properties:
Name Type Description
name String The name of the polygon
position Cartesian3 Position of polygon
Returns:
Whether the polygon was added successfully

build()

Perform video delivery analysis.

getVisibleInViewport(index)Boolean

Get the visibility of the video delivery analysis in the specified viewport.
Name Type Description
index Number The specified viewport index.
Returns:
visible (optional).
Throws:

pixelToWorldCoordinates(x, y)Cartesian3

Convert picture pixel coordinates to world coordinates.
Name Type Description
x The x coordinate of the picture pixel
y The y coordinate of the picture pixel
Returns:
The world coordinate corresponding to the pixel position of the picture

removeAllClipRegion()Boolean

Delete all polygons.
Returns:
Is the deletion successful

removeClipRegion(name)Boolean

Delete the polygon with the specified name.
Name Type Description
name Polygon name
Returns:
Is the deletion successful

setClipMode(mode)Boolean

Set the clipping mode.
Name Type Description
mode Enumerate for ModifyRegionMode
Returns:
Is it added successfully

setDistDirByPoint(position)

set the direction by point(longitude, latitude and height).
Name Type Description
position Array
Throws:
  • DeveloperError : the position is [longitude, latitude ,height] and is not equals viewPosition

setImage(options)

Set the imagery or video object used for delivery.
Name Type Description
options Object The object has the following attributes:
Name Type Description
url Array Specify the address of the image resource.
video Object Specify the video address, currently only supports *.webm format video, currently only supports .webm.
Throws:

setInfo(url)*

Set the location information of the video. The location information is saved in an .xml file and set by reading the content of the file.
Name Type Description
url String The address of the file where the location information is stored.
Returns:

setVisibleInViewport(index)

Set the visibility of the video delivery analysis in the specified viewport.
Name Type Description
index Number The specified viewport index.
Throws: