liuyg
2021-06-17 3c3d6b18872b4a56e1e6b3682f6ceb5b1b4069a2
解决冲突
7 files modified
1 files added
211 ■■■■■ changed files
config.json 20 ●●●● patch | view | raw | blame | history
images/layer-control.png patch | view | raw | blame | history
widgets/LeftNavigationBar/Widget.js 179 ●●●●● patch | view | raw | blame | history
widgets/MapPrinting/nls/zh-cn/strings.js 2 ●●● patch | view | raw | blame | history
widgets/ShowPosition/css/style.css 2 ●●● patch | view | raw | blame | history
widgets/Tool/Widget.html 2 ●●● patch | view | raw | blame | history
widgets/legends/css/style.css 2 ●●● patch | view | raw | blame | history
widgets/searchL/Widget.js 4 ●●●● patch | view | raw | blame | history
config.json
@@ -92,6 +92,16 @@
          "relativeTo": "map"
        }
      },
   {
        "uri": "widgets/ShowPosition/Widget",
        "position": {
          "right": 0,
          "bottom": 0,
          "width": "100%",
          "height": "25px",
          "relativeTo": "map"
        }
      },
      {
        "name": "图上量算",
        "uri": "widgets/Measurement/Widget",
@@ -130,7 +140,7 @@
        }
      },
      {
        "name": "地图打印",
        "name": "场景快照",
        "uri": "widgets/MapPrinting/Widget",
        "position": {
          "right": 10,
@@ -387,10 +397,10 @@
    ],
    "mapOptions": {
      "positionInfo": {
        "xmin": 111.807347,
        "ymin": 30.840173,
        "xmax": 120.020036,
        "ymax": 27.215672
        "xmin": 114.017758,
        "ymin": 29.805021,
        "xmax": 118.100216,
        "ymax": 28.141914
      },
      "animation": false,
      "baseLayerPicker": true,
images/layer-control.png
widgets/LeftNavigationBar/Widget.js
@@ -121,7 +121,7 @@
                                    if (d[k].who == 'father') {
                                        that.father = d[k].id;
                                    }
                                    if (d[k].title.indexOf(val) != -1) { //选中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) {
@@ -134,11 +134,12 @@
                                        })
                                        // }
                                    }
                                    if (d[k].children) {
                                    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', {
@@ -230,7 +231,11 @@
                                checked: d[k].menuStatus
                            }
                            if (d[k].serviceUrl.indexOf('.openrealspace') != -1) {
                            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
                            }
@@ -246,17 +251,11 @@
                                    })
                                }
                            } else {
                                if (that[a.id]) {
                                    that.map.imageryLayers.remove(that[a.id]);
                                }
                            }
                            b.push(a);
                            i++;
                            if (d[k].children.length != 0) {
                            if (d[k].children && d[k].children.length > 0) {
                                b[k].children = [];
                                b[k].who = 'father';
                                inits(d[k].children, b[k].children)
@@ -265,18 +264,6 @@
                    };
                inits(val, data);
                // var i = 0,
                //     ccinit = (a) => {
                //         i++;
                //         for (let k in a) {
                //             if (a[k].children) {
                //                 a[k].who = i;
                //                 ccinit(a[k].children)
                //             }
                //         }
                //     };
                // ccinit(this.data);
                if (type != '') {
@@ -288,12 +275,47 @@
                            function deWeight() {
                                for (var j = 0; j < data[i].children.length; j++) {
                                    if (data[i].children[j].title.indexOf(type) == -1) {
                                    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);
                                        } else {
                                            if (that[small.id]) {
                                                that[small.id].show = true
                                            } else {
                                                $.ajax({
                                                    url: small.src + '/maps.json',
                                                    type: 'get',
                                                    dataType: 'JSON',
                                                    success: function (res) {
                                                        that[small.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                                            url: res[0].path,
                                                        }));
                                                        that[small.id].alpha = small.alpha
                                                    }
                                                })
                                            }
                                        }
                                    }
                                    if (data[i].children[j].title && data[i].children[j].title.indexOf(type) == -1) {
                                        data[i].children.splice(j, 1);
                                        deWeight();
                                        break;
                                    }
                                }
                            }
@@ -341,7 +363,7 @@
                            if (data[i].children[j].id == keyId) {
                                data[i].children[j].checked = true
                            }
                        }
                    }
                }
