File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff 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 标绘图元几何查询接口
You can’t perform that action at this time.
0 commit comments