/* 根据fid删除 */
function DelFeature({
fid,
service,
layer
}) {
/* service必须是对象 name,layerId */
checkService(service, () => {
var deleteService = new Zondy.Service.EditDocFeature(service.name, service.layerId, {
ip: "localhost",
port: "6163" //访问IGServer的端口号,.net版为6163,Java版为8089
});
deleteService.deletes(fid, onSuccess(layer));
});
}
function onSuccess(layer) {
return function (result) {
if (result) {
alert("删除要素成功!");
layer.refresh();
} else {
alert("删除要素失败!");
}
}
}
function checkService(service, callback) {
if (service instanceof Object) {
var keys = Object.keys(service);
if (keys.includes("name") && keys.includes("layerId")) {
callback();
} else {
console.log("参数不合法")
}
} else {
console.log("输入的参数不合法")
}
}
/*