From 20f5203f80444254892012e87e1672f2bc6001db Mon Sep 17 00:00:00 2001
From: ansel0926 <ansel0926@gmail.com>
Date: 星期二, 17 五月 2022 13:59:58 +0800
Subject: [PATCH] Merge branch 'master' of ssh://117.78.1.188:29418/DDE-WEB
---
assets/map/map3D.js | 86 +++++++++++++++++++++++++++++--------------
1 files changed, 58 insertions(+), 28 deletions(-)
diff --git a/assets/map/map3D.js b/assets/map/map3D.js
index c606dd2..2113bfa 100644
--- a/assets/map/map3D.js
+++ b/assets/map/map3D.js
@@ -9,6 +9,8 @@
var userId;
var userName;
+var layerMap=new Map();//瀛樺偍id鍜屽浘灞傜殑index绱㈠紩缁撴瀯
+
var entityMouseClickListenerIsEnable = true;
var previousTime;//鍦扮悆鏃嬭浆鐨勫弬鏁�
@@ -224,9 +226,9 @@
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];
@@ -254,9 +256,9 @@
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];
@@ -282,9 +284,9 @@
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];
@@ -309,9 +311,9 @@
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];
@@ -837,6 +839,7 @@
function updateLabel(type,id,val){//淇敼鏂囧瓧锛歾zf
let signPointEntity = viewer.entities.getById(id)
let popId="pop_"+id;
+ let saveData;
if(type==1){//鏍囩鏂囧瓧
signPointEntity.title=val;
signPointEntity._label._text._value = val;
@@ -861,15 +864,28 @@
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({
@@ -917,13 +933,24 @@
}
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){
@@ -1383,7 +1410,6 @@
}
function initDrawEntity(){//zzf:鍒濆鍖栧浘褰�
-
let token = window.localStorage.getItem("token");
$.ajax({
type: "get",
@@ -1420,6 +1446,7 @@
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",
@@ -1435,10 +1462,10 @@
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,
@@ -1446,7 +1473,7 @@
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!=""){
@@ -1464,7 +1491,7 @@
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({
@@ -1499,7 +1526,8 @@
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
@@ -1549,7 +1577,8 @@
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!=""){
@@ -1575,6 +1604,7 @@
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",
@@ -1590,10 +1620,10 @@
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,
@@ -1601,7 +1631,7 @@
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!=""){
--
Gitblit v1.9.1