shuishen
2021-06-22 c3f2c05507258c0777d11481453dbc309072ceec
部分文件修改,及忽略部分文件
9 files modified
1 files added
1 files deleted
6200 ■■■■ changed files
.gitignore 1 ●●●● patch | view | raw | blame | history
widgets/FlyRoute/Widget.js 1 ●●●● patch | view | raw | blame | history
widgets/FlyRoute/css/style.css 196 ●●●● patch | view | raw | blame | history
widgets/FlyRoute/fly.js 858 ●●●● patch | view | raw | blame | history
widgets/FlyRoute/flyroute copy.json 2944 ●●●●● patch | view | raw | blame | history
widgets/FlyRoute/flyroute.json 233 ●●●●● patch | view | raw | blame | history
widgets/LeftNavigationBar/Widget.js 1658 ●●●● patch | view | raw | blame | history
widgets/Tool/Widget.js 1 ●●●● patch | view | raw | blame | history
widgets/legends/Widget.html 7 ●●●● patch | view | raw | blame | history
widgets/legends/Widget.js 276 ●●●● patch | view | raw | blame | history
widgets/legends/css/style.css 25 ●●●●● patch | view | raw | blame | history
.gitignore
New file
@@ -0,0 +1 @@
.vscode/settings.json
widgets/FlyRoute/Widget.js
@@ -171,7 +171,6 @@
                var geodesic = new Cesium.EllipsoidGeodesic();
                geodesic.setEndPoints(point1cartographic, point2cartographic);
                var s = geodesic.surfaceDistance;
                //console.log(Math.sqrt(Math.pow(distance, 2) + Math.pow(endheight, 2)));
                //返回两点之间的距离
                s = Math.sqrt(Math.pow(s, 2) + Math.pow(point2cartographic.height - point1cartographic.height, 2));
                distance = distance + s;
widgets/FlyRoute/css/style.css
@@ -1,160 +1,160 @@
.jimu-widget-FlyRoute {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background-color: rgba(255, 255, 255, 0.8);
    display: none;
    font-size: 14px;
    border: 1px solid rgb(212, 212, 212);
    border-radius: 5px;
    color: rgb(0, 0, 0);
    z-index: 9 !important;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background-color: rgba(255, 255, 255, 0.8);
    display: none;
    font-size: 14px;
    border: 1px solid rgb(212, 212, 212);
    border-radius: 5px;
    color: rgb(0, 0, 0);
    z-index: 9 !important;
}
/* 头部 */
.jimu-widget-FlyRoute .fly-route-header {
    position: relative;
    width: 100%;
    height: 40px;
    line-height: 40px;
    font-size: 20px;
    border-bottom: 1px solid rgb(184, 184, 184);
    position: relative;
    width: 100%;
    height: 40px;
    line-height: 40px;
    font-size: 20px;
    border-bottom: 1px solid rgb(184, 184, 184);
}
.jimu-widget-FlyRoute .fly-route-header i {
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    background: url(../../../images/toolbox.png ) no-repeat 0 -176px;
    background-size: 20px;
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    background: url(../../../images/toolbox.png ) no-repeat 0 -176px;
    background-size: 20px;
}
.jimu-widget-FlyRoute .fly-route-header .close-flyrouter {
    position: absolute;
    top: 50%;
    right: 8px;
    font-size: 38px;
    font-weight: 400;
    height: 28px;
    line-height: 18px;
    /* display: flex;
    position: absolute;
    top: 50%;
    right: 8px;
    font-size: 38px;
    font-weight: 400;
    height: 28px;
    line-height: 18px;
    /* display: flex;
    align-items: center;
    justify-content: center; */
    cursor: pointer;
    transform: translateY(-50%);
    cursor: pointer;
    transform: translateY(-50%);
}
.jimu-widget-FlyRoute input,
.jimu-widget-FlyRoute select {
    border: 0;
    border: 0;
}
.jimu-widget-FlyRoute .fly-route-continer {
    /* margin: 10px 8px; */
    position: absolute;
    top: 51px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    /* margin: 10px 8px; */
    position: absolute;
    top: 51px;
    left: 10px;
    right: 10px;
    bottom: 10px;
}
/* 选择框,或者说选择飞行路线 */
.jimu-widget-FlyRoute .fly-route-control #flightRoute {
    width: 100%;
    height: 30px;
    width: 100%;
    height: 30px;
}
/* 控制按钮 */
.jimu-widget-FlyRoute .fly-route-continer .fly-route-control-btn,
.jimu-widget-FlyRoute .fly-route-continer .fly-route-new-btn {
    margin-top: 10px;
    width: 100%;
    margin-top: 10px;
    width: 100%;
}
.jimu-widget-FlyRoute .fly-route-continer .fly-route-control-btn input,
.jimu-widget-FlyRoute .fly-route-continer .fly-route-new-btn input {
    margin: 0 1%;
    width: 30%;
    height: 30px;
    color: #fff;
    background: rgb(62,159,252);
    border: 1px solid rgb(69, 154, 251);
    border-radius: 4px;
    cursor: pointer;
    margin: 0 1%;
    width: 30%;
    height: 30px;
    color: #fff;
    background: rgb(62, 159, 252);
    border: 1px solid rgb(69, 154, 251);
    border-radius: 4px;
    cursor: pointer;
}
.jimu-widget-FlyRoute .fly-route-continer .fly-route-new {
    position: absolute;
    top: 80px;
    bottom: 0px;
    width: 100%;
    position: absolute;
    top: 80px;
    bottom: 0px;
    width: 100%;
}
.jimu-widget-FlyRoute .fly-route-continer .fly-route-new-top {
    height: 24px;
    line-height: 24px;
    font-size: 16px;
    height: 24px;
    line-height: 24px;
    font-size: 16px;
}
.jimu-widget-FlyRoute .fly-route-continer .fly-route-new-top span {
    margin: 0;
    display: inline-block;
    width: 80px;
    /* height: 16px !important; */
    margin: 0;
    display: inline-block;
    width: 80px;
    /* height: 16px !important; */
}
.jimu-widget-FlyRoute .fly-route-continer .fly-route-new-top input {
    margin: 0;
    width: 150px;
    height: 24px;
    vertical-align: top;
    border: none;
.jimu-widget-FlyRoute .fly-route-continer .fly-route-new-top input {
    margin: 0;
    width: 150px;
    height: 24px;
    vertical-align: top;
    border: none;
}
.jimu-widget-FlyRoute .fly-route-continer .fly-route-new>div:nth-child(3) {
    position: absolute;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    position: absolute;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 100%;
    height: auto;
}
#passPoint,
#passPoint li {
    margin: 0;
    padding: 0;
.jimu-widget-FlyRoute #passPoint,
.jimu-widget-FlyRoute #passPoint li {
    margin: 0;
    padding: 0;
}
#passPoint {
    height: 100%;
    list-style: none;
    overflow: auto;
.jimu-widget-FlyRoute #passPoint {
    height: 100%;
    list-style: none;
    overflow: auto;
}
#passPoint li {
    margin: 10px 40px;
