首页 / 浏览问题 / 三维GIS / 问题详情
泛光尾迹线怎么移除
33EXP 2021年03月05日
泛光尾迹线移除
问题关闭原因: 已解决

1个回答

viewer.entities.remove(entity)或viewer.entities.removeAll()
6,087EXP 2021年03月05日
请问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指的是那个呀,新手请多多指教,谢谢
...