Class: WallLayer
围栏图层对象类
Details
添加 Wall 对象、图层的显示与隐藏、根据guid值移除围栏对象、清除围栏对象、 获取图层中对应围栏对象、获取图层下的所有围栏对象、获取对象guid值、获取图层对象名等
Hierarchy
Callable
↳
WallLayer
Methods
isVector3Array
▸ isVector3Array(array
): array is Vector3[]
类型保护函数:判断是否为 Vector3 数组
Parameters
Name | Type |
---|---|
array | any |
Returns
array is Vector3[]
isLonLatAltArray
▸ isLonLatAltArray(array
): array is LonLatAlt[]
类型保护函数:判断是否为 LonLatAlt 数组
Parameters
Name | Type |
---|---|
array | any |
Returns
array is LonLatAlt[]
addWallEffect
▸ addWallEffect(...args
): null
| Promise
<Wall
>
Details
添加 Wall 对象
Examples
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
const param = {
Material: { // 选填
BumpMode: 0,//凹凸模式
MaterialType: 0,//材质类型
Metallic: 0.5, // 金属光泽度
NormalOrBumpScale: 1.0, // 凸起比例
Roughness: 0.5, // 粗糙度
Diffuse: '0XFF00FF00',//漫反射颜色
//可选填值:Planarity、Gradient、red、Stroke、yellow
DiffuseTexture: 'Planarity', //纹理
},
TextureRate: 1.0, //线的纹理率(一般来说不变),选填
Height: 3, //围栏高度 选填
IsStretch: true, //围栏纹理是否拉伸 选填
Speed: 0.02, //围栏纹理速度值 选填
IsTangentWallEffectDir: true, //围栏效果运动方向是否是沿着路径的切线方向 选填
IsReverseWallEffect:false, //围栏效果运动是否是逆时针 选填
IsShow:true, //围栏是否显示值 选填
UVRepeatUNum: 6.0, //表示纹理在u轴重复数 选填
UVRepeatVNum: 2.0, //表示纹理在v轴重复数 选填
BottomOutline: //围栏底部的顶点
[
[
15.625022888183594,
0.0099849095568060875,
29.745611190795898,
],
[
37.157989501953125,
0.010088586248457432,
28.169088363647461,
],
[
36.95220947265625,
0.010002888739109039,
16.018711090087891,
],
[
27.902980804443359,
0.0099409837275743484,
14.839985847473145,
],
],
type: '.primt',
}
var wall = await wallLayer.addWallEffect(param);
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
const param = {
Material: { // 选填
BumpMode: 0,//凹凸模式
MaterialType: 0,//材质类型
Metallic: 0.5, // 金属光泽度
NormalOrBumpScale: 1.0, // 凸起比例
Roughness: 0.5, // 粗糙度
Diffuse: '0XFF00FF00',//漫反射颜色
//可选填值:Planarity、Gradient、red、Stroke、yellow
DiffuseTexture: 'Planarity', //纹理
},
TextureRate: 1.0, //线的纹理率(一般来说不变),选填
Height: 3, //围栏高度 选填
IsStretch: true, //围栏纹理是否拉伸 选填
Speed: 0.02, //围栏纹理速度值 选填
IsTangentWallEffectDir: true, //围栏效果运动方向是否是沿着路径的切线方向 选填
IsReverseWallEffect:false, //围栏效果运动是否是逆时针 选填
IsShow:true, //围栏是否显示值 选填
UVRepeatUNum: 6.0, //表示纹理在u轴重复数 选填
UVRepeatVNum: 2.0, //表示纹理在v轴重复数 选填
BottomOutline: //围栏底部的顶点
[
[
15.625022888183594,
0.0099849095568060875,
29.745611190795898,
],
[
37.157989501953125,
0.010088586248457432,
28.169088363647461,
],
[
36.95220947265625,
0.010002888739109039,
16.018711090087891,
],
[
27.902980804443359,
0.0099409837275743484,
14.839985847473145,
],
],
type: '.primt',
}
var wall = await wallLayer.addWallEffect(param);
方式二: 参数: wallAttr 围栏效果属性信息 参数: wallGeo 围栏几何体信息
Examples
const wallAttr: WallEffectAttr = {
diffuse: '0XfFff0000', //围栏颜色
speed: 0, //纹理流速
isStretch: false, //围栏纹理是否拉伸
isTangentWallEffectDir: true, //围栏效果运动方向是否是沿着路径的切线方向
diffuseTexture: 'yellow', //纹理,可选填值:Planarity、Gradient、red、Stroke、yellow
};
const bottons = [];
bottons.push(new Vector3(256.787, 0.6, 356.222));
bottons.push(new Vector3(289.689, 0.681, 355.693));
bottons.push(new Vector3(285.741, 0.7, 331.082));
bottons.push(new Vector3(256.787, 0.6, 356.222));
// bottons.push(new LonLatAlt(0.0023067557, 0.0031999990, 0.6151075792));
// bottons.push(new LonLatAlt(0.0026023211, 0.0031952462, 0.6972457329));
// bottons.push(new LonLatAlt(0.0025668529, 0.0029741609, 0.7148046494));
// bottons.push(new LonLatAlt(0.0023067557, 0.0031999990, 0.6151075792));
const wallGeo: WallGeometry = {
bottomOutline: bottons, //围栏底部的顶点
height: 10, //围栏高度
};
wallManager = await cloud.getWallManager();
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
await wallLayer.addWallEffect(wallAttr, wallGeo);
const wallAttr: WallEffectAttr = {
diffuse: '0XfFff0000', //围栏颜色
speed: 0, //纹理流速
isStretch: false, //围栏纹理是否拉伸
isTangentWallEffectDir: true, //围栏效果运动方向是否是沿着路径的切线方向
diffuseTexture: 'yellow', //纹理,可选填值:Planarity、Gradient、red、Stroke、yellow
};
const bottons = [];
bottons.push(new Vector3(256.787, 0.6, 356.222));
bottons.push(new Vector3(289.689, 0.681, 355.693));
bottons.push(new Vector3(285.741, 0.7, 331.082));
bottons.push(new Vector3(256.787, 0.6, 356.222));
// bottons.push(new LonLatAlt(0.0023067557, 0.0031999990, 0.6151075792));
// bottons.push(new LonLatAlt(0.0026023211, 0.0031952462, 0.6972457329));
// bottons.push(new LonLatAlt(0.0025668529, 0.0029741609, 0.7148046494));
// bottons.push(new LonLatAlt(0.0023067557, 0.0031999990, 0.6151075792));
const wallGeo: WallGeometry = {
bottomOutline: bottons, //围栏底部的顶点
height: 10, //围栏高度
};
wallManager = await cloud.getWallManager();
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
await wallLayer.addWallEffect(wallAttr, wallGeo);
Parameters
Name | Type | Description |
---|---|---|
...args | any [] | 不定数量的参数 |
Returns
null
| Promise
<Wall
>
Wall对象
方式一: 参数: json格式字符串 格式为:{ Material: { // 选填 BumpMode: 0,//凹凸模式 MaterialType: 0,//材质类型 Metallic: 0.5, // 金属光泽度 NormalOrBumpScale: 1.0, // 凸起比例 Roughness: 0.5, // 粗糙度 Diffuse: '0XFF00FF00',//漫反射颜色 //可选填值:Planarity、Gradient、red、Stroke、yellow DiffuseTexture: 'Planarity', //纹理 }, TextureRate: 1.0, //线的纹理率(一般来说不变),选填 Height: 3, //围栏高度 选填 IsStretch: true, //围栏纹理是否拉伸 选填 Speed: 0.02, //围栏纹理速度值 选填 IsTangentWallEffectDir: true, //围栏效果运动方向是否是沿着路径的切线方向 选填 IsReverseWallEffect:false, //围栏效果运动是否是逆时针 选填 IsShow:true, //围栏是否显示值 选填 UVRepeatUNum: 6.0, //表示纹理在u轴重复数 选填 UVRepeatVNum: 2.0, //表示纹理在v轴重复数 选填 BottomOutline: //围栏底部的顶点 [ [ 15.625022888183594, 0.0099849095568060875, 29.745611190795898, ], [ 37.157989501953125, 0.010088586248457432, 28.169088363647461, ], [ 36.95220947265625, 0.010002888739109039, 16.018711090087891, ], [ 27.902980804443359, 0.0099409837275743484, 14.839985847473145, ], ], type: '.primt', }
show
▸ show(isShow
): Promise
<any
>
Details
图层的显示与隐藏
Examples
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
wallLayer.show(true);
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
wallLayer.show(true);
Parameters
Name | Type | Description |
---|---|---|
isShow | boolean | 图层的显示与隐藏 |
Returns
Promise
<any
>
removeWall
▸ removeWall(guid
): Promise
<any
>
Details
根据guid值移除围栏对象
Examples
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
await wallLayer.removeWall("E24FAB463E5746FE98F100918D4B32E3");
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
await wallLayer.removeWall("E24FAB463E5746FE98F100918D4B32E3");
Parameters
Name | Type | Description |
---|---|---|
guid | string | 围栏对象guid值 |
Returns
Promise
<any
>
clearWalls
▸ clearWalls(): Promise
<any
>
Details
清除某个图层中所有围栏对象
Examples
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
await wallLayer.clearWalls();
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
await wallLayer.clearWalls();
Returns
Promise
<any
>
getWall
▸ getWall(guid
): Promise
<Wall
>
Details
获取图层中对应围栏对象
Examples
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
await wallLayer.getWall("E24FAB463E5746FE98F100918D4B32E3");
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
await wallLayer.getWall("E24FAB463E5746FE98F100918D4B32E3");
Parameters
Name | Type | Description |
---|---|---|
guid | string | 围栏对象guid值 |
Returns
Promise
<Wall
>
Wall对象
getWalls
▸ getWalls(): Promise
<Wall
[]>
Details
获取图层下的所有围栏对象
Examples
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
var list1 = await wallLayer.getWalls();
wallManager= await cloud.getWallManager()
var list = await wallManager.getAllLayers();
var wallLayer = list[0]; //保证数组不为0
var list1 = await wallLayer.getWalls();
Returns
Promise
<Wall
[]>
Wall数组
getGuid
▸ getGuid(): string
Details
获取对象guid值
Example
wallManger = await cloud.getWallManager();
var layers = await wallManger.getAllLayers();
var layer = layers[0];
layer.getGuid();
wallManger = await cloud.getWallManager();
var layers = await wallManger.getAllLayers();
var layer = layers[0];
layer.getGuid();
Returns
string
getName
▸ getName(): string
Details
获取图层对象名
Example
wallManger = await cloud.getWallManager();
var layers = await wallManger.getAllLayers();
var layer = layers[0];
layer.getName();
wallManger = await cloud.getWallManager();
var layers = await wallManger.getAllLayers();
var layer = layers[0];
layer.getName();
Returns
string