| | |
| | | maxmin: false, |
| | | scrollbar: false, |
| | | shadeClose: true, |
| | | area: ['310px', '450px'], |
| | | area: ['310px', '480px'], |
| | | resize: false, |
| | | offset: ['50px',document.body.clientWidth-320], |
| | | content: 'project/editLabel.html', |
| | |
| | | maxmin: false, |
| | | scrollbar: false, |
| | | shadeClose: true, |
| | | area: ['310px', '300px'], |
| | | area: ['300px', '330px'], |
| | | resize: false, |
| | | offset: ['50px',document.body.clientWidth-320], |
| | | content: 'project/editPoint.html', |
| | |
| | | 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, |
| | |
| | | height: 140px; |
| | | margin-left: 25px; |
| | | margin-right: 50px; |
| | | margin-top: 5px; |
| | | margin-top: 20px; |
| | | font-size: 16px; |
| | | text-indent: 8px; |
| | | outline: 0; |
| | |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <span class="text2" >内容</span> |
| | | <span class="text2">图标</span> |
| | | <button type="button" class="layui-btn layui-bg-black" style="width:150px;height:30px;margin-top:15px;margin-left: 30px;line-height: 30px;float: left;" id="uploadIcon"> |
| | | <i class="layui-icon"></i>上传图标 |
| | | </button> |
| | | </div> |
| | | <br/> |
| | | <div> |
| | | <!-- <span class="text2" >内容</span> --> |
| | | <textarea id="textarea" class="textarea" placeholder="输入内容" autocomplete="off" oninput="contentChange(event)" onporpertychange="contentChange(event)"></textarea> |
| | | </div> |
| | | |
| | |
| | | var currentLabelId |
| | | function child(id,text,fontColor,fontSize,fontfamily,content) { |
| | | currentLabelId=id |
| | | layui.use(['element', 'layer', 'form','colorpicker'], function () { |
| | | layui.use(['element', 'layer', 'form','colorpicker','upload'], function () { |
| | | var element = layui.element; |
| | | var form = layui.form; |
| | | var colorpicker = layui.colorpicker; |
| | | var upload=layui.upload; |
| | | $("#input").val(text) |
| | | let textarea=document.getElementById("textarea") |
| | | textarea.innerHTML=content; |
| | |
| | | form.on("select(fontfamily)", function (data) { |
| | | parent.updateLabel(4,currentLabelId,data.value); |
| | | }) |
| | | upload.render({ |
| | | elem: '#uploadIcon', //绑定元素 |
| | | accept: 'images', |
| | | url: parent.httpConfig.webApiUrl + "landstamp/front/upload", |
| | | done: function (res) { |
| | | if (res.code == 0) { |
| | | let popId="pop_"+id; |
| | | parent.updateLabel(6,currentLabelId, res.url); |
| | | } |
| | | layui.use('layer', function () { |
| | | var layer = layui.layer; |
| | | layer.msg(res.msg, { time: 1000 }); |
| | | }); |
| | | } |
| | | }); |
| | | form.render(); |
| | | }); |
| | | } |
| | |
| | | float:left; |
| | | color:white; |
| | | font-size:14px; |
| | | margin-left: 30px; |
| | | margin-left: 35px; |
| | | margin-top: 20px; |
| | | } |
| | | .labelInput { |
| | | width: 150px; |
| | | height: 30px; |
| | | margin-left: 30px; |
| | | margin-right: 50px; |
| | | line-height: 40px; |
| | | font-size: 16px; |
| | | text-indent: 8px; |
| | |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <span class="text2">图标</span> |
| | | <button type="button" class="layui-btn layui-bg-black" style="width:150px;height:30px;margin-top:15px;margin-left: 30px;line-height: 30px;float: left;" id="uploadIcon"> |
| | | <i class="layui-icon"></i>上传图标 |
| | | </button> |
| | | </div> |
| | | <div> |
| | | <br/> |
| | | <span class="text2">图片</span> |
| | | <button type="button" class="layui-btn layui-bg-black" style="width:150px;height:30px;margin-top:15px;margin-left: 30px;line-height: 30px;float: left;" id="uploadImg"> |
| | | <i class="layui-icon"></i>上传图片 |
| | |
| | | parent.updatePoint(4,currentPointId,data.value); |
| | | }) |
| | | upload.render({ |
| | | elem: '#uploadIcon', //绑定元素 |
| | | accept: 'images', |
| | | url: parent.httpConfig.webApiUrl + "landstamp/front/upload", |
| | | done: function (res) { |
| | | if (res.code == 0) { |
| | | let popId="pop_"+id; |
| | | parent.updatePoint(6,currentPointId, res.url); |
| | | } |
| | | layui.use('layer', function () { |
| | | var layer = layui.layer; |
| | | layer.msg(res.msg, { time: 1000 }); |
| | | }); |
| | | } |
| | | }); |
| | | upload.render({ |
| | | elem: '#uploadImg', //绑定元素 |
| | | accept: 'images', |
| | | url: parent.httpConfig.webApiUrl + "landstamp/front/upload", |