| | |
| | | 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("/") |
| | | let newUrl=urlArr.splice(4).join("/") |
| | | $("#" + popId).children(".bx-popup-content-ctn").children(".bx-popup-content").children(".image")[0].src = val; |
| | | 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 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", |
| | |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 10000000000000.0) |
| | | }, |
| | | billboard: { |
| | | image: "../assets/images/icon/icon1.png", |
| | | image: iconPath, |
| | | width: 40, |
| | | height: 40, |
| | | rotation: 0, |
| | |
| | | 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", |
| | |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 10000000000000.0) |
| | | }, |
| | | billboard: { |
| | | image: "../assets/images/icon/icon1.png", |
| | | image: iconPath, |
| | | width: 40, |
| | | height: 40, |
| | | rotation: 0, |