泛光尾迹线怎么移除 [已关闭]

0 投票
泛光尾迹线移除
问题关闭原因: 已解决
3月 5 分类:  98次浏览 | 用户: nantao 初出茅庐 (33 分)
已关闭 3月 25 用户:nantao

1个回答

0 投票
viewer.entities.remove(entity)或viewer.entities.removeAll()
3月 5 用户: 卷饼先生 名扬四海 (4,858 分)
请问entity具体指的是什么呢

 // 打底的管线的颜色

                function drawLines(lineColor) {

                    //viewer.entities.removeAll();

                    for (let line of roadpoints) {

                        viewer.entities.add({ // 用于打底的线

                            polyline: {

                                positions: [line[0], line[1]],

                                width: 2, // 线的宽度,像素为单位

                                material: Cesium.Color.fromCssColorString("rgba(0, 233, 241, 0.3)") //蓝色

                            }

                        });

                        // debugger;

                        viewer.entities.add({ // 尾迹线

                            polyline: {

                                positions: [line[0], line[1]],

                                width: 2, // 线的宽度,像素为单位

                                material: new Cesium.PolylineTrailMaterialProperty({ // 尾迹线材质

                                    color: lineColor,

                                    trailLength: 0.2,

                                    period: 2

                                })

                            }

                        });

                    }

                }
entity是定义的对象
那我这里entity指的是那个呀,新手请多多指教,谢谢
...