Skip to main content

Fisheye camera video fusion layer (BoxVideoLayer)

Add a virtual camera corresponding to the video according to the camera parameters. Obtaining camera parameters requires relying on video calibration tools. For details, please contact customer service (lower right corner).

method

setVisiable

Sets the visibility of the plane.

Parameters

NameTypeDescription
nameEnumRequired[Specify the plane, the optional values ​​are "front", "back", "left", "right", "bottom".
visibleBooleanRequiredtrue means visible, false means invisible
Case
    let options = {
id: 'boxVideoLayer',
type: 'boxVideo',
center: [120.68152338516848, 31.321349947429432, 0.1],
cameraData = {...}, // camera parameters
callback: function (group, layer) {
//Set the specified face to be visible
layer.setVisiable('front', false);
},
}

//Add video fusion
map.addLayer(options);

setVideoCameraActiveByIndex

Set the visible state of the camera screen based on the index.

Parameters

nametypedefault valuedescription
indexNumber0optionalCamera index sequence.
visibleBooleanrequiredSet the opening and hiding of the camera screen, true means opening.
Case
    let options = {
id: 'boxVideoLayer',
type: 'boxVideo',
center: [120.68152338516848, 31.321349947429432, 0.1],
cameraData = [{...},{...},...] // Camera parameters
callback: function (group, layer) {
layer.setVideoCameraActiveByIndex(0, true); // Display the first camera video screen
layer.setVideoCameraActiveByIndex(1, false); // Hide the second camera video screen
},
}

//Add video fusion
map.addLayer(options);

setViewPointByIndex

Automatically fly to locate the best viewing angle of the specified video based on the index.

Parameters

NameTypeDescription
indexNumberRequiredCamera index sequence.
Case
    let options = {
id: 'boxVideoLayer',
type: 'boxVideo',
center: [120.68152338516848, 31.321349947429432, 0.1],
cameraData:[{...},{...},...] // Camera parameters
callback: function (group, layer) {
layer.setViewPointByIndex(0);//Automatic flight positioning to the best viewing angle of the first camera video screen
},
}

//Add video fusion
map.addLayer(options);

setCropRangeByIndex

Set the cropping range of the specified plane of the video screen according to the index. For details, please refer to Example.

Parameters

nametypedefault valuedescription
indexNumberRequiredCamera index sequence.
faceEnumRequiredSpecify the plane to be clipped, the optional values ​​are "front", "back", "left", "right", "bottom".
cropRangeArray[]optionalThe crop range array of the video screen, retaining the video content within the crop range, with the lower left corner of the video screen as the coordinate origin [0,0], the X axis is positive to the right, the Y axis is positive upward, the value range is 0-1, and the upper right corner is [1,1]. By default, an empty array is not clipped.

Case

    let options = {
id: 'boxVideoLayer',
type: 'boxVideo',
center: [120.68152338516848, 31.321349947429432, 0.1],
cameraData:[{...},{...},...] //Video fusion parameters
callback: function (group, layer) {
layer.setCropRangeByIndex(0, 'front', [[0.1,0.1],[0.8,0.1],[0.8,0.8],[0.1,0.8]]); // Set the front cropping range of the first camera video
},
}

//Add video fusion
map.addLayer(options);

setColorBalanceByIndex

Set the color correction matrix of the video picture according to the index.

Parameters

nametypedefault valuedescription
indexNumberRequiredCamera index sequence.
colorBalanceArray[]optionalA 3×4 color correction matrix for color balancing, represented by a two-dimensional array, in the shape of [ [ a1, a2, a3, a4], [b1, b2, b3, b4], [c1, c2, c3, c4]]. By default, an empty array means no color balancing is performed.
Case
    let options = {
id: 'boxVideoLayer',
type: 'boxVideo',
center: [120.68152338516848, 31.321349947429432, 0.1],
cameraData:[{...},{...},...] // Camera parameters
callback: function (group, layer) {
layer.setColorBalanceByIndex(0, [[0.5,0.5,0.5,0.5],[0.5,0.5,0.5,0.5],[0.5,0.5,0.5,0.5]]); // Set the front color correction matrix of the first camera video
},
}

//Add video fusion
map.addLayer(options);