Skip to main content

GeoVideoLayer

method

addVideoCameras

Add a virtual camera corresponding to the video according to the camera parameters.

parameter

nametypedescribe
camerasDataObject/Array[Object]RequiredThe camera parameter object or object group that needs to be added.
NameTypeDefaultDescription
farNumberRequiredfar plane.
fovNumberRequiredField of view.
headingNumberRequiredCamera azimuth.
heightNumberRequiredVideo height.
nameStringRequiredCamera name.
nearNumberRequirednear plane.
pitchNumberRequiredCamera pitch angle.
positionArrayRequiredCamera position information, three-dimensional array, such as[x,y,z]。
rollNumberRequiredCamera roll angle.
videoUrlStringRequiredCamera resource file path.
widthNumberRequiredVideo width.
cameraModelNumber0OptionalDistortion correction type,0Indicates no distortion correction,1Indicates fisheye distortion correction,12Represents division model distortion correction.
depthTestBolleantrueOptionalWhether to enable depth testing.
factorNumber0Optionalfactor.
fxNumber0OptionalDistortion correction parameters.
fyNumber0OptionalDistortion correction parameters.
k1Number0OptionalDistortion correction parameters.
k2Number0OptionalDistortion correction parameters.
k3Number0OptionalDistortion correction parameters.
k4Number0OptionalDistortion correction parameters.
p1Number0OptionalDistortion correction parameters.
p2Number0OptionalDistortion correction parameters.
unitsNumber0Optionalunit.
u0NumberOptionalDistortion correction parameters.
videoTypeNumber1Optionalvideo source format,0expressmp4Format,1expressimg,2expressflv。
v0NumberOptionalDistortion correction parameters.
zThresholdNumber0Optionalzoffset.

getViewPoint

Get the viewpoint of the current window, the return value can be usedsetViewPointinterface.

setVideoCameraActiveByIndex

Set the camera to start based on the index.

parameter

nametypedescribe
activeBolleanRequiredSet the opening and hiding of the camera screen, true Indicates open.
indexNumberRequiredCamera 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,
exposure: 1.2,
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.

parameter

nametypedescribe
viewDataObjectRequiredViewpoint information object.
NameTypeDefaultDescription
headingNumberRequiredViewpoint azimuth.
pitchNumberRequiredViewpoint pitch angle.
positionArrayRequiredViewpoint position information, three-dimensional array, such as[x,y,z]。
rollNumberRequiredViewpoint roll angle.
isLLHBolleanfalseOptionalWhether the viewpoint position is expressed in latitude and longitude,trueIndicates latitude and longitude.