首页 / 浏览问题 / 三维 / 问题详情
泛光尾迹线怎么移除
nantao  (33分)  初出茅庐
3月5日, 2021
泛光尾迹线移除
问题关闭原因: 已解决

1个回答

viewer.entities.remove(entity)或viewer.entities.removeAll()
卷饼先生  (6,042分)  登峰造极
3月5日, 2021
请问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指的是那个呀,新手请多多指教,谢谢
...