| | |
| | | var userId; |
| | | var userName; |
| | | |
| | | var layerMap=new Map();//存储id和图层的index索引结构 |
| | | |
| | | var entityMouseClickListenerIsEnable = true; |
| | | |
| | | var previousTime;//地球旋转的参数 |
| | |
| | | maxmin: false, |
| | | scrollbar: false, |
| | | shadeClose: true, |
| | | area: ['310px', '450px'], |
| | | area: ['320px', '480px'], |
| | | resize: false, |
| | | offset: ['50px',document.body.clientWidth-320], |
| | | offset: ['50px',document.body.clientWidth-330], |
| | | content: 'project/editLabel.html', |
| | | success: function (layero, index) { |
| | | var iframe = window['layui-layer-iframe' + index]; |
| | |
| | | maxmin: false, |
| | | scrollbar: false, |
| | | shadeClose: true, |
| | | area: ['310px', '300px'], |
| | | area: ['320px', '335px'], |
| | | resize: false, |
| | | offset: ['50px',document.body.clientWidth-320], |
| | | offset: ['50px',document.body.clientWidth-330], |
| | | content: 'project/editPoint.html', |
| | | success: function (layero, index) { |
| | | var iframe = window['layui-layer-iframe' + index]; |
| | |
| | | maxmin: false, |
| | | scrollbar: false, |
| | | shadeClose: true, |
| | | area: ['310px', '300px'], |
| | | area: ['320px', '300px'], |
| | | resize: false, |
| | | offset: ['50px',document.body.clientWidth-320], |
| | | offset: ['50px',document.body.clientWidth-330], |
| | | content: 'project/editLine.html', |
| | | success: function (layero, index) { |
| | | var iframe = window['layui-layer-iframe' + index]; |
| | |
| | | maxmin: false, |
| | | scrollbar: false, |
| | | shadeClose: true, |
| | | area: ['310px', '300px'], |
| | | area: ['320px', '300px'], |
| | | resize: false, |
| | | offset: ['50px',document.body.clientWidth-320], |
| | | offset: ['50px',document.body.clientWidth-330], |
| | | content: 'project/editPolygon.html', |
| | | success: function (layero, index) { |
| | | var iframe = window['layui-layer-iframe' + index]; |
| | |
| | | function updateLabel(type,id,val){//修改文字:zzf |
| | | let signPointEntity = viewer.entities.getById(id) |
| | | let popId="pop_"+id; |
| | | let saveData; |
| | | if(type==1){//标签文字 |
| | | signPointEntity.title=val; |
| | | signPointEntity._label._text._value = val; |
| | |
| | | else if(type==5){//文本内容 |
| | | $("#pop_" +signPointEntity.id).children(".bx-popup-content-ctn").children(".bx-popup-content").children(".textarea")[0].innerHTML=val; |
| | | } |
| | | else if(type==6){ |
| | | let urlArr = val.split("/"); |
| | | let newUrl=urlArr.splice(4).join("/") |
| | | signPointEntity._billboard._image._value=parent.httpConfig.nginxUrl+newUrl; |
| | | saveData= { |
| | | "id":signPointEntity._id, |
| | | "type": "label", |
| | | "content":signPointEntity.title, |
| | | "iconPath":newUrl, |
| | | } |
| | | } |
| | | let popContent=$("#pop_" +signPointEntity.id).children(".bx-popup-content-ctn").children(".bx-popup-content").children(".textarea")[0].innerHTML; |
| | | let saveData= { |
| | | "id":signPointEntity._id, |
| | | "type": "label", |
| | | "content":signPointEntity.title, |
| | | "color":signPointEntity._label._fillColor._value.toCssColorString(), |
| | | "fontsize":signPointEntity._label._font._value.split(" ")[0].replace("px",""), |
| | | "fontstyle":signPointEntity._label._font._value.split(" ")[1], |
| | | "popContent":popContent |
| | | if(type==1||type==2||type==3||type==4||type==5){ |
| | | saveData= { |
| | | "id":signPointEntity._id, |
| | | "type": "label", |
| | | "content":signPointEntity.title, |
| | | "color":signPointEntity._label._fillColor._value.toCssColorString(), |
| | | "fontsize":signPointEntity._label._font._value.split(" ")[0].replace("px",""), |
| | | "fontstyle":signPointEntity._label._font._value.split(" ")[1], |
| | | "popContent":popContent |
| | | } |
| | | } |
| | | let token = window.localStorage.getItem("token"); |
| | | $.ajax({ |
| | |
| | | } |
| | | else if(type==5){ |
| | | let urlArr = val.split("/"); |
| | | let newUrl=urlArr.splice(3).join("/") |
| | | $("#" + popId).children(".bx-popup-content-ctn").children(".bx-popup-content").children(".image")[0].src = val; |
| | | let newUrl=urlArr.splice(4).join("/") |
| | | $("#" + popId).children(".bx-popup-content-ctn").children(".bx-popup-content").children(".image")[0].src = parent.httpConfig.nginxUrl+newUrl; |
| | | saveData= { |
| | | "id":signPointEntity._id, |
| | | "type": "point", |
| | | "content":signPointEntity.title, |
| | | "imagePath":newUrl, |
| | | } |
| | | } |
| | | else if(type==6){ |
| | | let urlArr = val.split("/"); |
| | | let newUrl=urlArr.splice(4).join("/") |
| | | signPointEntity._billboard._image._value=parent.httpConfig.nginxUrl+newUrl; |
| | | saveData= { |
| | | "id":signPointEntity._id, |
| | | "type": "point", |
| | | "content":signPointEntity.title, |
| | | "iconPath":newUrl, |
| | | } |
| | | } |
| | | if(type==1||type==2||type==3||type==4){ |
| | |
| | | } |
| | | |
| | | function initDrawEntity(){//zzf:初始化图形 |
| | | |
| | | let token = window.localStorage.getItem("token"); |
| | | $.ajax({ |
| | | type: "get", |
| | |
| | | function drawAjaxPoint(drawEntity){//加载点 |
| | | let cartesian = Cesium.Cartesian3.fromDegrees(drawEntity.longitude, drawEntity.latitude, drawEntity.height); |
| | | var cartographic = Cesium.Cartographic.fromCartesian(cartesian); |
| | | let iconPath=drawEntity.iconPath?parent.httpConfig.nginxUrl+drawEntity.iconPath:"../assets/images/icon/icon1.png"; |
| | | var entity=viewer.entities.add({ |
| | | id:drawEntity.id, |
| | | name:"drawPointEntity", |
| | |
| | | horizontalOrigin: Cesium.HorizontalOrigin.CENTER, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 10000000000000.0) |
| | | distanceDisplayCondition: window.localStorage.getItem("visualDistance")?new Cesium.DistanceDisplayCondition(0, window.localStorage.getItem("visualDistance")):new Cesium.DistanceDisplayCondition(0, 100000.0) |
| | | }, |
| | | billboard: { |
| | | image: "../assets/images/icon/icon1.png", |
| | | image: iconPath, |
| | | width: 40, |
| | | height: 40, |
| | | rotation: 0, |
| | |
| | | horizontalOrigin: Cesium.HorizontalOrigin.CENTER, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 10000000000000.0) |
| | | distanceDisplayCondition: window.localStorage.getItem("visualDistance")?new Cesium.DistanceDisplayCondition(0, window.localStorage.getItem("visualDistance")):new Cesium.DistanceDisplayCondition(0, 100000.0) |
| | | } |
| | | }); |
| | | if(drawEntity.content!=null&&drawEntity.content!=""){ |
| | |
| | | content:drawEntity.popContent?drawEntity.popContent:null, |
| | | }) |
| | | if( drawEntity.imagePath!=null&& drawEntity.imagePath!=""){ |
| | | $("#pop_" + entity.id).children(".bx-popup-content-ctn").children(".bx-popup-content").children(".image")[0].src = parent.httpConfig.webApiUrl+drawEntity.imagePath; |
| | | $("#pop_" + entity.id).children(".bx-popup-content-ctn").children(".bx-popup-content").children(".image")[0].src = parent.httpConfig.nginxUrl+drawEntity.imagePath; |
| | | } |
| | | document.getElementById("pop_" +entity.id).style.display="none"; |
| | | addTreeNode({ |
| | |
| | | clampToGround: true, |
| | | width: drawEntity.fontsize?drawEntity.fontsize:1, |
| | | material: drawEntity.color?Cesium.Color.fromCssColorString(drawEntity.color):new Cesium.Color.fromBytes(255,124,0,255), |
| | | positions:measureLinePositonsArray |
| | | positions:measureLinePositonsArray, |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 10000000.0) |
| | | }, |
| | | drawpointArr: drawpointArr, |
| | | measureLinePositonsArray: measureLinePositonsArray |
| | |
| | | outlineColor: Cesium.Color.WHITE, |
| | | hierarchy: new Cesium.CallbackProperty(function () { |
| | | return polygon; |
| | | }, false) |
| | | }, false), |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 10000000.0) |
| | | } |
| | | }); |
| | | if(drawEntity.content!=null&&drawEntity.content!=""){ |
| | |
| | | function drawAjaxLabel(drawEntity){//加载文字 |
| | | let cartesian = Cesium.Cartesian3.fromDegrees(drawEntity.longitude, drawEntity.latitude, drawEntity.height); |
| | | var cartographic = Cesium.Cartographic.fromCartesian(cartesian); |
| | | let iconPath=drawEntity.iconPath?parent.httpConfig.nginxUrl+drawEntity.iconPath:"../assets/images/icon/icon1.png"; |
| | | var entity=viewer.entities.add({ |
| | | id:drawEntity.id, |
| | | name:"drawLabelEntity", |
| | |
| | | horizontalOrigin: Cesium.HorizontalOrigin.CENTER, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 10000000000000.0) |
| | | distanceDisplayCondition: window.localStorage.getItem("visualDistance")?new Cesium.DistanceDisplayCondition(0, window.localStorage.getItem("visualDistance")):new Cesium.DistanceDisplayCondition(0, 100000.0) |
| | | }, |
| | | billboard: { |
| | | image: "../assets/images/icon/icon1.png", |
| | | image: iconPath, |
| | | width: 40, |
| | | height: 40, |
| | | rotation: 0, |
| | |
| | | horizontalOrigin: Cesium.HorizontalOrigin.CENTER, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 10000000000000.0) |
| | | distanceDisplayCondition: window.localStorage.getItem("visualDistance")?new Cesium.DistanceDisplayCondition(0, window.localStorage.getItem("visualDistance")):new Cesium.DistanceDisplayCondition(0, 100000.0) |
| | | } |
| | | }); |
| | | if(drawEntity.content!=null&&drawEntity.content!=""){ |