.jimu-widget-FlyRoute #passPoint li {
    margin: 10px 40px;
}
.item {
    background: #3E9FFC;
    border-radius: 5px;
    height: 20px;
    padding-left: 5px;
    color: white;
    font-family: "微软雅黑";
    text-align: center;
    margin-bottom: 5px;
}
.item:nth-child(1){
    margin-top: 20px !important;
.jimu-widget-FlyRoute .item {
    background: #3E9FFC;
    border-radius: 5px;
    height: 20px;
    padding-left: 5px;
    color: white;
    font-family: "微软雅黑";
    text-align: center;
    margin-bottom: 5px;
    cursor: pointer;
}
.jimu-widget-FlyRoute .item:nth-child(1) {
    margin-top: 20px !important;
}
widgets/FlyRoute/fly.js
@@ -1,438 +1,488 @@
function newSite(x, y, z, h, p, time, ids) {
    if (x != null && y != null && z != null && h != null && p != null && time != null && ids != null) {
        this.position_x = x;
        this.position_y = y;
        this.position_z = z;
        this.pitch = p;
        this.heading = h;
        this.time = time;
        this.ids = ids;
    } else {
        return false;
    }
    if (x != null && y != null && z != null && h != null && p != null && time != null && ids != null) {
        this.position_x = x;
        this.position_y = y;
        this.position_z = z;
        this.pitch = p;
        this.heading = h;
        this.time = time;
        this.ids = ids;
    } else {
        return false;
    }
}
function Fly_NZC(viewer) {
    this.viewer = viewer;
    this.scene = viewer.scene;
    this.entities = viewer.entities;
    //全部飞行站点数组
    this.allSites = [];
    var that = this;
    this.checkIds = function (ids) {
        for (var i = 0; i < that.allSites.length + 1; i++) {
            if (i == that.allSites.length) {
                return false;
                break;
            }
            if (that.allSites[i].ids == ids) {
                return i;
                break;
            }
        }
    };
    this.RouteCollection = {
        //线颜色
        //LineColor:Cesium.Color.WHITE,
        //站点和路线显隐是否开启
        point_show: true,
        line_show: true,
        //站点图片路径
        img_path: "widgets/FlyRoute/images/location4.png",
        //飞行路线颜色
        /* setLineColor:function(){
             Cesium.Color.WHITE,
         },*/
        AddRoute: function (Route) {
            this.deleteEntities();
            that.allSites = [];
            for (var i = 0; i < Route.length; i++) {
                let cartesian3 = Cesium.Cartesian3.fromDegrees(Route[i].lgtd, Route[i].lttd, Route[i].height);
                let site = {
                    "ids": Route[i].id,
                    "position_x": cartesian3.x,
                    "position_y": cartesian3.y,
                    "position_z": cartesian3.z,
                    "pitch": Cesium.Math.toRadians(Route[i].pitch),
                    "heading": Cesium.Math.toRadians(Route[i].heading),
                    "roll": Cesium.Math.toRadians(Route[i].roll),
                    "time": Route[i].time
                };
                that.allSites[i] = site;
            }
            this.controlEntities();
    this.viewer = viewer;
    this.scene = viewer.scene;
    this.entities = viewer.entities;
    //全部飞行站点数组
    this.allSites = [];
    var that = this;
    this.checkIds = function (ids) {
        for (var i = 0; i < that.allSites.length + 1; i++) {
            if (i == that.allSites.length) {
                return false;
                break;
            }
            if (that.allSites[i].ids == ids) {
                return i;
                break;
            }
        }
        img_path
    };
    this.RouteCollection = {
        //线颜色
        //LineColor:Cesium.Color.WHITE,
        //站点和路线显隐是否开启
        point_show: true,
        line_show: true,
        //站点图片路径
        img_path: "widgets/FlyRoute/images/location4.png",
        //飞行路线颜色
        /* setLineColor:function(){
             Cesium.Color.WHITE,
         },*/
        AddRoute: function (Route) {
            this.deleteEntities();
            that.allSites = [];
            for (var i = 0; i < Route.length; i++) {
                let cartesian3 = Cesium.Cartesian3.fromDegrees(Route[i].lgtd, Route[i].lttd, Route[i].height);
                let site = {
                    "ids": Route[i].id,
                    "position_x": cartesian3.x,
                    "position_y": cartesian3.y,
                    "position_z": cartesian3.z,
                    "pitch": Cesium.Math.toRadians(Route[i].pitch),
                    "heading": Cesium.Math.toRadians(Route[i].heading),
                    "roll": Cesium.Math.toRadians(Route[i].roll),
                    "time": Route[i].time
                };
                that.allSites[i] = site;
            }
            this.controlEntities();
        },
        //设置点图片
        setPointImg: function (path) {
        },
        //设置点图片
        setPointImg: function (path) {
            this.img_path = path;
            this.controlEntities();
            this.img_path = path;
            this.controlEntities();
        },
        //mod=0为设置点的可见,1为设置线的可见,2为控制点和线的可见
        setVisible: function (mod, bool) {
            if (mod === 0) {
                this.point_show = bool;
            }
            if (mod === 1) {
                this.line_show = bool;
            }
            if (mod === 2) {
                this.point_show = bool;
                this.line_show = bool;
            }
            this.controlEntities();
        },
        //mod=0为设置点的可见,1为设置线的可见,2为控制点和线的可见
        setVisible: function (mod, bool) {
            if (mod === 0) {
                this.point_show = bool;
            }
            if (mod === 1) {
                this.line_show = bool;
            }
            if (mod === 2) {
                this.point_show = bool;
                this.line_show = bool;
            }
            this.controlEntities();
        },
        //通过传入站点类添加站点
        AddSite: function (newSite) {
            //判断id是否重复
            var bool = that.checkIds(newSite.ids);
            if (bool) {
                return false;
            } else {
                var Site = {};
                Site.position_x = newSite.position_x;
                Site.position_y = newSite.position_y;
                Site.position_z = newSite.position_z;
                Site.heading = newSite.heading;
                Site.pitch = newSite.pitch;
                //Site.roll=camera.roll;
                Site.time = newSite.time;
                Site.ids = newSite.ids;
                that.allSites.push(Site);
                this.controlEntities();
                return true;
            }
        },
        //添加当前视角为站点需要传入id
        AddSiteByView: function (ids) {
            //判断id是否重复
            var bool = that.checkIds(ids);
            if (bool) {
                return false;
            } else {
                try {
                    var position = that.scene.camera.position;
                    //获取当前相机位置参数(飞行用)
                    var Site = {};
                    Site.position_x = position.x;
                    Site.position_y = position.y;
                    Site.position_z = position.z;
                    Site.heading = that.scene.camera.heading;
                    Site.pitch = that.scene.camera.pitch;
                    Site.roll = that.scene.camera.roll;
                    Site.time = 3;
                    Site.ids = ids;
                    //添加到站点数组
                    that.allSites.push(Site);
                    this.controlEntities();
                    return true;
                } catch (e) {
                    return false;
                }
        },
        //通过传入站点类添加站点
        AddSite: function (newSite) {
            //判断id是否重复
            var bool = that.checkIds(newSite.ids);
            if (bool) {
                return false;
            } else {
                var Site = {};
                Site.position_x = newSite.position_x;
                Site.position_y = newSite.position_y;
                Site.position_z = newSite.position_z;
                Site.heading = newSite.heading;
                Site.pitch = newSite.pitch;
                //Site.roll=camera.roll;
                Site.time = newSite.time;
                Site.ids = newSite.ids;
                that.allSites.push(Site);
                this.controlEntities();
                return true;
            }
        },
        //添加当前视角为站点需要传入id
        AddSiteByView: function (ids) {
            //判断id是否重复
            var bool = that.checkIds(ids);
            if (bool) {
                return false;
            } else {
                try {
                    var position = that.scene.camera.position;
                    //获取当前相机位置参数(飞行用)
                    var Site = {};
                    Site.position_x = position.x;
                    Site.position_y = position.y;
                    Site.position_z = position.z;
                    Site.heading = that.scene.camera.heading;
                    Site.pitch = that.scene.camera.pitch;
                    Site.roll = that.scene.camera.roll;
                    Site.time = 3;
                    Site.ids = ids;
                    //添加到站点数组
                    that.allSites.push(Site);
                    this.controlEntities();
                    return true;
                } catch (e) {
                    return false;
                }
            }
        },
        //根据索引获取站点信息
        getSiteByIndex: function (index) {
            return that.allSites[index];
        },
        deleteEntities: function () {
            //50000+为线id
            for (var i = 0; i < that.allSites.length; i++) {
                that.entities.removeById(that.allSites[i].ids);
            }
            for (var i = 1; i < 500000; i++) {
                var ids = parseInt(50000 + i);
                var entities_del = that.entities.getById(ids);
                if (entities_del) {
                    that.entities.remove(entities_del);
                } else {
                    break;
                }
            }
        },
        //根据索引获取站点信息
        getSiteByIndex: function (index) {
            return that.allSites[index];
        },
        deleteEntities: function () {
            //50000+为线id
            for (var i = 0; i < that.allSites.length; i++) {
                that.entities.removeById(that.allSites[i].ids);
            }
            for (var i = 1; i < 500000; i++) {
                var ids = parseInt(50000 + i);
                var entities_del = that.entities.getById(ids);
                if (entities_del) {
                    that.entities.remove(entities_del);
                } else {
                    break;
                }
            }
        },
        controlEntities: function () {
            var position_1, position_2, x1, x2, y1, y2, z1, z2, point_1_cartographic, point_2_cartographic;
            //添加和删除站点,更改颜色或图片后,先清空entities,然后重新添加。
            this.deleteEntities();
            //添加显示的站点
            var length = that.allSites.length;
            if (this.point_show == true) {
                for (var j = 0; j < length; j++) {
                    that.entities.add({
                        position: new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z),
                        billboard: {
                            image: this.img_path,
                            width: 30,
                            height: 40,
                        },
                        //name : 10000+j,
                        id: that.allSites[j].ids
                    });
                }
            }
            //添加显示的线
            if (this.line_show == true) {
                for (var j = 1; j < length; j++) {
                    //将笛卡尔坐标转为经纬度坐标,用于绘制线
                    position_1 = new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z)
                    point_1_cartographic = Cesium.Cartographic.fromCartesian(position_1);
                    x1 = Cesium.Math.toDegrees(point_1_cartographic.longitude);
                    y1 = Cesium.Math.toDegrees(point_1_cartographic.latitude);
                    z1 = point_1_cartographic.height;
            }
        },
        controlEntities: function () {
            var position_1, position_2, x1, x2, y1, y2, z1, z2, point_1_cartographic, point_2_cartographic;
            //添加和删除站点,更改颜色或图片后,先清空entities,然后重新添加。
            this.deleteEntities();
            //添加显示的站点
            var length = that.allSites.length;
            if (this.point_show == true) {
                for (var j = 0; j < length; j++) {
                    that.entities.add({
                        position: new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z),
                        billboard: {
                            image: this.img_path,
                            width: 30,
                            height: 40,
                        },
                        //name : 10000+j,
                        id: that.allSites[j].ids
                    });
                }
            }
            //添加显示的线
            if (this.line_show == true) {
                for (var j = 1; j < length; j++) {
                    //将笛卡尔坐标转为经纬度坐标,用于绘制线
                    position_1 = new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z)
                    point_1_cartographic = Cesium.Cartographic.fromCartesian(position_1);
                    x1 = Cesium.Math.toDegrees(point_1_cartographic.longitude);
                    y1 = Cesium.Math.toDegrees(point_1_cartographic.latitude);
                    z1 = point_1_cartographic.height;
                    position_2 = new Cesium.Cartesian3(that.allSites[j - 1].position_x, that.allSites[j - 1].position_y, that.allSites[j - 1].position_z)
                    point_2_cartographic = Cesium.Cartographic.fromCartesian(position_2);
                    x2 = Cesium.Math.toDegrees(point_2_cartographic.longitude);
                    y2 = Cesium.Math.toDegrees(point_2_cartographic.latitude);
                    z2 = point_2_cartographic.height;
                    that.entities.add({
                        id: 50000 + j,
                        // name : drowallStops.length,
                        polyline: {
                            positions: Cesium.Cartesian3.fromDegreesArrayHeights([x1, y1, z1, x2, y2, z2]),
                            width: 5,
                            material: Cesium.Color.WHITE
                        }
                    });
                    position_2 = new Cesium.Cartesian3(that.allSites[j - 1].position_x, that.allSites[j - 1].position_y, that.allSites[j - 1].position_z)
                    point_2_cartographic = Cesium.Cartographic.fromCartesian(position_2);
                    x2 = Cesium.Math.toDegrees(point_2_cartographic.longitude);
                    y2 = Cesium.Math.toDegrees(point_2_cartographic.latitude);
                    z2 = point_2_cartographic.height;
                    that.entities.add({
                        id: 50000 + j,
                        // name : drowallStops.length,
                        polyline: {
                            positions: Cesium.Cartesian3.fromDegreesArrayHeights([x1, y1, z1, x2, y2, z2]),
                            width: 5,
                            material: Cesium.Color.WHITE
                        }
                    });
                }
            }
            //如果关闭显示了站点和飞行路线,添加的新站点和飞行路线将先不显示
            if (this.line_show == false) {
                for (var j = 1; j < length; j++) {
                    //将笛卡尔坐标转为经纬度坐标,用于绘制线
                    position_1 = new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z)
                    point_1_cartographic = Cesium.Cartographic.fromCartesian(position_1);
                    x1 = Cesium.Math.toDegrees(point_1_cartographic.longitude);
                    y1 = Cesium.Math.toDegrees(point_1_cartographic.latitude);
                    z1 = point_1_cartographic.height;
                }
            }
            //如果关闭显示了站点和飞行路线,添加的新站点和飞行路线将先不显示
            if (this.line_show == false) {
                for (var j = 1; j < length; j++) {
                    //将笛卡尔坐标转为经纬度坐标,用于绘制线
                    position_1 = new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z)
                    point_1_cartographic = Cesium.Cartographic.fromCartesian(position_1);
                    x1 = Cesium.Math.toDegrees(point_1_cartographic.longitude);
                    y1 = Cesium.Math.toDegrees(point_1_cartographic.latitude);
                    z1 = point_1_cartographic.height;
                    position_2 = new Cesium.Cartesian3(that.allSites[j - 1].position_x, that.allSites[j - 1].position_y, that.allSites[j - 1].position_z)
                    point_2_cartographic = Cesium.Cartographic.fromCartesian(position_2);
                    x2 = Cesium.Math.toDegrees(point_2_cartographic.longitude);
                    y2 = Cesium.Math.toDegrees(point_2_cartographic.latitude);
                    z2 = point_2_cartographic.height;
                    that.entities.add({
                        id: 50000 + j,
                        show: false,
                        // name : drowallStops.length,
                        polyline: {
                            positions: Cesium.Cartesian3.fromDegreesArrayHeights([x1, y1, z1, x2, y2, z2]),
                            width: 5,
                            material: Cesium.Color.WHITE
                        }
                    });
                    position_2 = new Cesium.Cartesian3(that.allSites[j - 1].position_x, that.allSites[j - 1].position_y, that.allSites[j - 1].position_z)
                    point_2_cartographic = Cesium.Cartographic.fromCartesian(position_2);
                    x2 = Cesium.Math.toDegrees(point_2_cartographic.longitude);
                    y2 = Cesium.Math.toDegrees(point_2_cartographic.latitude);
                    z2 = point_2_cartographic.height;
                    that.entities.add({
                        id: 50000 + j,
                        show: false,
                        // name : drowallStops.length,
                        polyline: {
                            positions: Cesium.Cartesian3.fromDegreesArrayHeights([x1, y1, z1, x2, y2, z2]),
                            width: 5,
                            material: Cesium.Color.WHITE
                        }
                    });
                }
                }
            }
            if (this.point_show == false) {
                for (var j = 0; j < length; j++) {
                    that.entities.add({
                        position: new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z),
                        billboard: {
                            image: this.img_path,
                            width: 30,
                            height: 40,
                        },
                        show: false,
                        //name : 10000+j,
                        id: that.allSites[j].ids
                    });
                }
            }
        },
        removeAllSites: function () {
            this.deleteEntities();
            that.allSites = [];
            }
            if (this.point_show == false) {
                for (var j = 0; j < length; j++) {
                    that.entities.add({
                        position: new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z),
                        billboard: {
                            image: this.img_path,
                            width: 30,
                            height: 40,
                        },
                        show: false,
                        //name : 10000+j,
                        id: that.allSites[j].ids
                    });
                }
            }
        },
        removeAllSites: function () {
            this.deleteEntities();
            that.allSites = [];
        },
        removeSiteById: function (ids) {
            var id = that.checkIds(ids)
            if (id) {
                this.deleteEntities();
                that.allSites.splice(id, 1);
                this.controlEntities();
        },
        removeSiteById: function (ids) {
            var id = that.checkIds(ids)
            if (id) {
                this.deleteEntities();
                that.allSites.splice(id, 1);
                this.controlEntities();
            } else {
                return false
            }
            } else {
                return false
            }
        }
        }
    };
    this.l = 0;
    this.b = 0;
    //用于判断执行的时暂停还是停止
    this.play_bool = true;
    var x, y, z, p, h;
    this.setInterval_fly = null;
    this.setcamera = function () {
        //设置俯仰角
        var set = that.allSites[that.l].time * 50
        that.viewer.camera.setView({
            orientation: {
                heading: viewer.scene.camera.heading + h / set,
                pitch: viewer.scene.camera.pitch + p / set,
                roll: 0.0
            }
        });
        //move移动相机
        that.viewer.camera.move(new Cesium.Cartesian3(x, y, z), 1 / set);
        that.b--;
        if (that.b <= 0) {
            that.l++;
            clearInterval(that.setInterval_fly);
            that.setInterval_fly = null;
            that.Interval();
            // that.b=0;
        }
    };
    this.Interval = function () {
        var l = that.l;
        if (that.play_bool) {
            that.b = that.allSites[l].time * 50
        } else {
            that.play_bool = true;
        }
        if (that.allSites[l + 1]) {
            x = that.allSites[l + 1].position_x - that.allSites[l].position_x;
            y = that.allSites[l + 1].position_y - that.allSites[l].position_y;
            z = that.allSites[l + 1].position_z - that.allSites[l].position_z;
            p = that.allSites[l + 1].pitch - that.allSites[l].pitch;
            h = that.allSites[l + 1].heading - that.allSites[l].heading;
    };
    this.l = 0;
    this.b = 0;
    //用于判断执行的时暂停还是停止
    this.play_bool = true;
    var x, y, z, p, h;
    this.setInterval_fly = null;
    this.setcamera = function () {
        //设置俯仰角
        var set = that.allSites[that.l].time * 50
        that.viewer.camera.setView({
            orientation: {
                heading: viewer.scene.camera.heading + h / set,
                pitch: viewer.scene.camera.pitch + p / set,
                roll: 0.0
            }
        });
        //move移动相机
        that.viewer.camera.move(new Cesium.Cartesian3(x, y, z), 1 / set);
        that.b--;
        if (that.b <= 0) {
            that.l++;
            clearInterval(that.setInterval_fly);
            that.setInterval_fly = null;
            that.Interval();
            // that.b=0;
        }
    };
    this.Interval = function () {
        var l = that.l;
        if (that.play_bool) {
            that.b = that.allSites[l].time * 50
        } else {
            that.play_bool = true;
        }
        if (that.allSites[l + 1]) {
            x = that.allSites[l + 1].position_x - that.allSites[l].position_x;
            y = that.allSites[l + 1].position_y - that.allSites[l].position_y;
            z = that.allSites[l + 1].position_z - that.allSites[l].position_z;
            p = that.allSites[l + 1].pitch - that.allSites[l].pitch;
            h = that.allSites[l + 1].heading - that.allSites[l].heading;
            var tem = Cesium.Math.toDegrees(that.allSites[l + 1].heading) - Cesium.Math.toDegrees(that.allSites[l].heading);
            if (Math.abs(tem) > 180) {
                if (tem >= 0) {
                    tem = 360 - tem;
                } else {
                    tem = 360 + tem;
                }
                h = Cesium.Math.toRadians(tem);
            }
            //that.b=that.allSites[l].time*20
            that.setInterval_fly = setInterval(that.setcamera, 20);
        } else {
            that.play_bool = true;
            that.l = 0;
            that.scene.screenSpaceCameraController.enableRotate = true;
            that.scene.screenSpaceCameraController.enableTranslate = true;
            that.scene.screenSpaceCameraController.enableZoom = true;
            that.scene.screenSpaceCameraController.enableTilt = true;
            that.scene.screenSpaceCameraController.enableLook = true;
        }
            var tem = Cesium.Math.toDegrees(that.allSites[l + 1].heading) - Cesium.Math.toDegrees(that.allSites[l].heading);
            if (Math.abs(tem) > 180) {
                if (tem >= 0) {
                    tem = 360 - tem;
                } else {
                    tem = 360 + tem;
                }
                h = Cesium.Math.toRadians(tem);
            }
            //that.b=that.allSites[l].time*20
            that.setInterval_fly = setInterval(that.setcamera, 20);
        } else {
            that.play_bool = true;
            that.l = 0;
            that.scene.screenSpaceCameraController.enableRotate = true;
            that.scene.screenSpaceCameraController.enableTranslate = true;
            that.scene.screenSpaceCameraController.enableZoom = true;
            that.scene.screenSpaceCameraController.enableTilt = true;
            that.scene.screenSpaceCameraController.enableLook = true;
        }
    };
    };
    this.flyManager = {
        //用于储存暂停时的位置
        Site_pause: {},
        play: function () {
            //如果之前点的时停止重新开始飞行
            if (that.allSites.length > 1) {
                that.scene.screenSpaceCameraController.enableRotate = false;
                that.scene.screenSpaceCameraController.enableTranslate = false;
                that.scene.screenSpaceCameraController.enableZoom = false;
                that.scene.screenSpaceCameraController.enableTilt = false;
                that.scene.screenSpaceCameraController.enableLook = false;
    this.flyManager = {
        img_path: "widgets/FlyRoute/images/location4.png",
        //用于储存暂停时的位置
        Site_pause: {},
        play: function () {
            for (var i = 0; i < that.allSites.length; i++) {
                that.entities.removeById(that.allSites[i].ids);
            }
            //如果之前点的时停止重新开始飞行
            if (that.allSites.length > 1) {
                that.scene.screenSpaceCameraController.enableRotate = false;
                that.scene.screenSpaceCameraController.enableTranslate = false;
                that.scene.screenSpaceCameraController.enableZoom = false;
                that.scene.screenSpaceCameraController.enableTilt = false;
                that.scene.screenSpaceCameraController.enableLook = false;
                if (that.play_bool) {
                    //设置初始点
                    that.scene.camera.setView({
                        destination: new Cesium.Cartesian3(that.allSites[that.l].position_x, that.allSites[that.l].position_y, that.allSites[that.l].position_z),
                        orientation: {
                            heading: that.allSites[that.l].heading,
                            pitch: that.allSites[that.l].pitch,
                            roll: that.allSites[that.l].roll
                        }
                    });
                    if (that.setInterval_fly) {
                        clearInterval(that.setInterval_fly);
                    }
                    that.Interval();
                if (that.play_bool) {
                    //设置初始点
                    that.scene.camera.setView({
                        destination: new Cesium.Cartesian3(that.allSites[that.l].position_x, that.allSites[that.l].position_y, that.allSites[that.l].position_z),
                        orientation: {
                            heading: that.allSites[that.l].heading,
                            pitch: that.allSites[that.l].pitch,
                            roll: that.allSites[that.l].roll
                        }
                    });
                    if (that.setInterval_fly) {
                        clearInterval(that.setInterval_fly);
                    }
                    that.Interval();
                } else {
                    //如果之前是暂停,继续飞行
                    that.scene.camera.setView({
                        //将经度、纬度、高度的坐标转换为笛卡尔坐标
                        destination: new Cesium.Cartesian3(this.Site_pause.position_x, this.Site_pause.position_y, this.Site_pause.position_z),
                        orientation: {
                            heading: this.Site_pause.heading,
                            pitch: this.Site_pause.pitch,
                            roll: this.Site_pause.roll
                        }
                    });
                } else {
                    //如果之前是暂停,继续飞行
                    that.scene.camera.setView({
                        //将经度、纬度、高度的坐标转换为笛卡尔坐标
                        destination: new Cesium.Cartesian3(this.Site_pause.position_x, this.Site_pause.position_y, this.Site_pause.position_z),
                        orientation: {
                            heading: this.Site_pause.heading,
                            pitch: this.Site_pause.pitch,
                            roll: this.Site_pause.roll
                        }
                    });
                    that.Interval();
                }
            }
                    that.Interval();
                }
            }
        },
        stop: function () {
            if (that.setInterval_fly != null) {
                clearInterval(that.setInterval_fly);
                that.setInterval_fly = null;
            }
            that.l = 0;
            that.play_bool = true;
            that.scene.screenSpaceCameraController.enableRotate = true;
            that.scene.screenSpaceCameraController.enableTranslate = true;
            that.scene.screenSpaceCameraController.enableZoom = true;
            that.scene.screenSpaceCameraController.enableTilt = true;
            that.scene.screenSpaceCameraController.enableLook = true;
        },
        pause: function () {
            if (that.setInterval_fly != null) {
                clearInterval(that.setInterval_fly);
                that.setInterval_fly = null;
                that.play_bool = false;
            }
            //获取暂停时的camera数据
            var position = that.scene.camera.position;
            this.Site_pause.position_x = position.x;
            this.Site_pause.position_y = position.y;
            this.Site_pause.position_z = position.z;
            this.Site_pause.heading = that.scene.camera.heading;
            this.Site_pause.pitch = that.scene.camera.pitch;
            this.Site_pause.roll = that.scene.camera.roll;
        },
        stop: function () {
            //添加显示的站点
            var length = that.allSites.length;
            for (var j = 0; j < length; j++) {
                var flag = false;
                for (var i = 0; i < that.entities.values.length; i++) {
                    if (that.allSites[j].ids == that.entities.values[i].id) {
                        flag = true
                    }
                }
                if (flag == false) {
                    that.entities.add({
                        position: new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z),
                        billboard: {
                            image: this.img_path,
                            width: 30,
                            height: 40,
                        },
                        //name : 10000+j,
                        id: that.allSites[j].ids
                    });
                }
            }
            if (that.setInterval_fly != null) {
                clearInterval(that.setInterval_fly);
                that.setInterval_fly = null;
            }
            that.l = 0;
            that.play_bool = true;
            that.scene.screenSpaceCameraController.enableRotate = true;
            that.scene.screenSpaceCameraController.enableTranslate = true;
            that.scene.screenSpaceCameraController.enableZoom = true;
            that.scene.screenSpaceCameraController.enableTilt = true;
            that.scene.screenSpaceCameraController.enableLook = true;
        },
        pause: function () {
            //添加显示的站点
            var length = that.allSites.length;
            for (var j = 0; j < length; j++) {
                var flag = false;
                for (var i = 0; i < that.entities.values.length; i++) {
                    if (that.allSites[j].ids == that.entities.values[i].id) {
                        flag = true
                    }
                }
                if (flag == false) {
                    that.entities.add({
                        position: new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z),
                        billboard: {
                            image: this.img_path,
                            width: 30,
                            height: 40,
                        },
                        //name : 10000+j,
                        id: that.allSites[j].ids
                    });
                }
            }
            if (that.setInterval_fly != null) {
                clearInterval(that.setInterval_fly);
                that.setInterval_fly = null;
                that.play_bool = false;
            }
            //获取暂停时的camera数据
            var position = that.scene.camera.position;
            this.Site_pause.position_x = position.x;
            this.Site_pause.position_y = position.y;
            this.Site_pause.position_z = position.z;
            this.Site_pause.heading = that.scene.camera.heading;
            this.Site_pause.pitch = that.scene.camera.pitch;
            this.Site_pause.roll = that.scene.camera.roll;
            that.scene.screenSpaceCameraController.enableRotate = true;
            that.scene.screenSpaceCameraController.enableTranslate = true;
            that.scene.screenSpaceCameraController.enableZoom = true;
            that.scene.screenSpaceCameraController.enableTilt = true;
            that.scene.screenSpaceCameraController.enableLook = true;
            that.scene.screenSpaceCameraController.enableRotate = true;
            that.scene.screenSpaceCameraController.enableTranslate = true;
            that.scene.screenSpaceCameraController.enableZoom = true;
            that.scene.screenSpaceCameraController.enableTilt = true;
            that.scene.screenSpaceCameraController.enableLook = true;
        },
        SetStartSite: function (ids) {
            var bool = that.checkIds(ids);
            if (bool) {
                that.l = bool;
                return true;
            } else {
                return false;
            }
        },
        SetStartSite: function (ids) {
            var bool = that.checkIds(ids);
            if (bool) {
                that.l = bool;
                return true;
            } else {
                return false;
            }
        },
        viewToSite: function (site) {
            that.scene.camera.setView({
                destination: new Cesium.Cartesian3(site.position_x, site.position_y, site.position_z),
                orientation: {
                    heading: site.heading,
                    pitch: site.pitch,
                    roll: site.roll
                }
            });
        },
        viewToSite: function (site) {
            that.scene.camera.setView({
                destination: new Cesium.Cartesian3(site.position_x, site.position_y, site.position_z),
                orientation: {
                    heading: site.heading,
                    pitch: site.pitch,
                    roll: site.roll
                }
            });
        }
        }
    };
    };
}
widgets/FlyRoute/flyroute copy.json
File was deleted
widgets/FlyRoute/flyroute.json
@@ -1,238 +1,5 @@
[
    {
        "name": "鄱阳湖区域漫游",
        "sites": [{
            "id": 0,
            "lgtd": 116.07058093094358,
            "lttd": 27.184663292017,
            "height": 532631.4094937699,
            "heading": 359.6129683240469,
            "pitch": -70.00710878828988,
            "roll": 360,
            "time": 6.850034082471008
        }, {
            "id": 1,
            "lgtd": 116.25512974333309,
            "lttd": 27.853702327099285,
            "height": 305470.9898066192,
            "heading": 359.70207852770284,
            "pitch": -69.33940061867362,
            "roll": 360,
            "time": 6.09188099321279
        }, {
            "id": 2,
            "lgtd": 116.87438690284296,
            "lttd": 28.07209675928174,
            "height": 195618.08555063797,
            "heading": 335.78104347667,
            "pitch": -60.15289761069373,
            "roll": 359.9999999999998,
            "time": 3.83931030989409
        }, {
            "id": 3,
            "lgtd": 117.3848954360908,
            "lttd": 28.418880183254686,
            "height": 145578.46205320535,
            "heading": 303.4664334773321,
            "pitch": -51.067133324175536,
            "roll": 0.21269261644604548,
            "time": 3.5540119827310
        }, {
            "id": 4,
            "lgtd": 117.48504208464011,
            "lttd": 29.045157089042483,
            "height": 120793.91646938979,
            "heading": 268.29402900759607,
            "pitch": -50.89234760168597,
            "roll": 0.3245162423802251,
            "time": 4.41772559488863
        }, {
            "id": 5,
            "lgtd": 116.94437687681176,
            "lttd": 29.70740749923287,
            "height": 100271.73076036082,
            "heading": 221.68475847472152,
            "pitch": -50.73760876731254,
            "roll": 0.5294196415387289,
            "time": 3.3793924185111
        }, {
            "id": 6,
            "lgtd": 116.30105729691545,
            "lttd": 29.833951091691258,
            "height": 69066.51546120155,
            "heading": 181.27648139038828,
            "pitch": -50.500089269987804,
            "roll": 0.3071825073204896,
            "time": 2.754614312861
        }, {
            "id": 7,
            "lgtd": 115.77814656571745,
            "lttd": 29.58145675881515,
            "height": 69066.5154612108,
            "heading": 132.4678318250673,
            "pitch": -50.50008926998791,
            "roll": 0.38509722638949384,
            "time": 3.75766326951769
        }, {
            "id": 8,
            "lgtd": 115.46108315235654,
            "lttd": 28.92891807580572,
            "height": 70518.18734055498,
            "heading": 73.48401755402136,
            "pitch": -44.60008123257843,
            "roll": 0.25983005636820594,
            "time": 2.76440055039805
        }, {
            "id": 9,
            "lgtd": 115.81260512558674,
            "lttd": 28.508300457565948,
            "height": 70518.18734055119,
            "heading": 34.14274724799936,
            "pitch": -44.60008123257815,
            "roll": 0.145054389072955,
            "time": 2.20971041939766
        }, {
            "id": 10,
            "lgtd": 116.22128285432908,
            "lttd": 28.29725791623307,
            "height": 70518.18734055535,
            "heading": 7.109417805111491,
            "pitch": -44.60008123257818,
            "roll": 0.19844760769502565,
            "time": 2.49504989630838
        }, {
            "id": 11,
            "lgtd": 116.74255382809167,
            "lttd": 28.402559624562997,
            "height": 70518.1873405681,
            "heading": -23.70028981224687,
            "pitch": -44.60008123257818,
            "roll": 0.21392949135740552,
            "time": 4.63507650428665
        }, {
            "id": 12,
            "lgtd": 117.54126872910363,
            "lttd": 28.521693627213544,
            "height": 126986.38248378983,
            "heading": -63.3672603044896,
            "pitch": -47.43087935636498,
            "roll": 0.3136332255315753,
            "time": 6.916175825561835
        }]
    },
    {
        "name": "鄱阳湖区域浏览2",
        "sites": [{
            "id": 0,
            "lgtd": 116.36485651934478,
            "lttd": 28.61499997888566,
            "height": 21615.65670519218,
            "heading": 357.5324369211186,
            "pitch": -33.949736768804875,
            "roll": 0.07493032373110281,
            "time": 3
        }, {
            "id": 1,
            "lgtd": 116.61798359831062,
            "lttd": 28.678026785994387,
            "height": 21615.65670518082,
            "heading": 328.4540952954534,
            "pitch": -33.9497367688052,
            "roll": 0.1007963589203403,
            "time": 3
        }, {
            "id": 2,
            "lgtd": 116.87603493936163,
            "lttd": 28.921761691820024,
            "height": 21615.6567051778,
            "heading": 287.79156780309444,
            "pitch": -33.94973676880269,
            "roll": 0.12547175713320183,
            "time": 3
        }, {
            "id": 3,
            "lgtd": 116.909026583975,
            "lttd": 29.210477509533032,
            "height": 21615.656705175323,
            "heading": 250.72860434190048,
            "pitch": -33.94973676880164,
            "roll": 0.1182078443376804,
            "time": 3
        }, {
            "id": 4,
            "lgtd": 116.83971215830472,
            "lttd": 29.411874687056383,
            "height": 21615.656705178324,
            "heading": 220.5678813179093,
            "pitch": -33.949736768801614,
            "roll": 0.14418892227725896,
            "time": 3
        }, {
            "id": 5,
            "lgtd": 116.63736760852666,
            "lttd": 29.559276610554274,
            "height": 21615.65670518267,
            "heading": 192.7750271204978,
            "pitch": -33.94973676880136,
            "roll": 0.11990434840510432,
            "time": 3
        }, {
            "id": 6,
            "lgtd": 116.35268250530002,
            "lttd": 29.569093455601525,
            "height": 21615.656705182217,
            "heading": 159.031653642729,
            "pitch": -33.949736768801486,
            "roll": 0.12226477526126023,
            "time": 3
        }, {
            "id": 7,
            "lgtd": 116.03398252452703,
            "lttd": 29.43313255053548,
            "height": 21615.656705183854,
            "heading": 129.44379294438437,
            "pitch": -33.949736768801486,
            "roll": 0.1399973458170845,
            "time": 3
        }, {
            "id": 8,
            "lgtd": 115.56656976497351,
            "lttd": 29.31417361097843,
            "height": 36832.409250694924,
            "heading": 104.1903000851007,
            "pitch": -36.64434419262527,
            "roll": 359.9999999990976,
            "time": 3
        }, {
            "id": 9,
            "lgtd": 115.740825901675,
            "lttd": 28.69543529618644,
            "height": 29061.533148178412,
            "heading": 48.8874638325123,
            "pitch": -37.012291045271574,
            "roll": 0.13594606119813848,
            "time": 3
        }, {
            "id": 10,
            "lgtd": 116.04912917565872,
            "lttd": 28.499254393238655,
            "height": 24977.858469140665,
            "heading": 23.312402615521254,
            "pitch": -36.97115669047082,
            "roll": 0.1669937889431866,
            "time": 3
        }, {
            "id": 11,
            "lgtd": 116.0488849187321,
            "lttd": 27.591614215992426,
            "height": 100049.13699253049,
            "heading": 10.451947125671502,
            "pitch": -37.89649963820525,
            "roll": 0.15288734882291413,
            "time": 3
        }]
    },
    {
        "name": "鄱阳湖国家级保护区倾斜飞行路线1",
        "sites": [{
            "id": 0,
widgets/LeftNavigationBar/Widget.js
@@ -3,977 +3,971 @@
// 模块描述:显示坐标
///////////////////////////////////////////////////////////////////////////
define([
        'dojo/_base/declare',
        'dojo/_base/lang',
        'dojo/_base/array',
        'dojo/_base/html',
        'dojo/topic',
        'jimu/BaseWidget',
        'jimu/utils',
        'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css',
        'libs/zTree_v3/js/jquery.ztree.all'
    ],
    function (declare,
        lang,
        array,
        html,
        topic,
        BaseWidget,
        aspect,
        string,
        utils
    ) {
        return declare([BaseWidget], {
            baseClass: 'jimu-widget-LeftNavigationBar',
            name: 'LeftNavigationBar',
            layers: {},
            dataAllArray: [],
            startup: function () {
                // 暴露在外的接口
                // this.begin(this.data);
                var that = this;
                this.getData();
        'dojo/_base/declare',
        'dojo/_base/lang',
        'dojo/_base/array',
        'dojo/_base/html',
        'dojo/topic',
        'jimu/BaseWidget',
        'jimu/utils',
        'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css',
        'libs/zTree_v3/js/jquery.ztree.all'
    ],
    function (declare,
        lang,
        array,
        html,
        topic,
        BaseWidget,
        aspect,
        string,
        utils
    ) {
        return declare([BaseWidget], {
            baseClass: 'jimu-widget-LeftNavigationBar',
            name: 'LeftNavigationBar',
            layers: {},
            dataAllArray: [],
            startup: function () {
                // 暴露在外的接口
                // this.begin(this.data);
                var that = this;
                this.getData();
                $('.left-navigation-bar-but').click(() => {
                    this.changeImg = !this.changeImg;
                    if (this.changeImg) {
                        $('.l-n-b-b-img').attr("src", "./images/addL/xzuo.png"); //打开
                        $('.jimu-widget-LeftNavigationBar').css({
                            'left': '0px'
                        });
                        $('.jimu-widget-instructions').css({
                            'left': '260px'
                        });
                    } else {
                        $('.l-n-b-b-img').attr("src", "./images/addL/xyou.png"); //关闭
                        $('.jimu-widget-LeftNavigationBar').css({
                            'left': '-250px'
                        });
                        $('.jimu-widget-instructions').css({
                            'left': '10px'
                        });
                    }
                })
                $('.left-navigation-bar-but').click(() => {
                    this.changeImg = !this.changeImg;
                    if (this.changeImg) {
                        $('.l-n-b-b-img').attr("src", "./images/addL/xzuo.png"); //打开
                        $('.jimu-widget-LeftNavigationBar').css({
                            'left': '0px'
                        });
                        $('.jimu-widget-instructions').css({
                            'left': '260px'
                        });
                    } else {
                        $('.l-n-b-b-img').attr("src", "./images/addL/xyou.png"); //关闭
                        $('.jimu-widget-LeftNavigationBar').css({
                            'left': '-250px'
                        });
                        $('.jimu-widget-instructions').css({
                            'left': '10px'
                        });
                    }
                })
                $('.jimu-widget-instructions').css({
                    'left': '260px'
                });
                $('.jimu-widget-instructions').css({
                    'left': '260px'
                });
                $('#left-navigation-bar-main-search').click(() => { //搜索事件
                    leftSearchItemLayer()
                })
                $('#left-navigation-bar-main-search').click(() => { //搜索事件
                    leftSearchItemLayer()
                })
                $(".jimu-widget-LeftNavigationBar input[type='search']").bind('input propertychange', function () {
                    //做一些事情
                    var val = $(this).val();
                $(".jimu-widget-LeftNavigationBar input[type='search']").bind('input propertychange', function () {
                    //做一些事情
                    var val = $(this).val();
                    if (val == '') {
                        that.changeData(that.dataAllArray, val); //重写数据
                        layui.use('tree', function () {
                            layui.tree.reload('demoId1', {
                                data: that.data
                            });
                    if (val == '') {
                        that.changeData(that.dataAllArray, val); //重写数据
                        layui.use('tree', function () {
                            layui.tree.reload('demoId1', {
                                data: that.data
                            });
                            var jqDom = $("#left-tree-list > .layui-tree > div");
                            var jqDom = $("#left-tree-list > .layui-tree > div");
                            for (var i = 0; i < jqDom.length; i++) {
                            for (var i = 0; i < jqDom.length; i++) {
                                var textList = $(jqDom[i]).find('.layui-tree-txt');
                                var textList = $(jqDom[i]).find('.layui-tree-txt');
                                for (var j = 0; j < textList.length; j++) {
                                    $(textList[j]).attr('title', $(textList[j]).text())
                                for (var j = 0; j < textList.length; j++) {
                                    $(textList[j]).attr('title', $(textList[j]).text())
                                }
                                }
                            }
                        })
                    }
                            }
                        })
                    }
                })
                })
                $(".jimu-widget-LeftNavigationBar input[type='search']").keyup(function (e) {
                    if (e.keyCode == 13) {
                        leftSearchItemLayer()
                    }
                })
                $(".jimu-widget-LeftNavigationBar input[type='search']").keyup(function (e) {
                    if (e.keyCode == 13) {
                        leftSearchItemLayer()
                    }
                })
                function leftSearchItemLayer() {
                    var val = $('#left-navigation-bar-main-input').val();
                    if (val != '') {
                        var clearOur = () => {
                                let dom = $(`[data-id]`);
                                dom.removeClass('layui-tree-spread');
                                let domDiv = dom.find('.layui-tree-pack');
                                domDiv.css({
                                    'display': 'none'
                                })
                            },
                            a, useit = (d) => {
                                for (var k in d) {
                                    if (d[k].who == 'father') {
                                        that.father = d[k].id;
                                    }
                                    if (d[k].title && d[k].title.indexOf(val) != -1) { //选中id
                                        a = '' + d[k].id;
                                        // var b = a.split('');
                                        // for (var i in b) {
                                        let id = that.father; //选中项的所有父级id
                                        let dom = $(`[data-id='${id}']`);
                                        dom.addClass('layui-tree-spread');
                                        let domDiv = dom.find('.layui-tree-pack').eq(0);
                                        domDiv.css({
                                            'display': 'block'
                                        })
                                        // }
                                    }
                                    if (d[k].children && d[k].children.length > 0) {
                                        useit(d[k].children);
                                    }
                                }
                            };
                function leftSearchItemLayer() {
                    var val = $('#left-navigation-bar-main-input').val();
                    if (val != '') {
                        var clearOur = () => {
                                let dom = $(`[data-id]`);
                                dom.removeClass('layui-tree-spread');
                                let domDiv = dom.find('.layui-tree-pack');
                                domDiv.css({
                                    'display': 'none'
                                })
                            },
                            a, useit = (d) => {
                                for (var k in d) {
                                    if (d[k].who == 'father') {
                                        that.father = d[k].id;
                                    }
                                    if (d[k].title && d[k].title.indexOf(val) != -1) { //选中id
                                        a = '' + d[k].id;
                                        // var b = a.split('');
                                        // for (var i in b) {
                                        let id = that.father; //选中项的所有父级id
                                        let dom = $(`[data-id='${id}']`);
                                        dom.addClass('layui-tree-spread');
                                        let domDiv = dom.find('.layui-tree-pack').eq(0);
                                        domDiv.css({
                                            'display': 'block'
                                        })
                                        // }
                                    }
                                    if (d[k].children && d[k].children.length > 0) {
                                        useit(d[k].children);
                                    }
                                }
                            };
                        that.changeData(that.dataAllArray, val); //重写数据
                        layui.use('tree', function () {
                            layui.tree.reload('demoId1', {
                                data: that.data
                            });
                            var jqDom = $("#left-tree-list > .layui-tree > div");
                        that.changeData(that.dataAllArray, val); //重写数据
                        layui.use('tree', function () {
                            layui.tree.reload('demoId1', {
                                data: that.data
                            });
                            var jqDom = $("#left-tree-list > .layui-tree > div");
                            for (var i = 0; i < jqDom.length; i++) {
                            for (var i = 0; i < jqDom.length; i++) {
                                var textList = $(jqDom[i]).find('.layui-tree-txt');
                                var textList = $(jqDom[i]).find('.layui-tree-txt');
                                for (var j = 0; j < textList.length; j++) {
                                    $(textList[j]).attr('title', $(textList[j]).text())
                                for (var j = 0; j < textList.length; j++) {
                                    $(textList[j]).attr('title', $(textList[j]).text())
                                }
                                }
                            }
                            }
                            clearOur();
                            useit(that.data);
                        })
                            clearOur();
                            useit(that.data);
                        })
                    }
                }
            },
                    }
                }
            },
            closeToolBox: function (item) {},
            closeToolBox: function (item) {},
            onOpen: function () {
                //面板打开的时候触发 (when open this panel trigger)
            onOpen: function () {
                //面板打开的时候触发 (when open this panel trigger)
            },
            },
            onClose: function () {
                //面板关闭的时候触发 (when this panel is closed trigger)
            },
            onClose: function () {
                //面板关闭的时候触发 (when this panel is closed trigger)
            },
            onMinimize: function () {
                this.resize();
            },
            onMinimize: function () {
                this.resize();
            },
            onMaximize: function () {
                this.resize();
            },
            onMaximize: function () {
                this.resize();
            },
            resize: function () {
            resize: function () {
            },
            getData: function () {
                var that = this;
                var url = 'http://171.34.76.171:8880/pyh-wetResource/GeoData/queryGeoDataTree',
                    that = this;
            },
            getData: function () {
                var that = this;
                var url = 'http://171.34.76.171:8880/pyh-wetResource/GeoData/queryGeoDataTree',
                    that = this;
                axios.get(url, {
                    headers: {
                        "token": 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjI4Nzc0MTIsImV4cCI6MTYyNTQ2OTQxMn0.f2GhYYINfYgSbyKTqqGluyU3rdy_TT8mf15iLILS1l2EUSye_h9O6CSUVWpLYMrdrjzqDWwrbROxfhy-8ly0uA'
                    }
                }).then((res) => {
                    if (res.data.code == '200') {
                        that.dataAllArray = res.data.data;
                        that.changeData(res.data.data, ''); //重写数据
                        that.begin(this.data);
                    }
                })
            },
            changeData: function (val, type) { //重写数据
                var that = this;
                var data = [],
                    i = 1,
                    inits = (d, childData) => {
                        var b = childData || [];
                        for (var k in d) {
                axios.get(url, {
                    headers: {
                        "token": 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjI4Nzc0MTIsImV4cCI6MTYyNTQ2OTQxMn0.f2GhYYINfYgSbyKTqqGluyU3rdy_TT8mf15iLILS1l2EUSye_h9O6CSUVWpLYMrdrjzqDWwrbROxfhy-8ly0uA'
                    }
                }).then((res) => {
                    if (res.data.code == '200') {
                        that.dataAllArray = res.data.data;
                        that.changeData(res.data.data, ''); //重写数据
                        that.begin(this.data);
                    }
                })
            },
            changeData: function (val, type) { //重写数据
                var that = this;
                var data = [],
                    i = 1,
                    inits = (d, childData) => {
                        var b = childData || [];
                        for (var k in d) {
                            let a = {
                                title: d[k].name,
                                // id: d[k].id,
                                // field: String(d[k].id),
                                id: i,
                                field: String(i),
                                src: d[k].serviceUrl,
                                id: d[k].id,
                                serviceName: d[k].serviceName,
                                alpha: 1,
                                checked: d[k].menuStatus
                            }
                            let a = {
                                title: d[k].name,
                                // id: d[k].id,
                                // field: String(d[k].id),
                                id: i,
                                field: String(i),
                                src: d[k].serviceUrl,
                                id: d[k].id,
                                serviceName: d[k].serviceName,
                                alpha: 1,
                                checked: d[k].menuStatus,
                                attList: d[k].attList
                            }
                            if (that[d[k].id]) {
                                a.alpha = that[d[k].id].alpha
                            }
                            if (that[d[k].id]) {
                                a.alpha = that[d[k].id].alpha
                            }
                            if (d[k].serviceUrl && d[k].serviceUrl.length > 0 && d[k].serviceUrl.indexOf('.openrealspace') != -1) {
                                a.model = true
                            }
                            if (d[k].serviceUrl && d[k].serviceUrl.length > 0 && d[k].serviceUrl.indexOf('.openrealspace') != -1) {
                                a.model = true;
                                a.lat = d[k].lat;
                                a.lon = d[k].lon;
                                a.height = d[k].height;
                                a.yawAngle = d[k].yawAngle;
                                a.pitchAngle = d[k].pitchAngle;
                                a.rollAngle = d[k].rollAngle;
                            }
                            if (d[k].name == '三维倾斜数据') {
                                a.model = true
                            }
                            if (d[k].name == '三维倾斜数据') {
                                a.model = true
                            }
                            if (a.model) {
                            b.push(a);
                            i++;
                            if (d[k].children && d[k].children.length > 0) {
                                b[k].children = [];
                                b[k].who = 'father';
                                inits(d[k].children, b[k].children)
                            }
                        }
                                if (that[a.id]) {
                                    Cesium.when(that[a.id], function (layer) {
                                        that.map.scene.layers.remove(layer[0].name)
                                    })
                                }
                    };
                inits(val, data);
                            }
                if (type != '') {
                    for (var i = 0; i < data.length; i++) {
                            b.push(a);
                            i++;
                            if (d[k].children && d[k].children.length > 0) {
                                b[k].children = [];
                                b[k].who = 'father';
                                inits(d[k].children, b[k].children)
                            }
                        }
                        if (data[i].children && data[i].children.length > 0) {
                    };
                inits(val, data);
                            deWeight()
                if (type != '') {
                            function deWeight() {
                                for (var j = 0; j < data[i].children.length; j++) {
                    for (var i = 0; i < data.length; i++) {
                                    if (data[i].children[j].title && data[i].children[j].title.indexOf(type) == -1) {
                                        data[i].children.splice(j, 1);
                                        deWeight();
                                        break;
                        if (data[i].children && data[i].children.length > 0) {
                                    }
                            deWeight()
                                }
                            }
                            function deWeight() {
                                for (var j = 0; j < data[i].children.length; j++) {
                        }
                                    if (data[i].children[j].checked == true) {
                                        var small = data[i].children[j];
                                        if (small.model) {
                                            that.map.scene.globe.depthTestAgainstTerrain = false;
                                            var host = that.returnStr(small.src).host;
                                            var scene = that.map.scene;
                                            var partOfUrl = that.returnStr(small.src).partOfUrl;
                                            //添加S3M图层服务
                                            that[small.id] = scene.open(host + partOfUrl);
                                        }
                                    }
                    }
                    deParentWeight()
                                    if (data[i].children[j].title && data[i].children[j].title.indexOf(type) == -1) {
                                        data[i].children.splice(j, 1);
                                        deWeight();
                                        break;
                    function deParentWeight() {
                        for (var i = 0; i < data.length; i++) {
                                    }
                            if (data[i].children && data[i].children.length == 0) {
                                data.splice(i, 1)
                                deParentWeight();
                                break;
                            }
                                }
                            }
                            if (data[i].children == undefined && data[i].title.indexOf(type) == -1) {
                                data.splice(i, 1)
                                deParentWeight();
                                break;
                        }
                            }
                        }
                    }
                }
                var keyId = this.getUrlKeyId("serviceId");
                if (keyId && keyId != "") {
                    for (var i = 0; i < data.length; i++) {
                    }
                    deParentWeight()
                        if (data[i].id == keyId) {
                            data[i].checked = true
                        }
                    function deParentWeight() {
                        for (var i = 0; i < data.length; i++) {
                        if (data[i].children && data[i].children.length > 0) {
                            if (data[i].children && data[i].children.length == 0) {
                                data.splice(i, 1)
                                deParentWeight();
                                break;
                            }
                            for (var j = 0; j < data[i].children.length; j++) {
                            if (data[i].children == undefined && data[i].title.indexOf(type) == -1) {
                                data.splice(i, 1)
                                deParentWeight();
                                break;
                                if (data[i].children[j].id == keyId) {
                                    data[i].children[j].checked = true
                                }
                            }
                            }
                        }
                    }
                        }
                }
                    }
                }
                var keyId = this.getUrlKeyId("serviceId");
                if (keyId && keyId != "") {
                    for (var i = 0; i < data.length; i++) {
                        if (data[i].id == keyId) {
                            data[i].checked = true
                        }
                this.data = data;
                        for (var j = 0; j < data[i].children.length; j++) {
                            if (data[i].children[j].id == keyId) {
                                data[i].children[j].checked = true
                            }
            },
            begin: function (data) {
                var that = this;
                        }
                    }
                }
                var a = null;
                layui.use(function () {
                    var tree = layui.tree,
                        layer = layui.layer,
                        util = layui.util,
                        $ = layui.$;
                    var slider = layui.slider;
                    tree.render({
                        elem: '#left-tree-list' //默认是点击节点可进行收缩
                            ,
                        data: data,
                        id: 'demoId1',
                        showCheckbox: true, //是否显示复选框
                        customOperate: true,
                        click: function (obj) {
                            var data = obj.data; //获取当前点击的节点数据
                            // layer.msg('状态:' + obj.state + '<br>节点数据:' + JSON.stringify(data));
                            // 树点击三角形样式修改
                            // var ot = $('.layui-tree-iconArrow');
                            // ot.removeClass("left-navigation-bar-main-down");
                            // var jt = $(`[data-id='${data.id}']`).find('.layui-tree-iconArrow').eq(0);
                            // jt.addClass('left-navigation-bar-main-down');
                            // 树点击样式修改
                            // var ot = $('.layui-tree-entry');
                            // ot.removeClass("left-navigation-bar-main-current");
                            // var jh = $(`[data-id='${data.id}']`).find('.layui-tree-entry').eq(0);
                            // jh.addClass('left-navigation-bar-main-current');
                        },
                        showLine: false, //是否开启连接线
                        oncheck: function (obj) {
                this.data = data;
                            if (obj.data.children && obj.data.children.length > 0) {
            },
            begin: function (data) {
                var that = this;
                                // 点击的父
                var a = null;
                                if (obj.checked == true) {
                layui.use(function () {
                    var tree = layui.tree,
                        layer = layui.layer,
                        util = layui.util,
                        $ = layui.$;
                    var slider = layui.slider;
                                    if (obj.data.model) {
                                        that.map.scene.globe.depthTestAgainstTerrain = false;
                                        obj.data.children.forEach(item => {
                                            Cesium.when(that[item.id], function (layer) {
                                                that.map.scene.layers.remove(layer[0].name)
                                            })
                                            var host = that.returnStr(item.src).host;
                                            var scene = that.map.scene;
                                            var partOfUrl = that.returnStr(item.src).partOfUrl;
                                            //添加S3M图层服务
                                            that[item.id] = scene.open(host + partOfUrl);
                                            //定位到场景
                                            Cesium.loadJson(host + partOfUrl + '/scenes.json').then(function (scenes) {
                                                var sname = scenes[0].name;
                                                Cesium.loadJson(host + partOfUrl + '/scenes/' + sname + '.json').then(function (jsonData) {
                                                    Cesium.when(that[item.id], function (layer) {
                                                        //设置相机位置、视角,便于观察场景
                                                        scene.camera.setView({
                                                            destination: new Cesium.Cartesian3.fromDegrees(Number(item.lon), Number(item.lat), Number(item.height)),
                                                            orientation: {
                                                                heading: Cesium.Math.toRadians(Number(item.yawAngle)),
                                                                pitch: Cesium.Math.toRadians(Number(item.pitchAngle)),
                                                                roll: Cesium.Math.toRadians(Number(item.rollAngle))
                                                            }
                                                        });
                                                        if (!scene.pickPositionSupported) {
                                                            alert('不支持深度纹理,无法拾取位置!');
                                                        }
                                                    }, function (e) {
                                                        if (widget._showRenderLoopErrors) {
                                                            var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?';
                                                            widget.showErrorPanel(title, undefined, e);
                                                        }
                                                    });
                                                });
                                            });
                                        });
                                    } else {
                    tree.render({
                        elem: '#left-tree-list' //默认是点击节点可进行收缩
                            ,
                        data: data,
                        id: 'demoId1',
                        showCheckbox: true, //是否显示复选框
                        customOperate: true,
                        click: function (obj) {
                            var data = obj.data; //获取当前点击的节点数据
                            // layer.msg('状态:' + obj.state + '<br>节点数据:' + JSON.stringify(data));
                            // 树点击三角形样式修改
                            // var ot = $('.layui-tree-iconArrow');
                            // ot.removeClass("left-navigation-bar-main-down");
                            // var jt = $(`[data-id='${data.id}']`).find('.layui-tree-iconArrow').eq(0);
                            // jt.addClass('left-navigation-bar-main-down');
                            // 树点击样式修改
                            // var ot = $('.layui-tree-entry');
                            // ot.removeClass("left-navigation-bar-main-current");
                            // var jh = $(`[data-id='${data.id}']`).find('.layui-tree-entry').eq(0);
                            // jh.addClass('left-navigation-bar-main-current');
                        },
                        showLine: false, //是否开启连接线
                        oncheck: function (obj) {
                                        obj.data.children.forEach(item => {
                            var keyId = that.getUrlKeyId("serviceId");
                                            if (that[item.id]) {
                                                that[item.id].show = true
                                                that[item.id].getViewableRectangle().then(function (rectangle) {
                                                    return that.map.camera.flyTo({
                                                        destination: rectangle
                                                    });
                                                });
                                                topic.publish('appendItem', 'Layermanagement', item, that[item.id]);
                                                topic.publish('addLayersLegends', 'legends', item);
                                            } else {
                                                $.ajax({
                                                    url: item.src + '/maps.json',
                                                    type: 'get',
                                                    dataType: 'JSON',
                                                    success: function (res) {
                            if (obj.data.children && obj.data.children.length > 0) {
                                // 点击的父
                                                        that[item.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                                            url: res[0].path,
                                                        }));
                                                        topic.publish('appendItem', 'Layermanagement', item, that[item.id]);
                                                        topic.publish('addLayersLegends', 'legends', item);
                                                        that[item.id].alpha = item.alpha;
                                                        that[item.id].getViewableRectangle().then(function (rectangle) {
                                                            return that.map.camera.flyTo({
                                                                destination: rectangle
                                                            });
                                                        });
                                                    }
                                                })
                                            }
                                        });
                                    }
                                if (obj.checked == true) {
                                    if (obj.data.model) {
                                        obj.data.children.forEach(item => {
                                            var host = that.returnStr(item.src).host;
                                            var scene = that.map.scene;
                                            var partOfUrl = that.returnStr(item.src).partOfUrl;
                                            //添加S3M图层服务
                                            that[item.id] = scene.open(host + partOfUrl);
                                            //定位到场景
                                            Cesium.loadJson(host + partOfUrl + '/scenes.json').then(function (scenes) {
                                                // var sname = scenes[0].name;
                                                // Cesium.loadJson(host + partOfUrl + '/scenes/' + sname + '.json').then(function (jsonData) {
                                                //     var cameraPosition = jsonData.camera;
                                                //     var tilt = Cesium.Math.toRadians(cameraPosition.tilt - 90);
                                                //     Cesium.when(promise, function (layer) {
                                                //         //设置相机位置、视角,便于观察场景
                                                //         scene.camera.setView({
                                                //             destination: new Cesium.Cartesian3.fromDegrees(cameraPosition.longitude, cameraPosition.latitude, cameraPosition.altitude),
                                                //             orientation: {
                                                //                 heading: cameraPosition.heading,
                                                //                 pitch: tilt,
                                                //                 roll: 0
                                                //             }
                                                //         });
                                                //         if (!scene.pickPositionSupported) {
                                                //             alert('不支持深度纹理,无法拾取位置!');
                                                //         }
                                                //     }, function (e) {
                                                //         if (widget._showRenderLoopErrors) {
                                                //             var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?';
                                                //             widget.showErrorPanel(title, undefined, e);
                                                //         }
                                                //     });
                                                // });
                                            });
                                        });
                                    } else {
                                        obj.data.children.forEach(item => {
                                            if (that[item.id]) {
                                                that[item.id].show = true
                                                topic.publish('appendItem', 'Layermanagement', item, that[item.id]);
                                            } else {
                                                $.ajax({
                                                    url: item.src + '/maps.json',
                                                    type: 'get',
                                                    dataType: 'JSON',
                                                    success: function (res) {
                                } else {
                                    if (obj.data.model) {
                                        obj.data.children.forEach(item => {
                                            Cesium.when(that[item.id], function (layer) {
                                                that.map.scene.layers.remove(layer[0].name)
                                            })
                                        });
                                    } else {
                                        obj.data.children.forEach(item => {
                                            if (that[item.id]) {
                                                topic.publish('removeItem', 'Layermanagement', item);
                                                topic.publish('removeLayersLegends', 'legends', item);
                                                that[item.id].show = false;
                                            }
                                        });
                                                        that[item.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                                            url: res[0].path,
                                                        }));
                                                        topic.publish('appendItem', 'Layermanagement', item, that[item.id]);
                                                        that[item.id].alpha = item.alpha
                                    }
                                                        if (keyId && keyId != "") {
                                                            that[item.id].getViewableRectangle().then(function (rectangle) {
                                                                return that.map.camera.flyTo({
                                                                    destination: rectangle
                                                                });
                                                            });
                                                        }
                                                    }
                                                })
                                            }
                                        });
                                }
                                    }
                            } else {
                                // 点击的子
                                if (obj.checked == true) {
                                    if (obj.data.model) {
                                        Cesium.when(that[obj.data.id], function (layer) {
                                            that.map.scene.layers.remove(layer[0].name)
                                        })
                                        that.map.scene.globe.depthTestAgainstTerrain = false;
                                        var host = that.returnStr(obj.data.src).host;
                                        var scene = that.map.scene;
                                        var partOfUrl = that.returnStr(obj.data.src).partOfUrl;
                                        //添加S3M图层服务
                                        that[obj.data.id] = scene.open(host + partOfUrl);
                                        //定位到场景
                                } else {
                                        Cesium.loadJson(host + partOfUrl + '/scenes.json').then(function (scenes) {
                                            var sname = scenes[0].name;
                                            Cesium.loadJson(host + partOfUrl + '/scenes/' + sname + '.json').then(function (jsonData) {
                                                Cesium.when(that[obj.data.id], function (layer) {
                                                    //设置相机位置、视角,便于观察场景
                                                    scene.camera.setView({
                                                        destination: new Cesium.Cartesian3.fromDegrees(Number(obj.data.lon), Number(obj.data.lat), Number(obj.data.height)),
                                                        orientation: {
                                                            heading: Cesium.Math.toRadians(Number(obj.data.yawAngle)),
                                                            pitch: Cesium.Math.toRadians(Number(obj.data.pitchAngle)),
                                                            roll: Cesium.Math.toRadians(Number(obj.data.rollAngle))
                                                        }
                                                    });
                                                    if (!scene.pickPositionSupported) {
                                                        alert('不支持深度纹理,无法拾取位置!');
                                                    }
                                                }, function (e) {
                                                    if (widget._showRenderLoopErrors) {
                                                        var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?';
                                                        widget.showErrorPanel(title, undefined, e);
                                                    }
                                                });
                                            });
                                        });
                                    if (obj.data.model) {
                                        obj.data.children.forEach(item => {
                                            Cesium.when(that[item.id], function (layer) {
                                                that.map.scene.layers.remove(layer[0].name)
                                            })
                                        });
                                    } else {
                                        obj.data.children.forEach(item => {
                                            if (that[item.id]) {
                                                topic.publish('removeItem', 'Layermanagement', item);
                                                that[item.id].show = false;
                                            }
                                        });
                                    } else {
                                    }
                                        if (that[obj.data.id]) {
                                            that[obj.data.id].show = true;
                                            that[obj.data.id].getViewableRectangle().then(function (rectangle) {
                                                return that.map.camera.flyTo({
                                                    destination: rectangle
                                                });
                                            });
                                            topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]);
                                            topic.publish('addLayersLegends', 'legends', obj.data);
                                        } else {
                                            $.ajax({
                                                url: obj.data.src + '/maps.json',
                                                type: 'get',
                                                dataType: 'JSON',
                                                success: function (res) {
                                }
                                                    that[obj.data.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                                        url: res[0].path,
                                                    }));
                            } else {
                                                    topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]);
                                                    topic.publish('addLayersLegends', 'legends', obj.data);
                                                    that[obj.data.id].alpha = obj.data.alpha
                                // 点击的子
                                if (obj.checked == true) {
                                    if (obj.data.model) {
                                        that.map.scene.globe.depthTestAgainstTerrain = false;
                                        var host = that.returnStr(obj.data.src).host;
                                        var scene = that.map.scene;
                                        var partOfUrl = that.returnStr(obj.data.src).partOfUrl;
                                        //添加S3M图层服务
                                        that[obj.data.id] = scene.open(host + partOfUrl);
                                        //定位到场景
                                        Cesium.loadJson(host + partOfUrl + '/scenes.json').then(function (scenes) {
                                            // var sname = scenes[0].name;
                                            // Cesium.loadJson(host + partOfUrl + '/scenes/' + sname + '.json').then(function (jsonData) {
                                            //     var cameraPosition = jsonData.camera;
                                            //     var tilt = Cesium.Math.toRadians(cameraPosition.tilt - 90);
                                            //     Cesium.when(promise, function (layer) {
                                            //         //设置相机位置、视角,便于观察场景
                                            //         scene.camera.setView({
                                            //             destination: new Cesium.Cartesian3.fromDegrees(cameraPosition.longitude, cameraPosition.latitude, cameraPosition.altitude),
                                            //             orientation: {
                                            //                 heading: cameraPosition.heading,
                                            //                 pitch: tilt,
                                            //                 roll: 0
                                            //             }
                                            //         });
                                            //         if (!scene.pickPositionSupported) {
                                            //             alert('不支持深度纹理,无法拾取位置!');
                                            //         }
                                            //     }, function (e) {
                                            //         if (widget._showRenderLoopErrors) {
                                            //             var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?';
                                            //             widget.showErrorPanel(title, undefined, e);
                                            //         }
                                            //     });
                                            // });
                                        });
                                    } else {
                                        if (that[obj.data.id]) {
                                            that[obj.data.id].show = true;
                                            topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]);
                                        } else {
                                            $.ajax({
                                                url: obj.data.src + '/maps.json',
                                                type: 'get',
                                                dataType: 'JSON',
                                                success: function (res) {
                                                    that[obj.data.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                                        url: res[0].path,
                                                    }));
                                                    topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]);
                                                    that[obj.data.id].alpha = obj.data.alpha
                                                    if (keyId && keyId != "") {
                                                        that[obj.data.id].getViewableRectangle().then(function (rectangle) {
                                                            return that.map.camera.flyTo({
                                                                destination: rectangle
                                                            });
                                                        });
                                                    }
                                                }
                                            })
                                        }
                                                    that[obj.data.id].getViewableRectangle().then(function (rectangle) {
                                                        return that.map.camera.flyTo({
                                                            destination: rectangle
                                                        });
                                                    });
                                                }
                                            })
                                        }
                                    }
                                    }
                                } else {
                                } else {
                                    if (obj.data.model) {
                                        Cesium.when(that[obj.data.id], function (layer) {
                                            that.map.scene.layers.remove(layer[0].name)
                                        })
                                    if (obj.data.model) {
                                        Cesium.when(that[obj.data.id], function (layer) {
                                            that.map.scene.layers.remove(layer[0].name)
                                        })
                                    } else {
                                    } else {
                                        if (that[obj.data.id]) {
                                            topic.publish('removeItem', 'Layermanagement', obj.data);
                                            that[obj.data.id].show = false;
                                        }
                                        if (that[obj.data.id]) {
                                            topic.publish('removeItem', 'Layermanagement', obj.data);
                                            topic.publish('removeLayersLegends', 'legends', obj.data);
                                            that[obj.data.id].show = false;
                                        }
                                    }
                                    }
                                }
                                }
                            }
                            }
                            for (var i = 0; i < that.dataAllArray.length; i++) {
                            for (var i = 0; i < that.dataAllArray.length; i++) {
                                if (obj.data.id == that.dataAllArray[i].id) {
                                    that.dataAllArray[i].menuStatus = 1;
                                    break
                                }
                                if (obj.data.id == that.dataAllArray[i].id) {
                                    that.dataAllArray[i].menuStatus = 1;
                                    break
                                }
                                if (that.dataAllArray[i].children && that.dataAllArray[i].children.length > 0) {
                                if (that.dataAllArray[i].children && that.dataAllArray[i].children.length > 0) {
                                    for (var j = 0; j < that.dataAllArray[i].children.length; j++) {
                                    for (var j = 0; j < that.dataAllArray[i].children.length; j++) {
                                        if (obj.data.id == that.dataAllArray[i].children[j].id) {
                                            that.dataAllArray[i].children[j].menuStatus = 1;
                                            break
                                        }
                                        if (obj.data.id == that.dataAllArray[i].children[j].id) {
                                            that.dataAllArray[i].children[j].menuStatus = 1;
                                            break
                                        }
                                    }
                                }
                                    }
                                }
                            }
                        },
                        operate: function (obj) {
                            var type = obj.type; //得到操作类型: add、edit、 del
                            var data = obj.data; //得到当前节点的数据
                            var elem = obj.elem; //得到当前节点元素var deptId = data.id;//得到节点索引var parentId = data.parentId;l/父节点
                            var depId = data.id;
                            var parentId = data.parentId;
                            }
                        },
                        operate: function (obj) {
                            var type = obj.type; //得到操作类型: add、edit、 del
                            var data = obj.data; //得到当前节点的数据
                            var elem = obj.elem; //得到当前节点元素var deptId = data.id;//得到节点索引var parentId = data.parentId;l/父节点
                            var depId = data.id;
                            var parentId = data.parentId;
                        }
                        }
                    });
                    });
                    var jqDom = $("#left-tree-list > .layui-tree > div");
                    var jqDom = $("#left-tree-list > .layui-tree > div");
                    for (var i = 0; i < jqDom.length; i++) {
                        if ($(jqDom[i]).text().indexOf("三维倾斜数据") != -1) {
                            $(jqDom[i]).find('.layui-btn-group').remove()
                        }
                    for (var i = 0; i < jqDom.length; i++) {
                        if ($(jqDom[i]).text().indexOf("三维倾斜数据") != -1) {
                            $(jqDom[i]).find('.layui-btn-group').remove()
                        }
                        var textList = $(jqDom[i]).find('.layui-tree-txt');
                        var textList = $(jqDom[i]).find('.layui-tree-txt');
                        for (var j = 0; j < textList.length; j++) {
                            $(textList[j]).attr('title', $(textList[j]).text())
                        for (var j = 0; j < textList.length; j++) {
                            $(textList[j]).attr('title', $(textList[j]).text())
                        }
                        }
                    }
                    }
                    //按钮事件
                    util.event('lay-demo', {
                        getChecked: function (othis) {
                            var checkedData = tree.getChecked('demoId1'); //获取选中节点的数据
                    //按钮事件
                    util.event('lay-demo', {
                        getChecked: function (othis) {
                            var checkedData = tree.getChecked('demoId1'); //获取选中节点的数据
                            layer.alert(JSON.stringify(checkedData), {
                                shade: 0
                            });
                        },
                        setChecked: function () {
                            tree.setChecked('demoId1', [12, 114]); //勾选指定节点
                        },
                        reload: function () {
                            //重载实例
                            tree.reload('demoId1', {
                            layer.alert(JSON.stringify(checkedData), {
                                shade: 0
                            });
                        },
                        setChecked: function () {
                            tree.setChecked('demoId1', [12, 114]); //勾选指定节点
                        },
                        reload: function () {
                            //重载实例
                            tree.reload('demoId1', {
                            });
                            });
                        }
                    });
                })
            },
            returnStr: function (url) {
                var startIndex = url.indexOf("/iserver");
                var endIndex = url.indexOf("/scenes");
                return {
                    host: url.substring(0, startIndex),
                    partOfUrl: url.substring(startIndex, endIndex)
                }
            },
            changeImg: true,
            father: [],
            data: [{
                title: '采集站点',
                id: 1,
                field: '1'
                    // , checked: true
                    ,
                spread: true,
                children: [{
                    title: '南矶山保护区',
                    id: 11,
                    field: '1-1'
                        // , checked: true
                        ,
                    spread: true,
                    children: [{
                        title: '北深渊',
                        id: 111,
                        field: '1-1-1',
                        checked: true
                    }, {
                        title: '东湖',
                        id: 112,
                        field: '1-1-2',
                        checked: true
                    }, {
                        title: '矶山',
                        id: 113,
                        field: '1-1-3',
                        checked: true
                    }, {
                        title: '打钟山',
                        id: 114,
                        field: '1-1-4',
                        checked: false
                        // , spread: true
                    }]
                }, {
                    title: '五星白鹤保护区',
                    id: 12,
                    field: '1-2',
                    checked: false,
                    spread: false,
                    children: [{
                        title: '北深渊',
                        id: 121,
                        field: '1-2-1'
                    }, {
                        title: '东湖',
                        id: 122,
                        field: '1-2-2'
                    }, {
                        title: '矶山',
                        id: 123,
                        field: '1-2-3'
                    }, {
                        title: '打钟山',
                        id: 124,
                        field: '1-2-4'
                    }]
                }, {
                    title: '都昌候鸟省级自然保护区',
                    id: 13,
                    field: '1-3',
                    checked: false,
                    spread: false,
                    children: [{
                        title: '北深渊',
                        id: 131,
                        field: '1-3-1'
                    }, {
                        title: '东湖',
                        id: 132,
                        field: '1-3-2'
                    }, {
                        title: '矶山',
                        id: 133,
                        field: '1-3-3'
                    }, {
                        title: '打钟山',
                        id: 134,
                        field: '1-3-4'
                    }]
                }, {
                    title: '都昌北鄱阳湿地公园',
                    id: 14,
                    field: '1-4',
                    checked: false,
                    spread: false,
                    children: [{
                        title: '北深渊',
                        id: 141,
                        field: '1-4-1'
                    }, {
                        title: '东湖',
                        id: 142,
                        field: '1-4-2'
                    }, {
                        title: '矶山',
                        id: 143,
                        field: '1-4-3'
                    }, {
                        title: '打钟山',
                        id: 144,
                        field: '1-4-4'
                    }]
                }],
            }, {
                title: '检测站点',
                id: 2,
                field: '2',
                checked: true,
                spread: false,
                children: [{
                    title: '南矶山保护区',
                    id: 21,
                    field: '2-1',
                    children: [{
                        title: '北深渊',
                        id: 211,
                        field: '2-1-1'
                    }, {
                        title: '东湖',
                        id: 212,
                        field: '2-1-2'
                    }, {
                        title: '矶山',
                        id: 213,
                        field: '2-1-3'
                    }, {
                        title: '打钟山',
                        id: 214,
                        field: '2-1-4'
                    }]
                }, {
                    title: '五星白鹤保护区',
                    id: 22,
                    field: '2-2',
                    children: [{
                        title: '北深渊4',
                        id: 221,
                        field: '2-2-1'
                    }, {
                        title: '东湖',
                        id: 222,
                        field: '2-2-2'
                    }, {
                        title: '矶山',
                        id: 223,
                        field: '2-2-3'
                    }, {
                        title: '打钟山',
                        id: 224,
                        field: '2-2-4'
                    }]
                }, {
                    title: '都昌候鸟省级自然保护区',
                    id: 23,
                    field: '2-3',
                    children: [{
                        title: '北深渊',
                        id: 231,
                        field: '2-3-1'
                    }, {
                        title: '东湖',
                        id: 232,
                        field: '2-3-2'
                    }, {
                        title: '矶山',
                        id: 233,
                        field: '2-3-3'
                    }, {
                        title: '打钟山',
                        id: 234,
                        field: '2-3-4'
                    }]
                }, {
                    title: '都昌北鄱阳湿地公园',
                    id: 24,
                    field: '2-4',
                    children: [{
                        title: '北深渊5',
                        id: 241,
                        field: '2-4-1'
                    }, {
                        title: '东湖',
                        id: 242,
                        field: '2-4-2'
                    }, {
                        title: '矶山',
                        id: 243,
                        field: '2-4-3'
                    }, {
                        title: '打钟山',
                        id: 244,
                        field: '2-4-4'
                    }]
                }],
            }, {
                title: '监控站点',
                id: 3,
                field: '3',
                checked: true,
                spread: false,
                children: [{
                    title: '南矶山保护区',
                    id: 31,
                    field: '3-1',
                    children: [{
                        title: '北深渊2',
                        id: 311,
                        field: '3-1-1'
                    }, {
                        title: '东湖',
                        id: 312,
                        field: '3-1-2'
                    }, {
                        title: '矶山',
                        id: 313,
                        field: '3-1-3'
                    }, {
                        title: '打钟山',
                        id: 314,
                        field: '3-1-4'
                    }]
                }, {
                    title: '五星白鹤保护区',
                    id: 32,
                    field: '3-2',
                    children: [{
                        title: '北深渊3',
                        id: 321,
                        field: '3-2-1'
                    }, {
                        title: '东湖',
                        id: 322,
                        field: '3-2-2'
                    }, {
                        title: '矶山',
                        id: 323,
                        field: '3-2-3'
                    }, {
                        title: '打钟山',
                        id: 324,
                        field: '3-2-4'
                    }]
                }, {
                    title: '都昌候鸟省级自然保护区',
                    id: 33,
                    field: '3-3',
                    children: [{
                        title: '北深渊',
                        id: 331,
                        field: '3-3-1'
                    }, {
                        title: '东湖',
                        id: 332,
                        field: '3-3-2'
                    }, {
                        title: '矶山',
                        id: 333,
                        field: '3-3-3'
                    }, {
                        title: '打钟山',
                        id: 334,
                        field: '3-3-4'
                    }]
                }, {
                    title: '都昌北鄱阳湿地公园',
                    id: 34,
                    field: '3-4',
                    children: [{
                        title: '北深渊1',
                        id: 341,
                        field: '3-4-1'
                    }, {
                        title: '东湖',
                        id: 342,
                        field: '3-4-2'
                    }, {
                        title: '矶山',
                        id: 343,
                        field: '3-4-3'
                    }, {
                        title: '打钟山',
                        id: 344,
                        field: '3-4-4'
                    }]
                }],
            }],
            getUrlKeyId: function (name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return decodeURI(r[2]);
                return null;
            },
            destroy: function () {
                //销毁的时候触发
                //todo
                //do something before this func
                this.inherited(arguments);
            }
                        }
                    });
                })
            },
            returnStr: function (url) {
                var startIndex = url.indexOf("/iserver");
                var endIndex = url.indexOf("/scenes");
                return {
                    host: url.substring(0, startIndex),
                    partOfUrl: url.substring(startIndex, endIndex)
                }
            },
            changeImg: true,
            father: [],
            data: [{
                title: '采集站点',
                id: 1,
                field: '1'
                    // , checked: true
                    ,
                spread: true,
                children: [{
                    title: '南矶山保护区',
                    id: 11,
                    field: '1-1'
                        // , checked: true
                        ,
                    spread: true,
                    children: [{
                        title: '北深渊',
                        id: 111,
                        field: '1-1-1',
                        checked: true
                    }, {
                        title: '东湖',
                        id: 112,
                        field: '1-1-2',
                        checked: true
                    }, {
                        title: '矶山',
                        id: 113,
                        field: '1-1-3',
                        checked: true
                    }, {
                        title: '打钟山',
                        id: 114,
                        field: '1-1-4',
                        checked: false
                        // , spread: true
                    }]
                }, {
                    title: '五星白鹤保护区',
                    id: 12,
                    field: '1-2',
                    checked: false,
                    spread: false,
                    children: [{
                        title: '北深渊',
                        id: 121,
                        field: '1-2-1'
                    }, {
                        title: '东湖',
                        id: 122,
                        field: '1-2-2'
                    }, {
                        title: '矶山',
                        id: 123,
                        field: '1-2-3'
                    }, {
                        title: '打钟山',
                        id: 124,
                        field: '1-2-4'
                    }]
                }, {
                    title: '都昌候鸟省级自然保护区',
                    id: 13,
                    field: '1-3',
                    checked: false,
                    spread: false,
                    children: [{
                        title: '北深渊',
                        id: 131,
                        field: '1-3-1'
                    }, {
                        title: '东湖',
                        id: 132,
                        field: '1-3-2'
                    }, {
                        title: '矶山',
                        id: 133,
                        field: '1-3-3'
                    }, {
                        title: '打钟山',
                        id: 134,
                        field: '1-3-4'
                    }]
                }, {
                    title: '都昌北鄱阳湿地公园',
                    id: 14,
                    field: '1-4',
                    checked: false,
                    spread: false,
                    children: [{
                        title: '北深渊',
                        id: 141,
                        field: '1-4-1'
                    }, {
                        title: '东湖',
                        id: 142,
                        field: '1-4-2'
                    }, {
                        title: '矶山',
                        id: 143,
                        field: '1-4-3'
                    }, {
                        title: '打钟山',
                        id: 144,
                        field: '1-4-4'
                    }]
                }],
            }, {
                title: '检测站点',
                id: 2,
                field: '2',
                checked: true,
                spread: false,
                children: [{
                    title: '南矶山保护区',
                    id: 21,
                    field: '2-1',
                    children: [{
                        title: '北深渊',
                        id: 211,
                        field: '2-1-1'
                    }, {
                        title: '东湖',
                        id: 212,
                        field: '2-1-2'
                    }, {
                        title: '矶山',
                        id: 213,
                        field: '2-1-3'
                    }, {
                        title: '打钟山',
                        id: 214,
                        field: '2-1-4'
                    }]
                }, {
                    title: '五星白鹤保护区',
                    id: 22,
                    field: '2-2',
                    children: [{
                        title: '北深渊4',
                        id: 221,
                        field: '2-2-1'
                    }, {
                        title: '东湖',
                        id: 222,
                        field: '2-2-2'
                    }, {
                        title: '矶山',
                        id: 223,
                        field: '2-2-3'
                    }, {
                        title: '打钟山',
                        id: 224,
                        field: '2-2-4'
                    }]
                }, {
                    title: '都昌候鸟省级自然保护区',
                    id: 23,
                    field: '2-3',
                    children: [{
                        title: '北深渊',
                        id: 231,
                        field: '2-3-1'
                    }, {
                        title: '东湖',
                        id: 232,
                        field: '2-3-2'
                    }, {
                        title: '矶山',
                        id: 233,
                        field: '2-3-3'
                    }, {
                        title: '打钟山',
                        id: 234,
                        field: '2-3-4'
                    }]
                }, {
                    title: '都昌北鄱阳湿地公园',
                    id: 24,
                    field: '2-4',
                    children: [{
                        title: '北深渊5',
                        id: 241,
                        field: '2-4-1'
                    }, {
                        title: '东湖',
                        id: 242,
                        field: '2-4-2'
                    }, {
                        title: '矶山',
                        id: 243,
                        field: '2-4-3'
                    }, {
                        title: '打钟山',
                        id: 244,
                        field: '2-4-4'
                    }]
                }],
            }, {
                title: '监控站点',
                id: 3,
                field: '3',
                checked: true,
                spread: false,
                children: [{
                    title: '南矶山保护区',
                    id: 31,
                    field: '3-1',
                    children: [{
                        title: '北深渊2',
                        id: 311,
                        field: '3-1-1'
                    }, {
                        title: '东湖',
                        id: 312,
                        field: '3-1-2'
                    }, {
                        title: '矶山',
                        id: 313,
                        field: '3-1-3'
                    }, {
                        title: '打钟山',
                        id: 314,
                        field: '3-1-4'
                    }]
                }, {
                    title: '五星白鹤保护区',
                    id: 32,
                    field: '3-2',
                    children: [{
                        title: '北深渊3',
                        id: 321,
                        field: '3-2-1'
                    }, {
                        title: '东湖',
                        id: 322,
                        field: '3-2-2'
                    }, {
                        title: '矶山',
                        id: 323,
                        field: '3-2-3'
                    }, {
                        title: '打钟山',
                        id: 324,
                        field: '3-2-4'
                    }]
                }, {
                    title: '都昌候鸟省级自然保护区',
                    id: 33,
                    field: '3-3',
                    children: [{
                        title: '北深渊',
                        id: 331,
                        field: '3-3-1'
                    }, {
                        title: '东湖',
                        id: 332,
                        field: '3-3-2'
                    }, {
                        title: '矶山',
                        id: 333,
                        field: '3-3-3'
                    }, {
                        title: '打钟山',
                        id: 334,
                        field: '3-3-4'
                    }]
                }, {
                    title: '都昌北鄱阳湿地公园',
                    id: 34,
                    field: '3-4',
                    children: [{
                        title: '北深渊1',
                        id: 341,
                        field: '3-4-1'
                    }, {
                        title: '东湖',
                        id: 342,
                        field: '3-4-2'
                    }, {
                        title: '矶山',
                        id: 343,
                        field: '3-4-3'
                    }, {
                        title: '打钟山',
                        id: 344,
                        field: '3-4-4'
                    }]
                }],
            }],
            getUrlKeyId: function (name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return decodeURI(r[2]);
                return null;
            },
            destroy: function () {
                //销毁的时候触发
                //todo
                //do something before this func
                this.inherited(arguments);
            }
        });
    });
        });
    });