@@ -387,9 +409,7 @@
                        },
                        showLine: false, //是否开启连接线
                        oncheck: function (obj) {
                            // console.log(obj.data.id, '--', obj.checked, obj); //得到当前点击的节点数据
                            // console.log(obj.checked); //得到当前节点的展开状态:open、close、normal
                            // console.log(obj.elem); //得到当前节点元素
                            var keyId = that.getUrlKeyId("serviceId");
                            if (obj.data.children && obj.data.children.length > 0) {
@@ -439,26 +459,31 @@
                                    } else {
                                        obj.data.children.forEach(item => {
                                            $.ajax({
                                                url: item.src + '/maps.json',
                                                type: 'get',
                                                dataType: 'JSON',
                                                success: function (res) {
                                                    that[item.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                                        url: res[0].path,
                                                    }));
                                                    that[item.id].alpha = item.alpha
                                            if (that[item.id]) {
                                                that[item.id].show = true
                                            } else {
                                                $.ajax({
                                                    url: item.src + '/maps.json',
                                                    type: 'get',
                                                    dataType: 'JSON',
                                                    success: function (res) {
                                                    if (keyId && keyId != "") {
                                                        that[item.id].getViewableRectangle().then(function (rectangle) {
                                                            return that.map.camera.flyTo({
                                                                destination: rectangle
                                                        that[item.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                                            url: res[0].path,
                                                        }));
                                                        that[item.id].alpha = item.alpha
                                                        if (keyId && keyId != "") {
                                                            that[item.id].getViewableRectangle().then(function (rectangle) {
                                                                return that.map.camera.flyTo({
                                                                    destination: rectangle
                                                                });
                                                            });
                                                        });
                                                        }
                                                    }
                                                }
                                            })
                                                })
                                            }
                                        });
@@ -478,7 +503,7 @@
                                        });
                                    } else {
                                        obj.data.children.forEach(item => {
                                            if (that[item.id]) that.map.imageryLayers.remove(that[item.id]);
                                            if (that[item.id]) that[item.id].show = false
                                        });
                                    }
@@ -531,26 +556,30 @@
                                    } 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,
                                                }));
                                                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
                                        if (that[obj.data.id]) {
                                            that[obj.data.id].show = true
                                        } 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,
                                                    }));
                                                    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
                                                            });
                                                        });
                                                    });
                                                    }
                                                }
                                            }
                                        })
                                            })
                                        }
                                    }
@@ -563,7 +592,8 @@
                                        })
                                    } else {
                                        that.map.imageryLayers.remove(that[obj.data.id]);
                                        if (that[obj.data.id]) that[obj.data.id].show = false
                                    }
@@ -571,6 +601,27 @@
                                }
                            }
                            for (var i = 0; i < that.dataAllArray.length; i++) {
                                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) {
                                    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
                                        }
                                    }
                                }
                            }
                        },
@@ -584,8 +635,6 @@
                            if (type == 'add') {
                                $(".jimu-widget-LeftNavigationBar .tree-layer-opcity ul").empty();
                                // console.log(type, data, elem, depId, parentId)
                                if (data.children) {
widgets/MapPrinting/nls/zh-cn/strings.js
@@ -1,5 +1,5 @@
define(
   ({
    _widgetLabel: "地图打印"
    _widgetLabel: "场景快照"
  })
);
widgets/ShowPosition/css/style.css
@@ -2,7 +2,7 @@
  position: relative;
  font-size: 12px;
  line-height: 25px;
  min-width: 900px;
  width: 320px !important;
  background: rgba(38, 38, 38, 0.75);
  color: #fff;
  z-index: 3 !important;
widgets/Tool/Widget.html
@@ -9,7 +9,7 @@
                <li class="splitScreen-tool"><i></i> <span>分屏对比</span></li>
                <li class="sign-tool"><i></i> <span>我的标记</span></li>
                <li class="CoorPosition-tool"><i></i> <span>坐标定位</span></li>
                <li class="MapPrinting-tool"><i></i> <span>地图打印</span></li>
                <li class="MapPrinting-tool"><i></i> <span>场景快照</span></li>
                <!-- <li class="superposition-tool"><i></i> <span>叠加分析</span></li>
                <li class="buffer-tool"><i></i> <span>缓冲分析</span></li> -->
            </ul>
widgets/legends/css/style.css
@@ -5,7 +5,7 @@
  line-height: 32px;
  width: 300px !important;
  right: 60px !important;
  bottom: 5px !important;
  bottom: 38px !important;
  left: auto !important;
  top: auto !important;
  /* 240px */
widgets/searchL/Widget.js
@@ -329,11 +329,11 @@
                        fillColor: Cesium.Color.fromCssColorString("rgba(57,165,253)"),
                        // backgroundColor: Cesium.Color.DEEPSKYBLUE,
                        style: Cesium.LabelStyle.FILL_AND_OUTLINE,
                        outlineWidth: 3,
                        outlineWidth: 2,
                        outlineColor: Cesium.Color.fromBytes(255, 255, 255), // 文字轮廓的颜色
                        verticalOrigin: Cesium.VerticalOrigin.CENTER,//垂直位置
                        horizontalOrigin: Cesium.HorizontalOrigin.CENTER,//水平位置
                        pixelOffset: new Cesium.Cartesian2(0, -30), // 文字位置
                        pixelOffset: new Cesium.Cartesian2(0, -40), // 文字位置
                        heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
                        // distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1, entityConfig.showheight),
                        disableDepthTestDistance: Number.POSITIVE_INFINITY