Video fusion layer (GeoVideoLayer)
method
addVideoCameras
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).
Parameters
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| cameraData | Object/Array[Object] | RequiredCamera parameter object or object group that needs to be added.
|
getViewPoint
Get the view point of the current window. The return value can be used in the setViewPoint interface.
setVideoCameraActiveByIndex
Set the camera to start based on the index.
Parameters
| Name | Type | Description |
|---|---|---|
| active | Boolean | RequiredSet the opening and hiding of the camera screen, true means opening. |
| index | Number | RequiredCamera index sequence. |
Case
let models_geo = ["ATModelNew.glb"].map(item => ({
type: 'glb',
url: "../example_data/aoti_models/" + item
}));
let options = {
id: 'model_id1',
type: 'geoVideo',
models: models_geo,
center: [120.744471002000068, 31.306768408000039, 3.617],
project: "3857",
cameraData: cameraData,
callback: function (geoVideo) {
GeoVideo = geoVideo;
}
}
map.addLayer(options);
map.on('click', function (e) {
GeoVideo.setVideoCameraActiveByIndex(0, true);
GeoVideo.setViewPoint(viewData)
})
Refer to Example.
setViewPoint
Set the map viewshed based on viewpoint information.
Parameters
| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| viewData | Object | RequiredViewpoint information object.
|
setCropRangeByIndex
Set the cropping range of the video screen according to the index. For details, please refer to Example.
Parameters
| name | type | default value | description |
|---|---|---|---|
| index | Number | RequiredCamera index sequence. | |
| cropRange | Array | [] | 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]. |
Case
let options = {
id: 'model_id1',
type: 'geoVideo',
cameraData: [{...},{...},...],
callback: function (geoVideo) {
GeoVideo = geoVideo;
}
}
map.addLayer(options);
//Set the cropping range of the first video
GeoVideo.setCropRangeByIndex(0, [[0.1,0.1],[0.8,0.1],[0.8,0.8],[0.1,0.8]]);
setColorBalanceByIndex
Set the color correction matrix of the video image according to the index. For details, please refer to Example.
Parameters
| name | type | default value | description |
|---|---|---|---|
| index | Number | RequiredCamera index sequence. | |
| colorBalance | Array | [] | 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: 'model_id1',
type: 'geoVideo',
cameraData: [{...},{...},...],
callback: function (geoVideo) {
GeoVideo = geoVideo;
}
}
map.addLayer(options);
//Set the color correction matrix of the first video
GeoVideo.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]]);