widgets/Tool/Widget.js
@@ -80,6 +80,7 @@
                    // 关闭标记
                    topic.publish('closeSign', 'Sign');
                    topic.publish('closeFlyRoute', 'FlyRoute');
                    $('.jimu-widget-CoorPosition').hide();
                    $('.jimu-widget-MapPrinting').hide();
                    
widgets/legends/Widget.html
@@ -14,8 +14,11 @@
            <div class="m-init"> <i class="m-init-h"><img src="./images/addL/监测.png" /></i> 监测站点 <i>(0个)</i> </div>
            <!-- <div class="m-init m-i-child"> <i></i> 大湖池 <i>(1个)</i> </div> -->
        </div>
        <div class="m-init"> <i class="m-init-h"><img src="./images/addL/forgin.png" /></i> 鄱阳湖面积 <i>(3253.52公顷)</i> </div>
        <ul class="layer-legends">
        </ul>
        <!-- <div class="m-init"> <i class="m-init-h"><img src="./images/addL/forgin.png" /></i> 鄱阳湖面积 <i>(3253.52公顷)</i> </div>
        <div class="m-init"> <i class="m-init-h"><img src="./images/addL/fred.png" /></i> 鄱阳湖范围 <i></i> </div>
        <div class="m-init"> <i class="m-init-h ccsliu"><img src="./images/addL/fblue.png" /></i> 其他 <i></i> </div>
        <div class="m-init"> <i class="m-init-h ccsliu"><img src="./images/addL/fblue.png" /></i> 其他 <i></i> </div> -->
    </div>
