# 添加
# 功能描述
- 向 3D 世界中添加覆盖物
# 请求方式
gisTwin.UEAPI("LayerControl", "Add", jsondata, (e) => {
console.log(e); //成功、失败回调
});
# 数据格式
let jsondata = {
id: "ColorBlock_id", //唯一值
coord_type: 2, //坐标类型(0:wg84,1:CGCS2000,2,BD09,3,GCJ02),没有默认为:0
coords: [
"104.052927,30.557404",
"104.06076,30.557404",
"104.06058,30.555056",
"104.059179,30.553097",
"104.052998,30.553004",
], //连续的坐标点
height: 100, //覆盖物的高度,不填默认为:100
color: [1, 1, 0, 1], //覆盖物的颜色,不填默认为白色[1,1,1,1]
};
# 回调格式
let callback = {
class_name: "LayerControl",
func_name: "Add",
data: {
result: "success", //只用成功才会是success,其他会发送错误的原因
},
};
# 更新
# 功能描述
- 向 3D 世界中更新覆盖物
# 请求方式
gisTwin.UEAPI("LayerControl", "Update", jsondata, (e) => {
console.log(e); //成功、失败回调
});
# 数据格式
let jsondata = {
id: "ColorBlock_id", //唯一值
coord_type: 2, //坐标类型(0:wg84,1:CGCS2000,2,BD09,3,GCJ02),没有默认为:0
coords: [
"104.052927,30.557404",
"104.06076,30.557404",
"104.06058,30.555056",
"104.059179,30.553097",
"104.052998,30.553004",
], //连续的坐标点
height: 100, //覆盖物的高度,不填默认为:100
color: [1, 1, 0, 1], //覆盖物的颜色,不填默认为白色[1,1,1,1]
};
# 回调格式
let callback = {
class_name: "LayerControl",
func_name: "Update",
data: {
result: "success", //只用成功才会是success,其他会发送错误的原因
},
};
# 删除
# 功能描述
- 向 3D 世界中删除覆盖物
# 请求方式
gisTwin.UEAPI("LayerControl", "Delete", jsondata,(e) =>{
console.log(e); //成功、失败回调
});
# 数据格式
let jsondata = {
ids: ["poi_id"], //填需要删除覆盖物的id列表
};
# 回调格式
let callback = {
class_name: "LayerControl",
func_name: "Delete",
data: {
result: "success", //只用成功才会是success,其他会发送错误的原因
},
};
# 清除
# 功能描述
- 向 3D 世界中清除覆盖物
# 请求方式
gisTwin.UEAPI("LayerControl", "ClearAll", jsondata, (e) => {
console.log(e); //成功、失败回调
});
# 数据格式
let jsondata = {
}
# 回调格式
let callback={
"class_name":"LayerControl",
"func_name":"ClearAll",
"data":{
"result": "success" //只用成功才会是success,其他会发送错误的原因
}
}