【解决办法】参考下方代码:
图层过滤
CheckChange(e, checkinfo) {
let str = "[0:";
for(let i=0;i< checkinfo.checkedNodes.length;i++){
let node = checkinfo.checkedNodes[i];
if(node.pid !== -1){
str = str + node.pid + "." + node.id;
if(i<checkinfo.checkedNodes.length-1) str += ","
}
}
str += "]";
if(str.length<5) str = "[]";
map.removeLayer(aaaLayer);
aaaLayer = new tiledMapLayer(url, {
noWrap: true,
className: "opacity",
layersID: str
}).addTo(map);
}