</div>
widgets/legends/Widget.js
@@ -3,140 +3,164 @@
// 模块描述:显示坐标
///////////////////////////////////////////////////////////////////////////
define([
    'dojo/_base/declare',
    'dojo/_base/lang',
    'dojo/_base/array',
    'dojo/_base/html',
    'dojo/topic',
    'jimu/BaseWidget',
    'jimu/utils',
    'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css',
    'libs/zTree_v3/js/jquery.ztree.all'
],
    function (declare,
        lang,
        array,
        html,
        topic,
        BaseWidget,
        aspect,
        string,
        utils
    ) {
        return declare([BaseWidget], {
            baseClass: 'jimu-widget-legends',
            name: 'legends',
            layers: {},
            startup: function () {
                // 暴露在外的接口
                topic.subscribe("getLegendsData", lang.hitch(this, this.onGetLegendsData));
        'dojo/_base/declare',
        'dojo/_base/lang',
        'dojo/_base/array',
        'dojo/_base/html',
        'dojo/topic',
        'jimu/BaseWidget',
        'jimu/utils',
        'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css',
        'libs/zTree_v3/js/jquery.ztree.all'
    ],
    function (declare,
        lang,
        array,
        html,
        topic,
        BaseWidget,
        aspect,
        string,
        utils
    ) {
        return declare([BaseWidget], {
            baseClass: 'jimu-widget-legends',
            name: 'legends',
            layers: {},
            startup: function () {
                // 暴露在外的接口
                topic.subscribe("getLegendsData", lang.hitch(this, this.onGetLegendsData));
                topic.subscribe("addLayersLegends", lang.hitch(this, this.addLayersLegends));
                topic.subscribe("removeLayersLegends", lang.hitch(this, this.removeLayersLegends));
            },
            onGetLegendsData: function (item) {
                var val = item == '  ' ? '' : item;
                // console.log(val)
                var that = this
                    , twoData = []
                    // url = `http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorData?name=&start&limit&type=${index}`
                    , token = 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjMyMjU5OTcsImV4cCI6MTYyNTgxNzk5N30.zWpoKa5AK7xLIPNm-CXoHY9D5kpk9AiUTGkuAQOZi2Rdl2BfroT4IqxjBpyUPZlgwCjG2CoJqy_7rnnodpmqNw'
                    , myGet = function (val, i) {
                        var url = `http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorData?name=${val}&start&limit&type=${i}`;
                        axios.get(url, {
                            headers: {
                                'token': token
                            }
                        }).then((res) => {
                            if (res.data.code == 200) {
                                var data = res.data.data.panoramaList || res.data.data.stationList || res.data.data.videoList || []
                                    , onceData = {};
                                // console.log(data);
                                for (var k in data) {
                                    if (i == 0) {
                                        onceData[data[k].protectArea] = onceData[data[k].protectArea] == undefined ? 1 : onceData[data[k].protectArea] += 1;
                                    } else if (i == 2) {
                                        onceData[data[k].protectName] = onceData[data[k].protectName] == undefined ? 1 : onceData[data[k].protectName] += 1;
                                    } else if (i == 1) {
                                        onceData[data[k].wetlandName_] = onceData[data[k].wetlandName_] == undefined ? 1 : onceData[data[k].wetlandName_] += 1;
                                    }
                                }
                                twoData.push(onceData)
                                if (i == 2) {
                                    ready(twoData, item);
                                }
                            } else {
                                console.log('请求访问失败')
                            }
                        })
                    }
                    , ready = function (d, val) {
                        // console.log(d);
                        if (val == '') {
                            d = {};
                        }
                        var init = (data, dom, img) => {
                            var q = data
                                , num = 0
                                , strq
                                , domq = $(dom)
                                , h = '';
                            domq.empty();
                            for (var k in q) {
                                num += q[k];
                                h += `<div class="m-init m-i-child"> <i></i> ${k}<i>(${q[k]}个)</i> </div>`;
                            }
                            strq = `<div class="m-init"> <i><img src="./images/addL/${img}.png" /></i> ${img}站点 <i>(${num}个)</i> </div>` + h;
                            domq.append(strq);
                        }
                        // 全景
                        init(d[0], '#legendsInquanjing', '全景');
                        // 监控
                        init(d[2], '#legendsInjiankong', '监控');
                        // 监测
                        init(d[1], '#legendsInjiance', '监测');
                    }
                    , doit = () => {
                        var i = 0;
                        myGet(val, i);
                        var i = 1;
                        myGet(val, i);
                        var i = 2;
                        myGet(val, i);
            },
            onGetLegendsData: function (item) {
                var val = item == '  ' ? '' : item;
                var that = this,
                    twoData = []
                    // url = `http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorData?name=&start&limit&type=${index}`
                    ,
                    token = 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjMyMjU5OTcsImV4cCI6MTYyNTgxNzk5N30.zWpoKa5AK7xLIPNm-CXoHY9D5kpk9AiUTGkuAQOZi2Rdl2BfroT4IqxjBpyUPZlgwCjG2CoJqy_7rnnodpmqNw',
                    myGet = function (val, i) {
                        var url = `http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorData?name=${val}&start&limit&type=${i}`;
                        axios.get(url, {
                            headers: {
                                'token': token
                            }
                        }).then((res) => {
                            if (res.data.code == 200) {
                                var data = res.data.data.panoramaList || res.data.data.stationList || res.data.data.videoList || [],
                                    onceData = {};
                                for (var k in data) {
                                    if (i == 0) {
                                        onceData[data[k].protectArea] = onceData[data[k].protectArea] == undefined ? 1 : onceData[data[k].protectArea] += 1;
                                    } else if (i == 2) {
                                        onceData[data[k].protectName] = onceData[data[k].protectName] == undefined ? 1 : onceData[data[k].protectName] += 1;
                                    } else if (i == 1) {
                                        onceData[data[k].wetlandName_] = onceData[data[k].wetlandName_] == undefined ? 1 : onceData[data[k].wetlandName_] += 1;
                                    }
                                }
                                twoData.push(onceData)
                                if (i == 2) {
                                    ready(twoData, item);
                                }
                            } else {
                                console.log('请求访问失败')
                            }
                        })
                    },
                    ready = function (d, val) {
                        if (val == '') {
                            d = {};
                        }
                        var init = (data, dom, img) => {
                            var q = data,
                                num = 0,
                                strq, domq = $(dom),
                                h = '';
                            domq.empty();
                            for (var k in q) {
                                num += q[k];
                                h += `<div class="m-init m-i-child"> <i></i> ${k}<i>(${q[k]}个)</i> </div>`;
                            }
                            strq = `<div class="m-init"> <i><img src="./images/addL/${img}.png" /></i> ${img}站点 <i>(${num}个)</i> </div>` + h;
                            domq.append(strq);
                        }
                        // 全景
                        init(d[0], '#legendsInquanjing', '全景');
                        // 监控
                        init(d[2], '#legendsInjiankong', '监控');
                        // 监测
                        init(d[1], '#legendsInjiance', '监测');
                    },
                    doit = () => {
                        var i = 0;
                        myGet(val, i);
                        var i = 1;
                        myGet(val, i);
                        var i = 2;
                        myGet(val, i);
                    }
                    }
                doit();
            },
            closeToolBox: function (item) {
            },
                doit();
            },
            addLayersLegends: function (item, obj) {
            onOpen: function () {
                //面板打开的时候触发 (when open this panel trigger)
            },
                if (item == this.name) {
                    if (obj.attList && obj.attList.length > 0) {
                        for (var i = 0; i < obj.attList.length; i++) {
                            var list = $("<li class='m-init' itemid='" + obj.id + "'>" +
                                "<i class='m-init-h'><img src='" + obj.attList[i].uaOriginPath + "' /></i>" +
                                "<span title='" + obj.title + "'>" +
                                obj.title +
                                "</span>" +
                                "</li>")
            onClose: function () {
                //面板关闭的时候触发 (when this panel is closed trigger)
            },
                            $(".jimu-widget-legends .layer-legends").append(list);
                        }
                    }
                }
            },
            removeLayersLegends: function (item, obj) {
                if (item == this.name) {
                    var liList = $(".jimu-widget-legends .layer-legends li");
                    for (var i = 0; i < liList.length; i++) {
                        if ($(liList[i]).attr('itemid') && $(liList[i]).attr('itemid') == obj.id) {
                            $(liList[i]).remove();
                        }
                    }
                }
            },
            closeToolBox: function (item) {},
            onMinimize: function () {
                this.resize();
            },
            onOpen: function () {
                //面板打开的时候触发 (when open this panel trigger)
            },
            onMaximize: function () {
                this.resize();
            },
            onClose: function () {
                //面板关闭的时候触发 (when this panel is closed trigger)
            },
            resize: function () {
            onMinimize: function () {
                this.resize();
            },
            },
            begin: function () {
            },
            onMaximize: function () {
                this.resize();
            },
            destroy: function () {
                //销毁的时候触发
                //todo
                //do something before this func
                this.inherited(arguments);
            }
            resize: function () {
        });
    });
            },
            begin: function () {},
            destroy: function () {
                //销毁的时候触发
                //todo
                //do something before this func
                this.inherited(arguments);
            }
        });
    });
widgets/legends/css/style.css
@@ -12,12 +12,12 @@
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  /* border-right : 1px solid rgba(0, 0, 0, 0.3); */
  border-radius: 6px 6px 6px 6px;
  border-radius: 8px;
  /* text-align   : center; */
  /* cursor       : pointer; */
  z-index: 15 !important;
  box-sizing: border-box;
  padding: 0 6px 0 6px!important;
  padding: 0 8px 8px 8px!important;
  /* overflow: auto; */
  transition: all 0.5s;
}
@@ -73,4 +73,25 @@
.jimu-widget-legends .main .m-i-child i:nth-child(1) {
  /* margin-right: 30px !important; */
}
.jimu-widget-legends .layer-legends li {
    height: 36px;
    line-height: 36px;
}
.jimu-widget-legends .layer-legends li .m-init-h {
    width: auto;
    margin-right: 10px !important;
}
.jimu-widget-legends .layer-legends li .m-init-h img {
    width: auto;
    height: 28px;
    margin: 0 !important;
}
.jimu-widget-legends .layer-legends li span{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}