e8d9f2bb15b9e2a0aedafa2e7d56e741b2296f8a..b5919ce577d2106eb8294e74160cda5c61feb4a8
2022-05-17 ansel0926
Merge branch 'master' of ssh://117.78.1.188:29418/DDE-WEB
b5919c 对比 | 目录
2022-05-17 ansel0926
更换字体图片
00b733 对比 | 目录
6个文件已修改
147 ■■■■■ 已修改文件
assets/images/icon/icon1.png 补丁 | 查看 | 原始文档 | blame | 历史
assets/map/map3D.js 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
assets/service/drawService.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libs/Cesiumplus/CesiumDraw.js 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
view/project/drawPlot.html 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
view/project/editLine.html 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
assets/images/icon/icon1.png

assets/map/map3D.js
@@ -294,7 +294,8 @@
                                let title=entity.title;
                                let lineColor=entity._polyline._material._color._value.toCssHexString();
                                let lineSize=entity._polyline._width._value;
                                iframe.child(id,title,lineColor,lineSize,pick);
                                let attributes = pick.primitive.getGeometryInstanceAttributes(pick.id);
                                iframe.child(id,title,lineColor,lineSize,attributes);
                            }
                        });
                    }
@@ -982,8 +983,7 @@
    });
}    
function updateLine(type,id,val,pick){//修改线:zzf
    let attributes = pick.primitive.getGeometryInstanceAttributes( pick.id );
function updateLine(type,id,val,attributes){//修改线:zzf
    let signPointEntity = viewer.entities.getById(id);
    let saveData;
    if(type==1){//线名称
@@ -1434,6 +1434,9 @@
                    else if(data.rows[i].type=="label"){
                        drawAjaxLabel(data.rows[i])
                    }
                    else if(data.rows[i].type=="text"){
                        drawAjaxText(data.rows[i])
                    }
                }
            }
        },
