Skip to content

Commit b405106

Browse files
committed
【SDK】【Cesium】【标绘图层可以显隐】
1 parent c93840b commit b405106

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/service/3DPlot/PlotLayer3D.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class PlotLayer3D extends Observable {
132132
if (!plotLayer) {
133133
return undefined;
134134
}
135-
135+
136136
let index = this._getPlotIndexById(id, plotLayer);
137137
const {_primitives} = plotLayer;
138138
if (index !== undefined) {
@@ -303,6 +303,23 @@ class PlotLayer3D extends Observable {
303303
tag.click();
304304
}
305305

306+
/**
307+
* @function: Module:PlotLayer2D.prototype.setVisible
308+
* @description: 设置图层可见性
309+
* @param {Boolean} flag
310+
*/
311+
setVisible(flag) {
312+
const {_primitives} = this._primitiveCollection;
313+
if(!_primitives || !(_primitives instanceof Array)) return;
314+
for (let i = 0; i < _primitives.length; i++) {
315+
let _primitivesCollection = _primitives[i]._primitives;
316+
if(!_primitivesCollection || !(_primitivesCollection instanceof Array)) return;
317+
for (let j = 0; j < _primitivesCollection.length; j++) {
318+
_primitivesCollection[j].show = flag;
319+
}
320+
}
321+
}
322+
306323
/**
307324
* @function module:3DPlot.PlotLayer3D.queryByGeometry
308325
* @description 标绘图元几何查询接口

0 commit comments

Comments
 (0)