@@ -1454,10 +1457,11 @@
        label: {
            text: drawEntity.content,
            font: drawEntity.fontsize+'px '+drawEntity.fontstyle,
            fillColor: Cesium.Color.fromCssColorString(drawEntity.color),
            fillColor: drawEntity.color?Cesium.Color.fromCssColorString(drawEntity.color):Cesium.Color.WHITE,
            outlineColor: Cesium.Color.BLACK,
            outlineWidth: 2,
            style: Cesium.LabelStyle.FILL_AND_OUTLINE,
            eyeOffset:new Cesium.Cartesian3(0,20,0),
            verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
            horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
            disableDepthTestDistance: Number.POSITIVE_INFINITY,
@@ -1612,10 +1616,12 @@
        label: {
            text: drawEntity.content,
            font: drawEntity.fontsize+'px '+drawEntity.fontstyle,
            fillColor: Cesium.Color.fromCssColorString(drawEntity.color),
            fillColor:  drawEntity.color?Cesium.Color.fromCssColorString(drawEntity.color):Cesium.Color.WHITE,
            outlineColor: Cesium.Color.BLACK,
            outlineWidth: 2,
            style: Cesium.LabelStyle.FILL_AND_OUTLINE,
            //pixelOffset: new Cesium.Cartesian2(0.0, 5.0),
            eyeOffset:new Cesium.Cartesian3(0,20,0),
            verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
            horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
            disableDepthTestDistance: Number.POSITIVE_INFINITY,
@@ -1664,4 +1670,53 @@
            "lat": Cesium.Math.toDegrees(cartographic.latitude)
        }
    }, "4");
}
function drawAjaxText(drawEntity){//加载标签
    let cartesian = Cesium.Cartesian3.fromDegrees(drawEntity.longitude, drawEntity.latitude, drawEntity.height);
    var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
    var entity=viewer.entities.add({
        id:drawEntity.id,
        name:"drawTextEtity",
        position:cartesian,
        label: {
            text: drawEntity.content?drawEntity.content:new Date(drawEntity.createTime).format("yyyyMMddhhmmss"),
            font: drawEntity.fontsize+'px '+drawEntity.fontstyle,
            fillColor:  drawEntity.color?Cesium.Color.fromCssColorString(drawEntity.color):Cesium.Color.WHITE,
            outlineColor: Cesium.Color.BLACK,
            outlineWidth: 2,
            style: Cesium.LabelStyle.FILL_AND_OUTLINE,
            //pixelOffset: new Cesium.Cartesian2(0.0, 5.0),
            eyeOffset:new Cesium.Cartesian3(0,20,0),
            verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
            horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
            disableDepthTestDistance: Number.POSITIVE_INFINITY,
            heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
            distanceDisplayCondition: window.localStorage.getItem("visualDistance")?new Cesium.DistanceDisplayCondition(0, window.localStorage.getItem("visualDistance")):new Cesium.DistanceDisplayCondition(0, 100000.0)
        },
    });
    let popup = new Popup({
        viewer:viewer,
        geometry:cartesian,
        entity:entity,
        id: "pop_" + entity.id,
        type:'label',
        content:drawEntity.popContent?drawEntity.popContent:null,
    })
    if( drawEntity.popContent!=null&& drawEntity.popContent!=""){
        $("#pop_" + entity.id).children(".bx-popup-content-ctn").children(".bx-popup-content").children(".textarea")[0].innerHTML = drawEntity.popContent;
    }
    document.getElementById("pop_" +entity.id).style.display="none";
    addTreeNode({
        "title": entity.title,
        "id": entity.id,
        "field": "Entity",
        "checked": true,
        "spread": true,
        "children": [],
        "ext": {
            "lng": Cesium.Math.toDegrees(cartographic.longitude),
            "lat": Cesium.Math.toDegrees(cartographic.latitude)
        }
    }, "4");
}
assets/service/drawService.js
@@ -44,6 +44,21 @@
    CesiumDraw.drawLabel(options);
}
function drawText(text) {
    var options = {
        'viewer': viewer,
        'label': {
            'text': text,
            'font': '30px SimSun',
            'fillColor': Cesium.Color.RED,
            'outlineColor': Cesium.Color.BLACK,
            'outlineWidth': 2,
            'style': Cesium.LabelStyle.FILL_AND_OUTLINE,
            'scaleByDistance': new Cesium.NearFarScalar(100, 1.0, 200, 0.4)
        },
    }
    CesiumDraw.drawText(options);
}
function clearDraw() {
    var options = {
        'viewer': viewer, //全局Cesium对象
libs/Cesiumplus/CesiumDraw.js
@@ -475,6 +475,7 @@
                //获取鼠标点击处的坐标
                drawHandler = drawHandler && drawHandler.destroy();
                let position = viewer.scene.camera.pickEllipsoid(movement.position, viewer.scene.globe.ellipsoid);
                position = viewer.scene.pickPosition(movement.position);
                let pointText="点" + new Date().format("yyyyMMddhhmmss");
                var entity=viewer.entities.add({
                    name:"drawPointEntity",
@@ -486,6 +487,7 @@
                        font: '10px SimSun',
                        fillColor: Cesium.Color.WHITE,
                        text: pointText,
                        eyeOffset:new Cesium.Cartesian3(0,20,0),
                        disableDepthTestDistance: Number.POSITIVE_INFINITY,
                        heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
                        distanceDisplayCondition: window.localStorage.getItem("visualDistance")?new Cesium.DistanceDisplayCondition(0, window.localStorage.getItem("visualDistance")):new Cesium.DistanceDisplayCondition(0, 100000.0)
@@ -535,6 +537,7 @@
                //获取鼠标点击处的坐标
                drawHandler = drawHandler && drawHandler.destroy();
                let position = viewer.scene.camera.pickEllipsoid(movement.position, viewer.scene.globe.ellipsoid);
                position = viewer.scene.pickPosition(movement.position);
                let labelText="文字" + new Date().format("yyyyMMddhhmmss");
                var entity=viewer.entities.add({
                    name:"drawLabelEntity",
@@ -546,6 +549,7 @@
                        font: '30px SimSun',
                        fillColor: Cesium.Color.WHITE,
                        text: labelText,
                        eyeOffset:new Cesium.Cartesian3(0,20,0),
                        disableDepthTestDistance: Number.POSITIVE_INFINITY,
                        heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
                        distanceDisplayCondition: window.localStorage.getItem("visualDistance")?new Cesium.DistanceDisplayCondition(0, window.localStorage.getItem("visualDistance")):new Cesium.DistanceDisplayCondition(0, 100000.0)
@@ -588,6 +592,47 @@
            }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
        }
        CesiumDraw.drawText = function (options) {
            drawHandler = drawHandler && drawHandler.destroy();
            drawHandler = new Cesium.ScreenSpaceEventHandler(options.viewer.scene.canvas);
            drawHandler.setInputAction(function (movement) {
                let position = viewer.scene.pickPosition(movement.position);
                let labelText="标签" + new Date().format("yyyyMMddhhmmss");
                var entity=viewer.entities.add({
                    name:"drawTextEtity",
                    position:position,
                    label: {
                        show: true,
                        verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                        horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                        font: '20px LiSu',
                        fillColor: Cesium.Color.YELLOW,
                        text: labelText,
                        eyeOffset:new Cesium.Cartesian3(0,20,0),
                        disableDepthTestDistance: Number.POSITIVE_INFINITY,
                        heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
                        distanceDisplayCondition: window.localStorage.getItem("visualDistance")?new Cesium.DistanceDisplayCondition(0, window.localStorage.getItem("visualDistance")):new Cesium.DistanceDisplayCondition(0, 100000.0)
                    },
                });
                entity.title = labelText;
                var cartesian = entity._position._value
                addTreeNode({
                    "title": entity.title,
                    "id": entity.id,
                    "field": "Entity",
                    "checked": true,
                    "spread": true,
                    "children": [],
                    "ext": {
                        "lng": Cesium.Math.toDegrees(cartesian.x),
                        "lat": Cesium.Math.toDegrees(cartesian.y)
                    }
                }, "4");
                saveDrawEntity("text",entity,entity.id);
                drawHandler = drawHandler && drawHandler.destroy();
            }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
        }
        CesiumDraw.clearDraw = function (options) {
        }
view/project/drawPlot.html
@@ -70,7 +70,7 @@
                <div>
                    <img class="mapImg" src="../../assets/images/draw/点.png">
                </div>
                <div>点</div>
                <div>图片标记点</div>
            </li>
            <li class="hover" onclick="drawplot('polyline')">
                <div>
@@ -88,8 +88,14 @@
                <div>
                    <img class="mapImg" src="../../assets/images/draw/文字.png">
                </div>
                <div>文字</div>
                <div>文字标记点</div>
            </li>
            <!-- <li class="hover" onclick="drawplot('text')">
                <div>
                    <img class="mapImg" src="../../assets/images/draw/文字.png">
                </div>
                <div>标签</div>
            </li> -->
            <!-- <li>
                <input id="text" class="labelInput" type="text" placeholder="输入文字" autocomplete="off" />
            </li> -->
@@ -121,6 +127,10 @@
                    parent.drawPolygon();
                    break;
                }
                case 'text':{
                    parent.drawText();
                    break;
                }
            }
        }
    </script>
view/project/editLine.html
@@ -134,7 +134,7 @@
    </div>
    <script>
       var currentLineId
       function child(id,text,lineColor,lineSize,pick) {
       function child(id,text,lineColor,lineSize,attributes) {
           currentLineId=id
           layui.use(['element', 'layer', 'form','colorpicker'], function () {
            var element = layui.element;
@@ -146,19 +146,19 @@
                color: lineColor,
                size:'20px',
                done: function (color) {
                    parent.updateLine(2,currentLineId,color,pick);
                    parent.updateLine(2,currentLineId,color,attributes);
                },
            });
            lineSize=parseInt(lineSize);
            $("#lineSize").val(lineSize);
            form.on("select(lineSize)", function (data) {
                parent.updateLine(3,currentLineId,data.value,pick);
                parent.updateLine(3,currentLineId,data.value,attributes);
            })
            form.render();
        });
       }
       function labelChange(e) {
           parent.updateLine(1,currentLineId,$("#input").val(),pick);
           parent.updateLine(1,currentLineId,$("#input").val(),attributes);
       }
    </script>