<template>
|
<div class="container">
|
|
<div id="sdkContainer">
|
|
</div>
|
|
<div class="bottom">
|
<bottom ref="bottomSon" @LeftRightChange="changeLeftRightCompents"></bottom>
|
</div>
|
<div class="left">
|
<left ref="myleft"></left>
|
</div>
|
|
<div class="Right" v-if="Right">
|
<right ref="myright"></right>
|
</div>
|
|
<div class="top">
|
<top class="topSon"></top>
|
</div>
|
<div class="switchMenu">
|
<div class="switchMenuBtn" @click="switchMenu">
|
<div class="switchMenuBtnBack"></div>
|
<b></b><span>菜单</span>
|
</div>
|
<ul v-show="menuShow">
|
<li>
|
<div @click="showBackMap" :class="{ switchBtnActive: backImageShow }" class="switchBtn">
|
黑色底图
|
</div>
|
</li>
|
<li>
|
<div @click="ShowJKQArea" class="switchBtn" :class="{ switchBtnActive: JKQhow }">
|
经开区域
|
</div>
|
</li>
|
<li>
|
<div @click="ShowJKBMArea" class="switchBtn" :class="{ switchBtnActive: JKQBM }">
|
建筑白模
|
</div>
|
</li>
|
<li>
|
<div @click="ShowQXData" class="switchBtn" :class="{ switchBtnActive: QXShow }">
|
倾斜区域
|
</div>
|
</li>
|
|
<li>
|
<div @click="showOneFineModel" class="switchBtn" :class="{ switchBtnActive: fineModelOneShow }">
|
精模区域
|
</div>
|
</li>
|
|
<li>
|
<div @click="ShowGHYTArea" class="switchBtn" :class="{ switchBtnActive: GHShow }">
|
规划用地
|
</div>
|
</li>
|
|
<li>
|
<div @click="ShowHXArea" class="switchBtn" :class="{ switchBtnActive: HXShow }">
|
轻纺制造区
|
</div>
|
</li>
|
<li>
|
<div @click="ShowHGArea" class="switchBtn" :class="{ switchBtnActive: HGShow }">
|
化工区
|
</div>
|
</li>
|
<li>
|
<div @click="ShowYDArea" class="switchBtn" :class="{ switchBtnActive: YDShow }">
|
燕都新区
|
</div>
|
</li>
|
<li>
|
<div @click="ShowJMArea" class="switchBtn" :class="{ switchBtnActive: JMShow }">
|
企业点位
|
</div>
|
</li>
|
|
<li>
|
<div @click="ShowJCArea()" class="switchBtn" :class="{ switchBtnActive: JCShow }">
|
供地区
|
</div>
|
</li>
|
|
<li>
|
<div @click="ShowZDArea" class="switchBtn" :class="{ switchBtnActive: ZDShow }">
|
征地区
|
</div>
|
</li>
|
<li>
|
<div @click="showWhiteModel" class="switchBtn" :class="{ switchBtnActive: whiteModelShow }">
|
在建项目
|
</div>
|
</li>
|
<li>
|
<div @click="ShowBMNameArea" class="switchBtn" :class="{ switchBtnActive: BMNameShow }">
|
落地项目
|
</div>
|
</li>
|
|
<li>
|
<div @click="ShowLWLine" class="switchBtn" :class="{ switchBtnActive: LWShow }">
|
路网
|
</div>
|
</li>
|
</ul>
|
</div>
|
<div class="legend" v-show="legend">
|
<Mainlegend ref="MainLegend"></Mainlegend>
|
</div>
|
|
<!-- 弹出组件 -->
|
<div class="HGTitle" v-if="dialogVisible1">
|
<div class="td0">
|
<!-- <span>{{qyData.RefName}}</span>-->
|
<span @click="closeDialog" style="
|
position: absolute;
|
top: 60px;
|
right: 90px;
|
cursor: pointer;
|
font-size: 40px;
|
color: #ffffff;
|
">X</span>
|
</div>
|
<h3 class="height_box">
|
{{ NAME }}
|
</h3>
|
<div class="dialogHG">
|
<div class="td1">
|
<span class="span2"><span class="span3"> 法定代表人:</span><span class="span4">{{ FDDBR }}</span>
|
</span>
|
</div>
|
|
<div class="td1">
|
<span class="span2"><span class="span3"> 统一社会信用代码:</span>
|
<span class="span4">{{ TYSHXYDM }}</span></span>
|
</div>
|
|
<div class="td1">
|
<span class="span2"><span class="span3"> 企业产值:</span>
|
<span class="span4">{{ CZ }}亿元</span></span>
|
</div>
|
<div class="td1">
|
<span class="span2"><span class="span3"> 企业税收:</span>
|
<span class="span4">{{ SS }}万元</span></span>
|
</div>
|
<div class="td1">
|
<span class="span2"><span class="span3"> 企业年度用水量:</span><span class="span4">{{ NDYSL }}立方米</span>
|
</span>
|
</div>
|
<div class="td1">
|
<span class="span2"><span class="span3"> 企业年度用电量:</span>
|
<span class="span4">{{ NDYDL }}万千瓦时</span></span>
|
</div>
|
<div class="td1">
|
<span class="span2"><span class="span3"> 企业地址:</span>
|
<span class="span4" style="padding-left: 10px">{{ DZ }}</span></span>
|
</div>
|
<div class="td1" style="height:125px">
|
<span class="span2"><span class="span3" style="width:50%"> 企业简介:</span>
|
<span class="span4">{{ JJ }}</span></span>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import HttpUrl from "../../config/http.js";
|
import { axios_get, axios_post } from "../../until/request.js";
|
import top from "../Top/index.vue"; //顶部组件
|
import bottom from "../Bottom/index.vue"; //底部组件
|
import left from "../Left/index.vue"; //主页左侧文件
|
import right from "../Right/index.vue"; //主页左侧文件
|
|
// import waterRight from "../Right/indexWater.vue"
|
|
import tool from "../Tool/tool.vue";
|
import Mainlegend from "../Tool/legend.vue";
|
|
import axios from "axios";
|
import mapAPI from "../../API/mapAPI.js";
|
import { GISERVEER } from "../../config/http.js";
|
|
export default {
|
name: "viewer",
|
components: {
|
top,
|
bottom,
|
left,
|
right,
|
tool,
|
Mainlegend,
|
// waterRight
|
},
|
data() {
|
return {
|
lon: 120.553,
|
|
lat: 41.6423,
|
pitch: -20,
|
heading: 190,
|
roll: 0,
|
height: 260,
|
TYSHXYDM: "",
|
JJ: "",
|
DZ: "",
|
NDYDL: "",
|
NDYSL: "",
|
SS: "",
|
CZ: "",
|
FDDBR: "",
|
NAME: "",
|
JKQBM: false,
|
JKQhow: false,
|
dialogVisible1: false,
|
Right: true,
|
WaterRight: false,
|
ModelList: [],
|
fineModelOneShow: false,
|
fineModelTwoShow: false,
|
whiteModelShow: false,
|
tileModelTwoShow: false,
|
|
menuShow: false,
|
backImageShow: true,
|
simpleModelShow: false,
|
tiltLowModelShow: false,
|
tiltHighModelShow: false,
|
flyLine: null,
|
circleLight: null,
|
scanLight: null,
|
blurStage: null,
|
cyghtShow: false,
|
sctShow: false,
|
wytShow: false,
|
legend: false,
|
|
QXShow: false, //倾斜展示
|
HGShow: false, //化工展示
|
BMNameShow: false, //化工展示
|
YDShow: false, //燕都新区展示
|
JMShow: false, //企业地名
|
LDShow: false, //企业地名
|
JCShow: false, //建成区
|
ESShow: false, //二集三化图
|
HXShow: false, //轻纺制造区
|
GHShow: true, //规划展示
|
ZJShow: true, //铁路注记
|
GSShow: true, //高速注记
|
JSShow: false, //给水展示
|
RQShow: false, //燃气展示
|
ZQShow: false, //蒸汽展示
|
ZSShow: false, //中水展示
|
WSShow: false, //污水展示
|
QYShow: false, //企业展示
|
LWShow: false, //路网数据
|
ZDShow: false, //征地数据
|
BMShow: false, //白模数据
|
JDMYShow: false, //
|
WaterShow: false, //"水渠"
|
BaseEqumentShow: false, //基础设施
|
waterClockShow: false,
|
QXJCDShow: false, //气象监测点
|
QXJCKShow: false,//气象监测点扩散
|
QYRLShow: false,
|
QYZZShow: false,
|
handler: null,
|
CF: "",
|
DW: "",
|
FZR: "",
|
GH: "",
|
Id: "",
|
MJ: "",
|
XH: "",
|
QYFBShow: false,
|
pathNum: "",
|
vChange: "0"
|
};
|
},
|
mounted() {
|
this.$nextTick(function () {
|
//场景
|
window.sceneObj = {
|
backImage: null,
|
effects: [],
|
simpleModel: null,
|
circleLight: null,
|
flyLine: null,
|
scanLight: null,
|
tiltLowModel: null,
|
tiltHighModel: null,
|
companyObj: [],
|
heatmapLayer: null,
|
cyghtLayer: null,
|
sctLayer: null,
|
wytLayer: null,
|
|
qxData1: null, //镂空后倾斜数据
|
qxData2: null, //单体数据
|
qxData3: null, //单体地面
|
qxData4: null, //树木植被
|
qxData5: null, //双创大厦
|
|
//wms
|
RH3Data: null,
|
RH5Data: null,
|
BlueData: null,
|
BlackData: null,
|
HGArea: null,
|
BMNameArea: null,
|
YDArea: null,
|
JMData: null,
|
LDData: null,
|
JCData: null,
|
ESData: null,
|
HXData: null,
|
GHYDData: null,
|
ZJData: null,
|
GSData: null,
|
JSData: null,
|
RQData: null,
|
ZQData: null,
|
ZSData: null,
|
WSData: null,
|
YJData: null,
|
QYData: null,
|
GHData: null,
|
ZDData: null,
|
BMData: null,
|
JDMYData: null,
|
|
//label
|
HGAreaL: null,
|
YDAreaL: null,
|
JMDataL: null,
|
BMNameAreaL: null,
|
JDMYDataL: null,
|
JCDataL: null,
|
ESDataL: null,
|
HXDataL: null,
|
GHYDDataL: null,
|
ZJDataL: null,
|
JSDataL: null,
|
RQDataL: null,
|
ZQDataL: null,
|
ZSDataL: null,
|
WSDataL: null,
|
QYDataL: null,
|
LWData: null,
|
QXJCDataL: null,//气象监测
|
QXJCKataL: [],//气象监测扩散
|
QYRLLayer: null,
|
QYZZLayer: null,
|
|
WHPQYFB: null,
|
|
waterLayer: null,
|
baseEqumentLayer: null,
|
highlight: null,
|
|
waterClock: null,
|
|
WaterLocList: [], //智慧水务的打点信息
|
|
handler: null,
|
handlerOnframe: null,
|
//label
|
HGLabel: null,
|
HXLabel: null,
|
YDLabel: null,
|
};
|
|
mapAPI.initMap();
|
|
this.showBackMap();
|
|
//经开区范围
|
this.ShowJKQArea();
|
//化工区
|
this.ShowHGArea();
|
//轻纺制造区
|
this.ShowHXArea();
|
//燕都新区
|
this.ShowYDArea();
|
// 经开区白膜
|
this.ShowJKBMArea();
|
//路网
|
this.ShowLWLine();
|
//点击事件
|
this.AddMXClick();
|
// this.getpointer();
|
// this.ShowZJArea();
|
this.InitLoction();
|
|
|
Viewer.camera.changed.addEventListener(() => {
|
if (this.vChange != "0") return
|
// 当前高度
|
let height = Viewer.camera.positionCartographic.height;
|
|
// 下面可以写其他的代码了
|
if (height < 20000) {
|
if (window.sceneObj.JKQArea != null) {
|
window.sceneObj.JKQArea.item.show = false;
|
}
|
if (window.sceneObj.HGArea != null) {
|
window.sceneObj.HGArea.item.show = false;
|
window.sceneObj.HGLabel.item.show = false;
|
}
|
if (window.sceneObj.HXData != null) {
|
window.sceneObj.HXData.item.show = false;
|
window.sceneObj.HXLabel.item.show = false;
|
}
|
if (window.sceneObj.YDArea != null) {
|
window.sceneObj.YDArea.item.show = false;
|
window.sceneObj.YDLabel.item.show = false;
|
}
|
if (window.sceneObj.GHYDData != null) {
|
window.sceneObj.GHYDData.setVisibility(true);
|
}
|
} else if (height > 20000) {
|
if (window.sceneObj.JKQArea != null) {
|
window.sceneObj.JKQArea.item.show = true;
|
}
|
if (window.sceneObj.HGArea != null) {
|
window.sceneObj.HGArea.item.show = true;
|
window.sceneObj.HGLabel.item.show = true;
|
}
|
if (window.sceneObj.HXData != null) {
|
window.sceneObj.HXData.item.show = true;
|
window.sceneObj.HXLabel.item.show = true;
|
}
|
if (window.sceneObj.YDArea != null) {
|
window.sceneObj.YDArea.item.show = true;
|
window.sceneObj.YDLabel.item.show = true;
|
}
|
if (window.sceneObj.GHYDData != null) {
|
window.sceneObj.GHYDData.setVisibility(false);
|
}
|
} else if (height < 6000) {
|
if (window.sceneObj.GHYDData != null) {
|
window.sceneObj.GHYDData.setVisibility(false);
|
}
|
}
|
});
|
});
|
this.$bus.$on("createCoverage", (state) => {
|
if (state) {
|
this.showWhiteModel();
|
this.ShowJCArea();
|
|
|
}
|
});
|
this.$bus.$on("toPopout", (res) => {
|
this.TYSHXYDM = res.properties.TYSHXYDM;
|
this.JJ = res.properties.JJ;
|
this.DZ = res.properties.DZ;
|
this.NDYDL = res.properties.NDYDL;
|
this.NDYSL = res.properties.NDYSL;
|
this.SS = res.properties.SS;
|
this.CZ = res.properties.CZ;
|
this.FDDBR = res.properties.FDDBR;
|
this.NAME = res.properties.NAME;
|
this.dialogVisible1 = true;
|
});
|
this.$bus.$on("showQYFB", (res) => {
|
this.getQYFBpoi(res);
|
});
|
this.$bus.$on("RightLeftChange", (res) => {
|
this.showGetZDCY(res);
|
});
|
// this.$bus.$on("switchover", (state) => {});
|
},
|
methods: {
|
/**
|
* js使用canvas将文字转换成图像数据base64
|
* @param {string} text 文字内容 "abc"
|
* @param {string} fontsize 文字大小 20
|
* @param {function} fontcolor 文字颜色 "#000"
|
* @param {boolean} imgBase64Data 图像数据
|
*/
|
|
textBecomeImg(text, fontsize, fontcolor) {
|
var canvas = document.createElement("canvas");
|
//小于32字加1 小于60字加2 小于80字加4 小于100字加6
|
var $buHeight = 0;
|
if (fontsize <= 32) {
|
$buHeight = 1;
|
} else if (fontsize > 32 && fontsize <= 60) {
|
$buHeight = 2;
|
} else if (fontsize > 60 && fontsize <= 80) {
|
$buHeight = 4;
|
} else if (fontsize > 80 && fontsize <= 100) {
|
$buHeight = 6;
|
} else if (fontsize > 100) {
|
$buHeight = 10;
|
}
|
//对于g j 等有时会有遮挡,这里增加一些高度
|
canvas.height = fontsize + $buHeight;
|
var context = canvas.getContext("2d");
|
// var imagedata = context.getimagedata(0, 0, canvas.width, canvas.height);
|
// for(var i = 0; i < imagedata.data.length; i += 4) {
|
// // 当该像素是透明的,则设置成白色
|
// if(imagedata.data[i + 3] == 0) {
|
// imagedata.data[i] = 16;
|
// imagedata.data[i + 1] = 107;
|
// imagedata.data[i + 2] = 216;
|
// imagedata.data[i + 3] = 255;
|
// }
|
// }
|
// context.putimagedata(imagedata, 0, 0);
|
// 擦除(0,0)位置大小为200x200的矩形,擦除的意思是把该区域变为透明
|
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
context.fillStyle = fontcolor;
|
context.font = fontsize + "px Arial";
|
//top(顶部对齐) hanging(悬挂) middle(中间对齐) bottom(底部对齐) alphabetic是默认值
|
context.textBaseline = "middle";
|
context.fillText(text, 0, fontsize / 2);
|
|
//方案三:改变大小后,重新设置一次文字
|
canvas.width = context.measureText(text).width;
|
context.fillStyle = fontcolor;
|
context.font = fontsize + "px Arial";
|
context.textBaseline = "middle";
|
context.fillText(text, 0, fontsize / 2);
|
|
var dataUrl = canvas.toDataURL("image/png"); //注意这里背景透明的话,需要使用png
|
|
return dataUrl;
|
},
|
|
// 企业分布点位
|
getQYFBpoi(res) {
|
axios_post("/safe/corpGeoJson").then((response) => {
|
console.log(this.QYFBShow);
|
this.QYFBShow = !this.QYFBShow;
|
if (this.QYFBShow) {
|
if (window.sceneObj.WHPQYFB != null) {
|
sgworld.Viewer.entities.removeAll();
|
window.sceneObj.WHPQYFB = null;
|
} else {
|
// var data = {
|
// font_family: "微软雅黑",
|
// font_size: 25,
|
// fillColor: "rgba(255,255,255,1)",
|
// horizontalOrigin: 0,
|
// verticalOrigin: -1,
|
// layertype: "labellayer",
|
// near: 0,
|
// // far: 90000,
|
// pointHeight: 500,
|
// showBackground: true,
|
// backgroundColor: "rgba(16,107,216,1)",
|
// //backgroundPadding:15,
|
// text: "[corpName]",
|
// };
|
// console.log(response.data)
|
// window.sceneObj.WHPQYFB =
|
// sgworld.Creator.createLabelPointGeoJsonFeatureLayer(
|
// "",
|
// response.data,
|
// data,
|
// "0",
|
// true,
|
// function (data) {
|
// sgworld.Navigate.flyToObj(data);
|
// }
|
// );
|
//=======================
|
|
var arr = [];
|
|
response.data.features.forEach((e) => {
|
// var position = {
|
// X: e.geometry.coordinates[0],
|
// Y: e.geometry.coordinates[1],
|
// Altitude: 220,
|
// };
|
// var imageLabel = sgworld.Creator.CreateImageLabel(
|
// position,
|
|
// this.textBecomeImg1(e.properties.corpName),
|
// {},
|
// 0,
|
// "标签点"
|
// );
|
// var id = imageLabel.item.id;
|
// var entity = sgworld.Creator.getEntityById(id);
|
var entity = sgworld.Viewer.entities.add({
|
position: Cesium.Cartesian3.fromDegrees(
|
e.geometry.coordinates[0],
|
e.geometry.coordinates[1],
|
220
|
),
|
|
properties: e.properties,
|
billboard: {
|
image: this.textBecomeImg(
|
e.properties.corpName,
|
"30",
|
"#fff"
|
),
|
scale: 0.8,
|
},
|
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
|
0,
|
1000
|
), //点的显隐距离
|
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
// point: {
|
// color: Cesium.Color.RED, //点位颜色
|
// pixelSize: 10, //像素点大小
|
// },
|
// label: {
|
// // text: e.properties.corpName,
|
|
// // font: "25px Source Han Sans CN", //字体样式
|
// // fillColor: new Cesium.Color.fromCssColorString(
|
// // "rgba(255,255,255,1)"
|
// // ), //字体颜色
|
// backgroundColor: new Cesium.Color.fromCssColorString(
|
// "rgba(16,107,216,1)"
|
// ), //背景颜色
|
// showBackground: true, //是否显示背景颜色
|
// style: Cesium.LabelStyle.FILL, //label样式
|
// outlineWidth: 2,
|
// verticalOrigin: Cesium.VerticalOrigin.CENTER, //垂直位置
|
// horizontalOrigin: Cesium.HorizontalOrigin.LEFT, //水平位置
|
// // pixelOffset: new Cesium.Cartesian2(10, 0), //偏移
|
// },
|
});
|
arr.push(entity);
|
if (e.properties.corpName == "朝阳金泰科技有限责任公司") {
|
// sgworld.Viewer.zoomTo(entity);
|
// sgworld.Navigate.flyToObj(entity);
|
// sgworld.Navigate.flyToPosition(
|
// e.geometry.coordinates[0],
|
// e.geometry.coordinates[1],
|
// 600
|
// );
|
Viewer.camera.setView({ //跳转视角
|
destination: new Cesium.Cartesian3.fromDegrees(
|
e.geometry.coordinates[0],
|
e.geometry.coordinates[1],
|
600
|
),
|
orientation: {
|
heading: Cesium.Math.toRadians(8.0),
|
pitch: Cesium.Math.toRadians(-90.0),
|
roll: 0.0
|
}
|
|
})
|
}
|
// sgworld.Viewer.zoomTo(entity);
|
});
|
window.sceneObj.WHPQYFB = arr;
|
}
|
} else {
|
sgworld.Viewer.entities.removeAll();
|
window.sceneObj.WHPQYFB = null;
|
}
|
});
|
},
|
//主导产业
|
showGetZDCY(res) {
|
if (res != "8") return;
|
this.closeAll();
|
//精模
|
this.showOneFineModel();
|
//倾斜
|
this.ShowQXData();
|
},
|
//改变左右两边数据
|
changeLeftRightCompents(parm) {
|
this.vChange = parm;
|
this.pathNum = parm;
|
this.closeAll();
|
this.$refs.myright.componentDisplay(parm);
|
this.$refs.myleft.componentDisplay(parm);
|
|
switch (parm) {
|
case "0":
|
this.showBackMap();
|
this.ShowJKQArea();
|
this.ShowHGArea();
|
this.ShowHXArea();
|
this.ShowGHYTArea();
|
//燕都新区
|
this.ShowYDArea();
|
// 经开区白膜
|
this.ShowJKBMArea();
|
this.ShowLWLine();
|
this.height = 40000
|
if (window.sceneObj.GHYDData != null) {
|
window.sceneObj.GHYDData.setVisibility(false);
|
}
|
break;
|
case "1":
|
this.ShowLWLine();
|
this.showBackMap();
|
// 经开区白膜
|
this.ShowJKBMArea();
|
this.ShowJMArea();
|
break;
|
case "2":
|
//倾斜
|
this.ShowQXData();
|
//精模
|
this.showOneFineModel();
|
//分布
|
this.getQYFBpoi(true);
|
break;
|
case "3":
|
//倾斜
|
this.ShowQXData();
|
//精模
|
this.showOneFineModel();
|
Viewer.camera.setView({ //跳转视角
|
destination: new Cesium.Cartesian3.fromDegrees(
|
this.lon,
|
this.lat,
|
this.height
|
),
|
orientation: {
|
heading: Cesium.Math.toRadians(this.heading),
|
pitch: Cesium.Math.toRadians(this.pitch),
|
roll: this.roll
|
}
|
})
|
|
break;
|
case "4":
|
this.showBackMap();
|
//经开区范围
|
this.ShowJKQArea();
|
this.ShowHGArea();
|
this.ShowHXArea();
|
this.ShowYDArea();
|
this.ShowJKBMArea();
|
//气象监测点
|
this.ShowQxjcPositon();
|
this.ShowQxjcKs();
|
|
|
|
break;
|
case "5":
|
break;
|
case "6":
|
//黑色底图
|
this.showBackMap();
|
//经开区范围
|
this.ShowJKQArea();
|
this.ShowHGArea();
|
this.ShowHXArea();
|
this.ShowYDArea();
|
this.ShowJKBMArea();
|
|
break;
|
case "8":
|
//园区招商右上ians
|
alert("ohehe")
|
break
|
}
|
if (parm == "5") {
|
//给水
|
this.JSShow = false;
|
this.ShowJSLine();
|
//污水
|
this.WSShow = false;
|
this.ShowWSLine();
|
//中水
|
this.WaterShow = false;
|
this.ShowWater();
|
} else {
|
//给水
|
this.JSShow = true;
|
this.ShowJSLine();
|
//污水
|
this.WSShow = true;
|
this.ShowWSLine();
|
//中水
|
this.WaterShow = true;
|
this.ShowWater();
|
}
|
},
|
//关闭所有
|
closeAll() {
|
console.log(this.pathNum);
|
if (window.sceneObj.WHPQYFB != null && this.pathNum != "2") {
|
this.getQYFBpoi(true);
|
}
|
|
//落地项目
|
if (this.BMNameShow) {
|
this.ShowBMNameArea();
|
}
|
//在建项目
|
if (this.whiteModelShow) {
|
this.showWhiteModel();
|
}
|
//征地
|
if (this.ZDShow) {
|
this.ShowZDArea();
|
}
|
//倾斜
|
if (this.QXShow) {
|
this.ShowQXData();
|
}
|
//精模
|
if (this.fineModelOneShow) {
|
this.showOneFineModel();
|
}
|
//路网
|
if (this.LWShow) {
|
this.ShowLWLine();
|
}
|
//加载黑色地图
|
if (this.backImageShow) {
|
this.showBackMap();
|
}
|
if (this.GHShow) {
|
if (window.sceneObj.GHYDData != null) {
|
this.ShowGHYTArea();
|
}
|
}
|
// if (
|
// window.sceneObj.GHYDData !== null &&
|
// window.sceneObj.ZJData !== null &&
|
// window.sceneObj.GSData !== null
|
// ) {
|
// this.InitLoction();
|
// }
|
if (this.JKQhow) {
|
if (window.sceneObj.JKQArea !== null) {
|
//经开区范围
|
this.ShowJKQArea();
|
}
|
}
|
if (this.HXShow) {
|
if (
|
window.sceneObj.HGArea !== null &&
|
window.sceneObj.HGLabel !== null
|
) {
|
//化工区
|
this.ShowHGArea();
|
}
|
}
|
if (this.HXShow) {
|
if (
|
window.sceneObj.HXData !== null &&
|
window.sceneObj.HXLabel !== null
|
) {
|
//轻纺制造区
|
this.ShowHXArea();
|
}
|
}
|
|
if (this.YDShow) {
|
if (
|
window.sceneObj.YDArea !== null &&
|
window.sceneObj.YDLabel !== null
|
) {
|
//燕都新区
|
this.ShowYDArea();
|
}
|
}
|
if (this.JKQBM) {
|
if (window.sceneObj.JKQBMwhiteModel !== null) {
|
// 经开区白膜
|
this.ShowJKBMArea();
|
}
|
}
|
if (this.JMShow) {
|
if (window.sceneObj.JMDataL !== null) {
|
// 企业点位
|
this.ShowJMArea();
|
}
|
}
|
//环保监测
|
if (this.QXJCDShow) {
|
if (window.sceneObj.QXJCDataL != null) {
|
this.ShowQxjcPositon();
|
}
|
}
|
//气象监测扩散
|
if (this.QXJCKShow) {
|
if (window.sceneObj.QXJCKataL.length != 0) {
|
this.ShowQxjcKs();
|
}
|
}
|
|
},
|
flyToLoction() {
|
sgworld.Viewer.camera.setView({
|
// destination : Cesium.Cartesian3.fromDegrees(120.586486,41.303682 , 30000),
|
destination: Cesium.Cartesian3.fromDegrees(
|
120.504909,
|
41.632103,
|
30000
|
),
|
// orientation: {
|
// heading: Cesium.Math.toRadians(-25), // 相机方向指向当地东向
|
// pitch: Cesium.Math.toRadians(-70), // 再将相机方向转向地心,此时Up方向指向当地东向
|
// roll: 0.5
|
// }
|
});
|
},
|
|
InitLoction() {
|
// sgworld.Navigate.flyToPosition(120.586486,41.303682 , 30000);
|
// sgworld.Navigate.flyToPosition(120.504909, 41.632103, 35000);
|
// 120.504909, 41.572103, 35000;
|
var pointsInterest = {
|
destination: Cesium.Cartesian3.fromDegrees(
|
120.504909,
|
41.524103,
|
40000
|
),
|
orientation: {
|
heading: Cesium.Math.toRadians(15.0),
|
pitch: Cesium.Math.toRadians(-80.0),
|
roll: Cesium.Math.toRadians(0.0),
|
},
|
};
|
sgworld.Navigate.flyToPointsInterest(pointsInterest);
|
window.sceneObj.GHYDData = this.createWMSLayer(
|
"/gisserver/wmsserver/JKQ_GH2",
|
""
|
);
|
// window.sceneObj.ZJData = this.createWMSLayer(
|
// "/gisserver/wmsserver/JKQ_JTZJ",
|
// ""
|
// );
|
// window.sceneObj.GSData = this.createWMSLayer(
|
// "/gisserver/wfsserver/JKQ_GS",
|
// ""
|
// );
|
|
// window.sceneObj.ZJDataL = this.createWFSLayer(
|
// "http://127.0.0.1:8090/gisserver/wfsserver/JKQ_ZJ_wfs", "交通注记", "[Name]");
|
this.legend = true;
|
},
|
//经开区白膜
|
ShowJKBMArea() {
|
this.JKQBM = !this.JKQBM;
|
|
if (this.JKQBM) {
|
if (window.sceneObj.JKQBMwhiteModel != null) {
|
window.sceneObj.JKQBMwhiteModel.destroy();
|
window.sceneObj.JKQBMwhiteModel = null;
|
} else {
|
this.createWhiteModel(
|
"/gisserver/c3dserver/JKQ_BM/tileset.json",
|
"2",
|
"rgba(50, 131, 213 ,1)"
|
);
|
}
|
} else {
|
if (window.sceneObj.JKQBMwhiteModel != null) {
|
window.sceneObj.JKQBMwhiteModel.destroy();
|
window.sceneObj.JKQBMwhiteModel = null;
|
}
|
}
|
},
|
//创建wfs服务
|
createWFSLayer(url, layer, attr) {
|
// url ="http://183.162.245.49:3301/gisserver/wfsserver/point_wfs"; //HttpUrl.GISERVEER + url;
|
// layer="shenghuiming";
|
// attr='[name]';
|
// this.flyToLoction();
|
let sgwfs = new SmartEarth.WFSTool(Viewer);
|
let dx = sgwfs.CreateWfs("point", {
|
urls: url,
|
layer: layer,
|
text: attr,
|
image: SmartEarthRootUrl + "Workers/img/mark.png",
|
//offsetX: 400,
|
offsetY: -90,
|
color: "#de3",
|
scale: "2",
|
imageScale: "0.5",
|
disableDepthTestDistance: 1000,
|
// heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
});
|
return dx;
|
},
|
|
//创建WMS服务
|
createWMSLayer(url, layer) {
|
// this.flyToLoction();
|
|
url = HttpUrl.GISERVEER + url;
|
var dx = sgworld.Creator.createImageryProvider(
|
"gisserver",
|
"wms",
|
{
|
url: url,
|
layers: layer,
|
parameters: {
|
format: "image/png",
|
transparent: true,
|
},
|
},
|
"0",
|
undefined,
|
true,
|
""
|
);
|
|
return dx;
|
},
|
|
//菜单打开关闭
|
switchMenu() {
|
// this.legend = false;
|
this.menuShow = !this.menuShow;
|
},
|
|
//柳城地图
|
createBackImage() {
|
var urls = HttpUrl.GISERVEER + "/gisserver/wmsserver/JKQ_BLUE2";
|
window.sceneObj.backImage = sgworld.Creator.createImageryProvider(
|
"gisserver",
|
"wms",
|
{
|
url: urls,
|
layers: "",
|
parameters: {
|
format: "image/png",
|
transparent: true,
|
},
|
},
|
"0",
|
undefined,
|
true,
|
""
|
);
|
},
|
|
//加载黑色地图
|
showBackMap() {
|
if (window.sceneObj.backImage != null) {
|
let show = window.sceneObj.backImage.getVisibility();
|
this.backImageShow = !show;
|
window.sceneObj.backImage.setVisibility(!show);
|
} else {
|
this.createBackImage();
|
}
|
},
|
|
//加载倾斜区域一
|
ShowQXData() {
|
this.QXShow = !this.QXShow;
|
this.showTwoTileModel();
|
if (this.QXShow) {
|
//镂空后倾斜数据
|
if (window.sceneObj.qxData1 != null) {
|
// window.sceneObj.qxData1.setVisibility(this.QXShow);
|
window.Viewer.scene.primitives.remove(window.sceneObj.qxData1);
|
window.sceneObj.qxData1 = null;
|
} else {
|
this.Creat3DtileLoad(
|
"/gisserver/c3dserver/qingxie1/tileset.json",
|
"1"
|
);
|
}
|
|
|
} else {
|
if (window.sceneObj.qxData1 != null) {
|
// window.sceneObj.qxData1.setVisibility(this.QXShow);
|
window.Viewer.scene.primitives.remove(window.sceneObj.qxData1);
|
window.sceneObj.qxData1 = null;
|
}
|
}
|
},
|
//修改3dtile高度
|
create3DTikesHeight(tileset, num) {
|
var height = Number(num);
|
|
var cartographic = Cesium.Cartographic.fromCartesian(
|
tileset.boundingSphere.center
|
);
|
var surface = Cesium.Cartesian3.fromRadians(
|
cartographic.longitude,
|
cartographic.latitude,
|
cartographic.height
|
);
|
var offset = Cesium.Cartesian3.fromRadians(
|
cartographic.longitude,
|
cartographic.latitude,
|
height
|
);
|
var translation = Cesium.Cartesian3.subtract(
|
offset,
|
surface,
|
new Cesium.Cartesian3()
|
);
|
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
|
},
|
//创建倾斜数据加载
|
Creat3DtileLoad(url, parm) {
|
url = HttpUrl.GISERVEER + url;
|
var tileset = new Cesium.Cesium3DTileset({
|
url: url,
|
maximumScreenSpaceError: 32, // 【重要】最大屏幕空间错误:16
|
maximumMemoryUsage: 512, // 【重要】最大内存:512
|
dynamicScreenSpaceError: true, // 减少离相机较远的屏幕空间错误:false
|
cullWithChildrenBounds: true, // 使用子项边界体积的并集来剔除图块:true
|
skipLevelOfDetail: true, // 在遍历时候跳过详情:false
|
preferLeaves: true, // 【重要】预装子节点:false
|
loadSiblings: true, // 自动从中心开始超清化模型:false
|
//cullRequestsWhileMovingMultiplier: 10, // 【重要】移动时用于剔除请求的乘数,较大的是更积极的剔除:60
|
progressiveResolutionHeightFraction: 0.5, // 【重要】数值偏于0能够让初始加载变得模糊:0-0.5
|
});
|
let that = this;
|
switch (parm) {
|
case "1":
|
|
tileset.readyPromise.then(function (tileset) {
|
// sgworld.Navigate.flyTo(tileset);
|
window.sceneObj.qxData1 =
|
window.Viewer.scene.primitives.add(tileset);
|
that.create3DTikesHeight(tileset, -100);
|
});
|
|
break;
|
case "2":
|
|
tileset.readyPromise.then(function (tileset) {
|
sgworld.Navigate.flyTo(tileset);
|
window.sceneObj.qxData2 =
|
window.Viewer.scene.primitives.add(tileset);
|
that.create3DTikesHeight(tileset, -108);
|
});
|
break;
|
case "3":
|
|
tileset.readyPromise.then(function (tileset) {
|
sgworld.Navigate.flyTo(tileset);
|
window.sceneObj.qxData3 =
|
window.Viewer.scene.primitives.add(tileset);
|
that.create3DTikesHeight(tileset, -108);
|
});
|
break;
|
case "4":
|
tileset.readyPromise.then(function (tileset) {
|
sgworld.Navigate.flyTo(tileset);
|
window.sceneObj.qxData4 =
|
window.Viewer.scene.primitives.add(tileset);
|
that.create3DTikesHeight(tileset, -108);
|
});
|
break;
|
case "5":
|
|
tileset.readyPromise.then(function (tileset) {
|
sgworld.Navigate.flyTo(tileset);
|
window.sceneObj.qxData5 =
|
window.Viewer.scene.primitives.add(tileset);
|
that.create3DTikesHeight(tileset, -108);
|
});
|
break;
|
default:
|
break;
|
}
|
},
|
//倾斜区域二
|
createTwoTileModel() {
|
var url1 =
|
"http://127.0.0.1:8090/gisserver/c3dserver/qingxie2/tileset.json";
|
window.sceneObj.tileModelTwo = sgworld.Creator.create3DTilesets(
|
"",
|
url1,
|
{},
|
{ groundheight: -160 },
|
// {skipLevelOfDetail: true},
|
0,
|
true,
|
(data) => { }
|
);
|
},
|
|
showTwoTileModel() {
|
this.tileModelTwoShow = !this.tileModelTwoShow;
|
if (this.tileModelTwoShow) {
|
if (window.sceneObj.tileModelTwo != null) {
|
window.sceneObj.tileModelTwo.setVisibility(this.tileModelTwoShow);
|
} else {
|
this.createTwoTileModel();
|
}
|
} else {
|
if (window.sceneObj.tileModelTwo != null) {
|
window.sceneObj.tileModelTwo.setVisibility(this.tileModelTwoShow);
|
}
|
}
|
},
|
|
createOneFineModel() {
|
let that = this;
|
// var url1 =
|
// "http://127.0.0.1:8090/gisserver/c3dserver/05201/tileset.json";
|
var url1 =
|
// "http://127.0.0.1:8090/gisserver/c3dserver/JKQ_JM/tileset.json";
|
`${HttpUrl.GISERVEER}/gisserver/c3dserver/JKQ_TEST/tileset.json`;
|
|
var tileset = new Cesium.Cesium3DTileset({
|
url: url1,
|
maximumScreenSpaceError: 32, // 【重要】最大屏幕空间错误:16
|
maximumMemoryUsage: 512, // 【重要】最大内存:512
|
dynamicScreenSpaceError: true, // 减少离相机较远的屏幕空间错误:false
|
cullWithChildrenBounds: true, // 使用子项边界体积的并集来剔除图块:true
|
skipLevelOfDetail: true, // 在遍历时候跳过详情:false
|
preferLeaves: true, // 【重要】预装子节点:false
|
loadSiblings: true, // 自动从中心开始超清化模型:false
|
//cullRequestsWhileMovingMultiplier: 10, // 【重要】移动时用于剔除请求的乘数,较大的是更积极的剔除:60
|
progressiveResolutionHeightFraction: 0.5, // 【重要】数值偏于0能够让初始加载变得模糊:0-0.5
|
});
|
tileset.readyPromise.then(function (tileset) {
|
sgworld.Navigate.flyTo(tileset);
|
window.sceneObj.fineModelOne =
|
window.Viewer.scene.primitives.add(tileset);
|
that.create3DTikesHeight(tileset, 60);
|
});
|
// window.sceneObj.fineModelOne = sgworld.Creator.create3DTilesets(
|
// "",
|
// url1,
|
// {},
|
// { groundheight: -175 },
|
// { skipLevelOfDetail: true },
|
// 0,
|
// true,
|
// (data) => {}
|
// );
|
},
|
createTwoFineModel() {
|
var url1 = `${HttpUrl.GISERVEER}/gisserver/c3dserver/05201/tileset.json`;
|
var tileset = new Cesium.Cesium3DTileset({
|
url: url1,
|
maximumScreenSpaceError: 32, // 【重要】最大屏幕空间错误:16
|
maximumMemoryUsage: 512, // 【重要】最大内存:512
|
dynamicScreenSpaceError: true, // 减少离相机较远的屏幕空间错误:false
|
cullWithChildrenBounds: true, // 使用子项边界体积的并集来剔除图块:true
|
skipLevelOfDetail: true, // 在遍历时候跳过详情:false
|
preferLeaves: true, // 【重要】预装子节点:false
|
loadSiblings: true, // 自动从中心开始超清化模型:false //cullRequestsWhileMovingMultiplier: 10, // 【重要】移动时用于剔除请求的乘数,较大的是更积极的剔除:60
|
progressiveResolutionHeightFraction: 0.5, // 【重要】数值偏于0能够让初始加载变得模糊:0-0.5
|
});
|
tileset.readyPromise.then(function (tileset) {
|
// sgworld.Navigate.flyTo(tileset);
|
window.sceneObj.fineModelTwo =
|
window.Viewer.scene.primitives.add(tileset);
|
that.create3DTikesHeight(tileset, -1000);
|
});
|
},
|
createThreeFineModel() {
|
var url1 = `${HttpUrl.GISERVEER}/gisserver/c3dserver/05202/tileset.json`;
|
var tileset = new Cesium.Cesium3DTileset({
|
url: url1,
|
maximumScreenSpaceError: 32, // 【重要】最大屏幕空间错误:16
|
maximumMemoryUsage: 512, // 【重要】最大内存:512
|
dynamicScreenSpaceError: true, // 减少离相机较远的屏幕空间错误:false
|
cullWithChildrenBounds: true, // 使用子项边界体积的并集来剔除图块:true
|
skipLevelOfDetail: true, // 在遍历时候跳过详情:false
|
preferLeaves: true, // 【重要】预装子节点:false
|
loadSiblings: true, // 自动从中心开始超清化模型:false //cullRequestsWhileMovingMultiplier: 10, // 【重要】移动时用于剔除请求的乘数,较大的是更积极的剔除:60
|
progressiveResolutionHeightFraction: 0.5, // 【重要】数值偏于0能够让初始加载变得模糊:0-0.5
|
});
|
tileset.readyPromise.then(function (tileset) {
|
// sgworld.Navigate.flyTo(tileset);
|
window.sceneObj.fineModelThree =
|
window.Viewer.scene.primitives.add(tileset);
|
that.create3DTikesHeight(tileset, -100);
|
});
|
},
|
//创建白膜
|
createWhiteModel(url, key, color) {
|
var url1 =
|
// "http://127.0.0.1:8090/gisserver/c3dserver/BM_B3DM/tileset.json";
|
// "http://127.0.0.1:8090/gisserver/c3dserver/05202/tileset.json";
|
HttpUrl.GISERVEER + url;
|
var tileset = new Cesium.Cesium3DTileset({
|
url: url1,
|
maximumScreenSpaceError: 32, // 【重要】最大屏幕空间错误:16
|
maximumMemoryUsage: 512, // 【重要】最大内存:512
|
dynamicScreenSpaceError: true, // 减少离相机较远的屏幕空间错误:false
|
cullWithChildrenBounds: true, // 使用子项边界体积的并集来剔除图块:true
|
skipLevelOfDetail: true, // 在遍历时候跳过详情:false
|
preferLeaves: true, // 【重要】预装子节点:false
|
loadSiblings: true, // 自动从中心开始超清化模型:false
|
//cullRequestsWhileMovingMultiplier: 10, // 【重要】移动时用于剔除请求的乘数,较大的是更积极的剔除:60
|
progressiveResolutionHeightFraction: 0.5, // 【重要】数值偏于0能够让初始加载变得模糊:0-0.5
|
});
|
let that = this;
|
switch (key) {
|
case "1":
|
tileset.readyPromise.then(function (tileset) {
|
tileset.style = new Cesium.Cesium3DTileStyle({
|
color: {
|
conditions: [["true", color]],
|
},
|
});
|
//实现渐变效果
|
tileset.tileVisible.addEventListener(function (tile) {
|
var content = tile.content;
|
var featuresLength = content.featuresLength;
|
for (let i = 0; i < featuresLength; i += 2) {
|
let feature = content.getFeature(i);
|
let model = feature.content._model;
|
|
if (
|
model &&
|
model._sourcePrograms &&
|
model._rendererResources
|
) {
|
Object.keys(model._sourcePrograms).forEach((key) => {
|
let program = model._sourcePrograms[key];
|
let fragmentShader =
|
model._rendererResources.sourceShaders[
|
program.fragmentShader
|
];
|
let v_position = "";
|
if (fragmentShader.indexOf(" v_positionEC;") != -1) {
|
v_position = "v_positionEC";
|
} else if (fragmentShader.indexOf(" v_pos;") != -1) {
|
v_position = "v_pos";
|
}
|
const color = `vec4(${feature.color.toString()})`;
|
|
model._rendererResources.sourceShaders[
|
program.fragmentShader
|
] = `
|
varying vec3 ${v_position};
|
void main(void){
|
vec4 position = czm_inverseModelView * vec4(${v_position},1); // 位置
|
gl_FragColor = ${color}; // 颜色
|
gl_FragColor *= vec4(vec3(position.z / 50.0), 1.0); // 渐变
|
// 动态光环
|
float time = fract(czm_frameNumber / 180.0);
|
time = abs(time - 0.5) * 2.0;
|
float glowRange = 180.0; // 光环的移动范围(高度)
|
float diff = step(0.005, abs( clamp(position.z / glowRange, 0.0, 1.0) - time));
|
gl_FragColor.rgb += gl_FragColor.rgb * (1.0 - diff);
|
}
|
`;
|
});
|
model._shouldRegenerateShaders = true;
|
}
|
}
|
});
|
//
|
|
window.sceneObj.whiteModel =
|
window.Viewer.scene.primitives.add(tileset);
|
// that.create3DTikesHeight(tileset, -100);
|
|
});
|
break;
|
case "2":
|
tileset.readyPromise.then(function (tileset) {
|
tileset.style = new Cesium.Cesium3DTileStyle({
|
color: {
|
conditions: [["true", color]],
|
},
|
});
|
//实现渐变效果
|
tileset.tileVisible.addEventListener(function (tile) {
|
var content = tile.content;
|
var featuresLength = content.featuresLength;
|
for (let i = 0; i < featuresLength; i += 2) {
|
let feature = content.getFeature(i);
|
let model = feature.content._model;
|
|
if (
|
model &&
|
model._sourcePrograms &&
|
model._rendererResources
|
) {
|
Object.keys(model._sourcePrograms).forEach((key) => {
|
let program = model._sourcePrograms[key];
|
let fragmentShader =
|
model._rendererResources.sourceShaders[
|
program.fragmentShader
|
];
|
let v_position = "";
|
if (fragmentShader.indexOf(" v_positionEC;") != -1) {
|
v_position = "v_positionEC";
|
} else if (fragmentShader.indexOf(" v_pos;") != -1) {
|
v_position = "v_pos";
|
}
|
const color = `vec4(${feature.color.toString()})`;
|
|
model._rendererResources.sourceShaders[
|
program.fragmentShader
|
] = `
|
varying vec3 ${v_position};
|
void main(void){
|
vec4 position = czm_inverseModelView * vec4(${v_position},1); // 位置
|
gl_FragColor = ${color}; // 颜色
|
gl_FragColor *= vec4(vec3(position.z / 50.0), 1.0); // 渐变
|
// 动态光环
|
float time = fract(czm_frameNumber / 180.0);
|
time = abs(time - 0.5) * 2.0;
|
float glowRange = 180.0; // 光环的移动范围(高度)
|
float diff = step(0.005, abs( clamp(position.z / glowRange, 0.0, 1.0) - time));
|
gl_FragColor.rgb += gl_FragColor.rgb * (1.0 - diff);
|
}
|
`;
|
});
|
model._shouldRegenerateShaders = true;
|
}
|
}
|
});
|
sgworld.Navigate.flyTo(tileset);
|
window.sceneObj.JKQBMwhiteModel =
|
window.Viewer.scene.primitives.add(tileset);
|
// that.create3DTikesHeight(tileset, -100);
|
});
|
break;
|
}
|
},
|
//精模数据一
|
showOneFineModel() {
|
// this.showTwoFineModel();
|
// this.ShowJDMYArea();
|
this.fineModelOneShow = !this.fineModelOneShow;
|
if (this.fineModelOneShow) {
|
if (window.sceneObj.fineModelTwo != null) {
|
// window.sceneObj.fineModelOne.setVisibility(this.fineModelOneShow);
|
window.Viewer.scene.primitives.remove(window.sceneObj.fineModelOne);
|
window.sceneObj.fineModelOne = null;
|
window.Viewer.scene.primitives.remove(window.sceneObj.fineModelTwo);
|
window.sceneObj.fineModelTwo = null;
|
window.Viewer.scene.primitives.remove(window.sceneObj.fineModelThree);
|
window.sceneObj.fineModelThree = null;
|
} else {
|
// this.createOneFineModel();
|
this.createTwoFineModel();
|
this.createThreeFineModel();
|
}
|
} else {
|
if (window.sceneObj.fineModelTwo != null) {
|
// window.sceneObj.fineModelOne.setVisibility(this.fineModelOneShow);
|
window.Viewer.scene.primitives.remove(window.sceneObj.fineModelOne);
|
window.sceneObj.fineModelOne = null;
|
window.Viewer.scene.primitives.remove(window.sceneObj.fineModelTwo);
|
window.sceneObj.fineModelTwo = null;
|
window.Viewer.scene.primitives.remove(window.sceneObj.fineModelThree);
|
window.sceneObj.fineModelThree = null;
|
}
|
}
|
},
|
//精模数据二
|
showTwoFineModel() {
|
this.fineModelTwoShow = !this.fineModelTwoShow;
|
if (this.fineModelTwoShow) {
|
if (window.sceneObj.fineModelTwo != null) {
|
window.sceneObj.fineModelTwo.setVisibility(this.fineModelTwoShow);
|
} else {
|
this.createTwoFineModel();
|
}
|
} else {
|
if (window.sceneObj.fineModelTwo != null) {
|
window.sceneObj.fineModelTwo.setVisibility(this.fineModelTwoShow);
|
}
|
}
|
},
|
//在建项目数据
|
showWhiteModel() {
|
Viewer.camera.setView({ //跳转视角
|
destination: new Cesium.Cartesian3.fromDegrees(
|
120.48822100000004,
|
41.57861600000002,
|
2500
|
),
|
orientation: {
|
heading: Cesium.Math.toRadians(0),
|
pitch: Cesium.Math.toRadians(-45),
|
roll:0
|
}
|
|
})
|
// this.ShowLDArea();
|
this.whiteModelShow = !this.whiteModelShow;
|
this.$bus.$emit("gettobus", this.whiteModelShow);
|
if (this.whiteModelShow) {
|
if (window.sceneObj.whiteModel != null) {
|
window.sceneObj.whiteModel.destroy();
|
window.sceneObj.whiteModel = null;
|
} else {
|
this.createWhiteModel(
|
"/gisserver/c3dserver/JKQ_ZJXM/tileset.json",
|
"1",
|
"rgba(39,108,177 ,1)"
|
);
|
}
|
} else {
|
if (window.sceneObj.whiteModel != null) {
|
window.sceneObj.whiteModel.destroy();
|
window.sceneObj.whiteModel = null;
|
}
|
}
|
},
|
//白模名字wms
|
// ShowBMNameArea() {
|
// this.BMNameShow = !this.BMNameShow;
|
// if (this.BMNameShow) {
|
// //加载wms服务
|
// if (window.sceneObj.BMNameArea != null) {
|
// window.sceneObj.BMNameArea.setVisibility(this.BMNameShow);
|
// } else {
|
// window.sceneObj.BMNameArea = this.createWMSLayer(
|
// "/gisserver/wmsserver/BM_MC", "");
|
// }
|
//
|
// } else {
|
// if (window.sceneObj.BMNameArea != null) {
|
// window.sceneObj.BMNameArea.setVisibility(this.BMNameShow);
|
// }
|
// }
|
// },
|
//白模名字wfs
|
ShowBMNameArea() {
|
this.BMNameShow = !this.BMNameShow;
|
if (this.BMNameShow) {
|
//加载wfs服务
|
if (window.sceneObj.BMNameAreaL != null) {
|
// window.sceneObj.BMNameAreaL.setVisibility(this.BMNameShow);
|
window.sceneObj.BMNameAreaL.destroy();
|
} else {
|
window.sceneObj.BMNameAreaL = this.createWFSLayer(
|
"http://127.0.0.1:8090/gisserver/wfsserver/BM_MC2_wfs",
|
"建筑名称84",
|
"[NAME]"
|
);
|
}
|
} else {
|
if (window.sceneObj.BMNameAreaL != null) {
|
// window.sceneObj.BMNameAreaL.setVisibility(this.BMNameShow);
|
window.sceneObj.BMNameAreaL.destroy();
|
}
|
}
|
},
|
//展示化工
|
ShowHGArea() {
|
this.HGShow = !this.HGShow;
|
if (this.HGShow) {
|
if (window.sceneObj.HGArea != null) {
|
window.sceneObj.HGArea.item.destroy();
|
window.sceneObj.HGArea = null;
|
sgworld.Viewer.entities.removeById(window.sceneObj.HGLabel.item.id);
|
} else {
|
window.sceneObj.HGArea = this.get3DTilesets(
|
"/gisserver/c3dserver/JKQ_HGQ/tileset.json",
|
"rgba(255,231,47,0.6)",
|
100
|
);
|
var position = { X: 120.537023229, Y: 41.660884151, Altitude: 700 };
|
window.sceneObj.HGLabel = sgworld.Creator.CreateImageLabel(
|
position,
|
SmartEarthRootUrl + "Workers/img/a6.png",
|
{
|
scale: 0.8,
|
},
|
0,
|
"化工区"
|
);
|
}
|
} else {
|
if (window.sceneObj.HGArea != null) {
|
window.sceneObj.HGArea.item.destroy();
|
window.sceneObj.HGArea = null;
|
sgworld.Viewer.entities.removeById(window.sceneObj.HGLabel.item.id);
|
}
|
}
|
},
|
get3DTilesets(url, color, height) {
|
var tiltModel1 = sgworld.Creator.create3DTilesets(
|
"",
|
GISERVEER + url,
|
{},
|
{
|
effects: false,
|
effectsMaxHeight: 200,
|
colors: color,
|
groundHeight: height,
|
},
|
"0",
|
true,
|
(data) => { }
|
);
|
return tiltModel1;
|
},
|
//展示燕都新区
|
ShowYDArea() {
|
this.YDShow = !this.YDShow;
|
if (this.YDShow) {
|
if (window.sceneObj.YDArea != null) {
|
window.sceneObj.YDArea.item.destroy();
|
window.sceneObj.YDArea = null;
|
sgworld.Viewer.entities.removeById(window.sceneObj.YDLabel.item.id);
|
} else {
|
window.sceneObj.YDArea = this.get3DTilesets(
|
"/gisserver/c3dserver/JKQ_YDXQ/tileset.json",
|
"rgba(0,240,255,0.6)",
|
100
|
);
|
var position = { X: 120.49807819, Y: 41.626051778, Altitude: 1000 };
|
window.sceneObj.YDLabel = sgworld.Creator.CreateImageLabel(
|
position,
|
SmartEarthRootUrl + "Workers/img/a1.png",
|
{},
|
0,
|
"燕都新区"
|
);
|
}
|
} else {
|
if (window.sceneObj.YDArea != null) {
|
window.sceneObj.YDArea.item.destroy();
|
window.sceneObj.YDArea = null;
|
sgworld.Viewer.entities.removeById(window.sceneObj.YDLabel.item.id);
|
}
|
}
|
},
|
|
ShowJKQArea() {
|
this.JKQhow = !this.JKQhow;
|
if (this.JKQhow) {
|
if (window.sceneObj.JKQArea != null) {
|
window.sceneObj.JKQArea.item.destroy();
|
window.sceneObj.JKQArea = null;
|
} else {
|
window.sceneObj.JKQArea = this.get3DTilesets(
|
"/gisserver/c3dserver/JKQ_QY/tileset.json",
|
"rgba(49,114,115,1)",
|
1
|
);
|
}
|
} else {
|
if (window.sceneObj.JKQArea != null) {
|
window.sceneObj.JKQArea.item.destroy();
|
window.sceneObj.JKQArea = null;
|
}
|
}
|
},
|
//展示气象监测点
|
ShowQxjcPositon() {
|
this.QXJCDShow = !this.QXJCDShow;
|
if (this.QXJCDShow) {
|
if (window.sceneObj.QXJCDataL != null) {
|
sgworld.Viewer.dataSources.remove(window.sceneObj.QXJCDataL);
|
window.sceneObj.QXJCDataL = null;
|
} else {
|
var url =
|
"/data/JKQ_QXJCD.json"
|
window.sceneObj.QXJCDataL = new Cesium.GeoJsonDataSource("气象监测点"); // 创建并取名
|
Viewer.dataSources.add(window.sceneObj.QXJCDataL);
|
window.sceneObj.QXJCDataL.load(url).then(function (dataSource) {
|
var val = dataSource.entities.values;
|
for (var i = 0; i < val.length; i++) {
|
var entity = val[i];
|
entity.position._value.z += 700.0;
|
// 使用大小为64*64的icon,缩小展示poi
|
entity.billboard = {
|
image: SmartEarthRootUrl + "Workers/img/a4.png",
|
scale: 0.3,
|
// 无视遮挡
|
disableDepthTestDistance: Infinity,
|
};
|
|
}
|
})
|
}
|
} else {
|
sgworld.Viewer.dataSources.remove(window.sceneObj.QXJCDataL);
|
window.sceneObj.QXJCDataL = null;
|
}
|
},
|
ShowQxjcKs() {
|
this.QXJCKShow = !this.QXJCKShow;
|
if (this.QXJCKShow) {
|
if (window.sceneObj.QXJCKataL.length != 0) {
|
for (var i in window.sceneObj.QXJCKataL) {
|
var val = window.sceneObj.QXJCKataL[i]
|
val.deleteObject()
|
}
|
window.sceneObj.QXJCKataL = [];
|
window.sceneObj.QXJCKataL.length = 0;
|
} else {
|
var url =
|
"/data/JKQ_QXJCD.json"
|
axios.get(url).then((res) => {
|
if (res.status != 200) return
|
var data = res.data.features;
|
for (var i in data) {
|
var val = sgworld.Analysis.createCircleScan({ lon: data[i].geometry.coordinates[0], lat: data[i].geometry.coordinates[1] }, 3000, ' #FFD700', 3000, true);
|
window.sceneObj.QXJCKataL.push(val)
|
}
|
})
|
}
|
} else {
|
for (var i = 0; i < window.sceneObj.QXJCKataL.length; i++) {
|
var val = window.sceneObj.QXJCKataL[i]
|
val.deleteObject()
|
}
|
window.sceneObj.QXJCKataL = [];
|
window.sceneObj.QXJCKataL.length = 0;
|
}
|
|
},
|
|
|
//展示企业地名
|
ShowJMArea() {
|
this.JMShow = !this.JMShow;
|
if (this.JMShow) {
|
//加载wfs服务
|
if (window.sceneObj.JMDataL != null) {
|
// window.sceneObj.JMDataL.setVisibility(this.JMShow);
|
// window.sceneObj.JMDataL.destroy();
|
sgworld.Viewer.dataSources.remove(window.sceneObj.JMDataL);
|
window.sceneObj.JMDataL = null;
|
} else {
|
|
//获取点位数据
|
var url =
|
HttpUrl.GISERVEER +
|
"/gisserver/wfsserver/JKQ_QYD?version=1.3.0&request=GetFeature&typename=qy_point&propertyname=*&bbox=120.42461209746953%2C41.53703145231882%2C120.59147171190538%2C41.69146257884096&format=json";
|
window.sceneObj.JMDataL = new Cesium.GeoJsonDataSource("企业点位"); // 创建并取名
|
Viewer.dataSources.add(window.sceneObj.JMDataL);
|
window.sceneObj.JMDataL.load(url).then(function (dataSource) {
|
dataSource.entities.values.forEach((entity) => {
|
// 将点拉伸一定高度,防止被地形压盖
|
entity.position._value.z += 50.0;
|
// 使用大小为64*64的icon,缩小展示poi
|
entity.billboard = {
|
image: SmartEarthRootUrl + "Workers/img/c2.png",
|
width: 70,
|
height: 70,
|
// 无视遮挡
|
disableDepthTestDistance: Infinity,
|
};
|
entity.properties.state = "QY";
|
// entity.label = {
|
// text: entity.name,
|
// font: "bold 24px Microsoft YaHei",
|
// // 竖直对齐方式
|
// verticalOrigin: Cesium.VerticalOrigin.TOP,
|
// // 水平对齐方式
|
// horizontalOrigin: Cesium.HorizontalOrigin.TOP,
|
// // 偏移量
|
// pixelOffset: new Cesium.Cartesian2(0, -70),
|
// };
|
|
|
});
|
|
dataSource.clustering.enabled = true;
|
dataSource.clustering.pixelRange = 45;
|
dataSource.clustering.minimumClusterSize = 2;
|
dataSource.clustering.clusterEvent.addEventListener(function (
|
clusteredEntities,
|
cluster
|
) {
|
cluster.label.show = false;
|
cluster.billboard.show = true;
|
cluster.billboard.id = cluster.label.id;
|
cluster.billboard.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
|
});
|
});
|
}
|
} else {
|
if (window.sceneObj.JMDataL != null) {
|
sgworld.Viewer.dataSources.remove(window.sceneObj.JMDataL);
|
window.sceneObj.JMDataL = null;
|
}
|
}
|
},
|
ShowLDArea() {
|
this.LDShow = !this.LDShow;
|
if (this.LDShow) {
|
//加载wms服务
|
if (window.sceneObj.LDData != null) {
|
window.sceneObj.LDData.setVisibility(this.LDShow);
|
} else {
|
window.sceneObj.LDData = this.createWMSLayer(
|
"/gisserver/wmsserver/JKQ_XMLDT",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.LDData != null) {
|
window.sceneObj.LDData.setVisibility(this.LDShow);
|
}
|
}
|
},
|
|
//展示供地区
|
ShowJCArea() {
|
this.JCShow = !this.JCShow;
|
this.$bus.$emit("gettobus", this.JCShow);
|
if (this.JCShow) {
|
//加载wms服务
|
if (window.sceneObj.JCData != null) {
|
// window.sceneObj.JCData.setVisibility(this.JCShow);
|
// window.sceneObj.JCData.destroy()
|
// window.sceneObj.JCData = null
|
Viewer.dataSources.remove(window.sceneObj.JCData);
|
} else {
|
// window.sceneObj.JCData = this.createWMSLayer(
|
// // "/gisserver/wmsserver/GH_JCQ", "");
|
// "/gisserver/wmsserver/JKQ_GD",
|
// ""
|
// );
|
// let sgwfs = new SmartEarth.WFSTool(Viewer)
|
// window.sceneObj.JCData = sgwfs.CreateWfs('polygon', {
|
// urls: HttpUrl.GISERVEER + '/gisserver/wmsserver/JKQ_GD',
|
// layer: 'GD',
|
// color: '#FFF',
|
// outlineColor: "#FFF",
|
// alpha: 0.1
|
|
// })
|
// sgworld.Viewer.dataSources.add(Cesium.GeoJsonDataSource.load('http://172.16.0.71:8090/gisserver/wfsserver/JKQ_GD?version=1.3.0&request=GetFeature&typename=GD&propertyname=*&bbox=120.46471305656235%2C41.59263001416389%2C120.55903370903849%2C41.662369629354934&format=json', {
|
// stroke: Cesium.Color.HOTPINK,
|
// fill: Cesium.Color.PINK.withAlpha(0.5),
|
// strokeWidth: 3
|
// }));
|
var url =
|
"http://172.16.0.71:8090/gisserver/wfsserver/JKQ_GD?version=1.3.0&request=GetFeature&typename=GD&propertyname=*&bbox=120.46471305656235%2C41.59263001416389%2C120.55903370903849%2C41.662369629354934&format=json";
|
window.sceneObj.JCData = new Cesium.GeoJsonDataSource("供地区"); // 创建并取名
|
Viewer.dataSources.add(window.sceneObj.JCData);
|
window.sceneObj.JCData.load(url).then(function (data) {
|
const entities = data.entities.values; // 拿到所有实体
|
entities.forEach((entity) => {
|
entity.polygon.height._value = 5;
|
entity.polygon.outlineColor =
|
Cesium.Color.fromCssColorString("rgb(31,92,157)").withAlpha(1);
|
entity.polygon.material =
|
Cesium.Color.fromCssColorString("rgb(39,108,177)").withAlpha(
|
0.5
|
);
|
});
|
});
|
}
|
} else {
|
if (window.sceneObj.JCData != null) {
|
// window.sceneObj.JCData.setVisibility(this.JCShow);
|
// window.sceneObj.JCData.destroy()
|
//
|
Viewer.dataSources.remove(window.sceneObj.JCData);
|
window.sceneObj.JCData = null;
|
}
|
}
|
},
|
|
//征地区
|
ShowZDArea() {
|
this.ZDShow = !this.ZDShow;
|
this.$bus.$emit("gettobus", this.ZDShow);
|
if (this.ZDShow) {
|
//加载wms服务
|
if (window.sceneObj.ZDData != null) {
|
window.sceneObj.ZDData.setVisibility(this.ZDShow);
|
} else {
|
window.sceneObj.ZDData = this.createWMSLayer(
|
// "/gisserver/wmsserver/GH_ZDQYJX", "");
|
"/gisserver/wmsserver/JK_ZD",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.ZDData != null) {
|
window.sceneObj.ZDData.setVisibility(this.ZDShow);
|
}
|
}
|
},
|
//金达
|
ShowJDMYArea() {
|
this.JDMYShow = !this.JDMYShow;
|
if (this.JDMYShow) {
|
//加载wfs服务
|
|
if (window.sceneObj.JDMYDataL != null) {
|
// window.sceneObj.JDMYDataL.setVisibility(this.JDMYShow);
|
window.sceneObj.JDMYDataL.destroy();
|
window.sceneObj.JDMYDataL = null;
|
} else {
|
window.sceneObj.JDMYDataL = this.createWFSLayer(
|
`${HttpUrl.GISERVEER}/gisserver/wfsserver/JKQ_JDMY_wfs`,
|
"JDMY",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.JDMYDataL != null) {
|
// window.sceneObj.JDMYDataL.setVisibility(this.JDMYShow);
|
window.sceneObj.JDMYDataL.destroy();
|
window.sceneObj.JDMYDataL = null;
|
}
|
}
|
},
|
|
//二集三化图
|
ShowESArea() {
|
this.ESShow = !this.ESShow;
|
if (this.ESShow) {
|
//加载wms服务
|
if (window.sceneObj.ESData != null) {
|
window.sceneObj.ESData.setVisibility(this.ESShow);
|
} else {
|
window.sceneObj.ESData = this.createWMSLayer(
|
"/gisserver/wmsserver/JKQ_EJSH",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.ESData != null) {
|
window.sceneObj.ESData.setVisibility(this.ESShow);
|
}
|
}
|
},
|
|
//展示轻纺制造区
|
ShowHXArea() {
|
this.HXShow = !this.HXShow;
|
if (this.HXShow) {
|
if (window.sceneObj.HXData != null) {
|
window.sceneObj.HXData.item.destroy();
|
window.sceneObj.HXData = null;
|
sgworld.Viewer.entities.removeById(window.sceneObj.HXLabel.item.id);
|
} else {
|
window.sceneObj.HXData = this.get3DTilesets(
|
"/gisserver/c3dserver/JKQ_QFZZQ/tileset.json",
|
"rgba(255,153,153,0.6)",
|
100
|
);
|
var position = { X: 120.544658727, Y: 41.638937925, Altitude: 800 };
|
window.sceneObj.HXLabel = sgworld.Creator.CreateImageLabel(
|
position,
|
SmartEarthRootUrl + "Workers/img/a3.png",
|
{
|
scale: 0.8,
|
},
|
0,
|
"轻纺制造区"
|
);
|
}
|
} else {
|
if (window.sceneObj.HXData != null) {
|
window.sceneObj.HXData.item.destroy();
|
window.sceneObj.HXData = null;
|
sgworld.Viewer.entities.removeById(window.sceneObj.HXLabel.item.id);
|
}
|
}
|
},
|
|
//展示规划区
|
ShowGHYTArea() {
|
this.GHShow = !this.GHShow;
|
this.legend = this.GHShow;
|
// this.ShowZJArea1();
|
// this.ShowGSArea();
|
if (this.GHShow) {
|
//加载wms服务
|
if (window.sceneObj.GHYDData != null) {
|
window.sceneObj.GHYDData.setVisibility(this.GHShow);
|
} else {
|
// window.sceneObj.GHYDData =this.createWMSLayer("/gisserver/wmsserver/LC_GH","");
|
window.sceneObj.GHYDData = this.createWMSLayer(
|
"/gisserver/wmsserver/JKQ_GH2",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.GHYDData != null) {
|
window.sceneObj.GHYDData.setVisibility(this.GHShow);
|
}
|
}
|
},
|
//铁路注记WFS
|
ShowZJArea() {
|
this.ZJShow = !this.ZJShow;
|
if (this.ZJShow) {
|
//加载wfs服务
|
if (window.sceneObj.ZJDataL != null) {
|
// window.sceneObj.ZJDataL.setVisibility(this.ZJShow);
|
window.sceneObj.ZJDataL.destroy();
|
} else {
|
window.sceneObj.ZJDataL = this.createWFSLayer(
|
"http://127.0.0.1:8090/gisserver/wfsserver/JKQ_ZJ_wfs",
|
"交通注记",
|
"[Name]"
|
);
|
}
|
} else {
|
if (window.sceneObj.ZJDataL != null) {
|
// window.sceneObj.ZJDataL.setVisibility(this.ZJShow);
|
window.sceneObj.ZJDataL.destroy();
|
}
|
}
|
},
|
//交通注记WMS
|
ShowZJArea1() {
|
this.ZJShow = !this.ZJShow;
|
if (this.ZJShow) {
|
//加载wms服务
|
if (window.sceneObj.ZJData != null) {
|
window.sceneObj.ZJData.setVisibility(this.ZJShow);
|
} else {
|
window.sceneObj.ZJData = this.createWMSLayer(
|
"/gisserver/wfsserver/JKQ_JTZJ",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.ZJData != null) {
|
window.sceneObj.ZJData.setVisibility(this.ZJShow);
|
}
|
}
|
},
|
//高速WMS
|
ShowGSArea() {
|
this.GSShow = !this.GSShow;
|
if (this.GSShow) {
|
//加载wms服务
|
if (window.sceneObj.GSData != null) {
|
window.sceneObj.GSData.setVisibility(this.GSShow);
|
} else {
|
window.sceneObj.GSData = this.createWMSLayer(
|
"/gisserver/wfsserver/JKQ_GS",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.GSData != null) {
|
window.sceneObj.GSData.setVisibility(this.GSShow);
|
}
|
}
|
},
|
//给水管线
|
ShowJSLine() {
|
this.JSShow = !this.JSShow;
|
if (this.JSShow) {
|
//加载wms服务
|
if (window.sceneObj.JSData != null) {
|
window.sceneObj.JSData.setVisibility(this.JSShow);
|
} else {
|
window.sceneObj.JSData = this.createWMSLayer(
|
"/gisserver/wmsserver/GH_JS",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.JSData != null) {
|
window.sceneObj.JSData.setVisibility(this.JSShow);
|
}
|
}
|
},
|
|
//燃气管线
|
ShowRQLine() {
|
this.RQShow = !this.RQShow;
|
if (this.RQShow) {
|
//加载wms服务
|
if (window.sceneObj.RQData != null) {
|
window.sceneObj.RQData.setVisibility(this.RQShow);
|
} else {
|
window.sceneObj.RQData = this.createWMSLayer(
|
"/gisserver/wmsserver/GH_RQ",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.RQData != null) {
|
window.sceneObj.RQData.setVisibility(this.RQShow);
|
}
|
}
|
},
|
|
//蒸汽管线
|
ShowZQLine() {
|
this.ZQShow = !this.ZQShow;
|
if (this.ZQShow) {
|
//加载wms服务
|
if (window.sceneObj.ZQData != null) {
|
window.sceneObj.ZQData.setVisibility(this.ZQShow);
|
} else {
|
window.sceneObj.ZQData = this.createWMSLayer(
|
"/gisserver/wmsserver/GH_ZQ",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.ZQData != null) {
|
window.sceneObj.ZQData.setVisibility(this.ZQShow);
|
}
|
}
|
},
|
|
//水渠
|
ShowZSLine() {
|
this.ZSShow = !this.ZSShow;
|
if (this.ZSShow) {
|
//加载wms服务
|
if (window.sceneObj.ZSData != null) {
|
window.sceneObj.ZSData.setVisibility(this.ZSShow);
|
} else {
|
window.sceneObj.ZSData = this.createWMSLayer(
|
"/gisserver/wmsserver/GH_ZS",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.ZSData != null) {
|
window.sceneObj.ZSData.setVisibility(this.ZSShow);
|
}
|
}
|
},
|
|
//污水管线
|
ShowWSLine() {
|
this.WSShow = !this.WSShow;
|
if (this.WSShow) {
|
//加载wms服务
|
if (window.sceneObj.WSData != null) {
|
window.sceneObj.WSData.setVisibility(this.WSShow);
|
} else {
|
window.sceneObj.WSData = this.createWMSLayer(
|
"/gisserver/wmsserver/GH_WS",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.WSData != null) {
|
window.sceneObj.WSData.setVisibility(this.WSShow);
|
}
|
}
|
},
|
|
//已建企业 企业分布
|
ShowYJQY() {
|
this.QYShow = !this.QYShow;
|
if (this.QYShow) {
|
//加载wfs服务
|
if (window.sceneObj.QYDataL != null) {
|
// window.sceneObj.QYDataL.setVisibility(this.QYShow);
|
window.sceneObj.QYDataL.destroy();
|
} else {
|
window.sceneObj.QYDataL = this.createWFSLayer(
|
"/gisserver/wfsserver/LC_YJQY_ZX_wfs",
|
"LC_YJQY_ZX",
|
"[JianCheng]"
|
);
|
}
|
} else {
|
if (window.sceneObj.QYDataL != null) {
|
// window.sceneObj.QYDataL.setVisibility(this.QYShow);
|
window.sceneObj.QYDataL.destroy();
|
}
|
}
|
},
|
|
//企业热力图
|
showQYRL() {
|
this.QYRLShow = !this.QYRLShow;
|
if (this.QYRLShow) {
|
if (window.sceneObj.QYRLLayer != null) {
|
window.sceneObj.QYRLLayer.setVisibility(true);
|
} else {
|
axios.get("/data/GH_YJQY.json").then((response) => {
|
window.sceneObj.QYRLLayer = mapAPI.createHeatMap(
|
response,
|
"LJchanzhi"
|
);
|
});
|
}
|
} else {
|
if (window.sceneObj.QYRLLayer != null) {
|
window.sceneObj.QYRLLayer.setVisibility(false);
|
}
|
}
|
},
|
|
//企业税收
|
showQYZZ() {
|
this.QYZZShow = !this.QYZZShow;
|
if (this.QYZZShow) {
|
if (window.sceneObj.QYZZLayer != null) {
|
sgworld.ProjectTree.setVisibility(window.sceneObj.QYZZLayer, true);
|
} else {
|
axios.get("/data/GH_YJQY.json").then((response) => {
|
window.sceneObj.QYZZLayer = mapAPI.createMapBar(
|
response,
|
"LJshuishou"
|
);
|
});
|
}
|
} else {
|
if (window.sceneObj.QYZZLayer != null) {
|
sgworld.ProjectTree.setVisibility(window.sceneObj.QYZZLayer, false);
|
}
|
}
|
},
|
|
//路网数据
|
ShowLWLine() {
|
this.LWShow = !this.LWShow;
|
if (this.LWShow) {
|
//加载wms服务
|
if (window.sceneObj.LWData != null) {
|
window.sceneObj.LWData.deleteObject();
|
window.sceneObj.LWData = null;
|
} else {
|
window.sceneObj.LWData = sgworld.Creator.createPathLayer({
|
url: "http://172.16.0.71:8090/gisserver/wfsserver/JKQ_LW_wfs?version=1.3.0&request=GetFeature&typename=%E8%B7%AF%E7%BD%91&propertyname=*&bbox=120.41493480290832%2C41.5849613955957%2C120.6211690038835%2C41.68735627507088&format=json",
|
color: "#0033FF", //线的颜色
|
width: 4.0, //线的宽度
|
pointColor: "#FFFFFF", //移动点的颜色
|
speed: 0.3,
|
far: 50000,
|
});
|
}
|
} else {
|
if (window.sceneObj.LWData != null) {
|
window.sceneObj.LWData.deleteObject();
|
window.sceneObj.LWData = null;
|
}
|
}
|
},
|
|
//中水管线
|
ShowWater() {
|
this.WaterShow = !this.WaterShow;
|
if (this.WaterShow) {
|
//加载wms服务
|
if (window.sceneObj.waterLayer != null) {
|
window.sceneObj.waterLayer.setVisibility(this.WaterShow);
|
} else {
|
window.sceneObj.waterLayer = this.createWMSLayer(
|
"/gisserver/wmsserver/GH_ZSGX",
|
""
|
);
|
}
|
} else {
|
if (window.sceneObj.waterLayer != null) {
|
window.sceneObj.waterLayer.setVisibility(this.WaterShow);
|
}
|
}
|
},
|
|
//基础设施
|
ShowBaseEqument() {
|
this.BaseEqumentShow = !this.BaseEqumentShow;
|
if (this.BaseEqumentShow) {
|
//加载wfs服务
|
if (window.sceneObj.baseEqumentLayer != null) {
|
// window.sceneObj.baseEqumentLayer.setVisibility(this.BaseEqumentShow);
|
window.sceneObj.baseEqumentLayer.destroy();
|
} else {
|
window.sceneObj.baseEqumentLayer = this.createWFSLayer(
|
"/gisserver/wfsserver/LC_JCSS_wfs",
|
"LC_JCSS",
|
"[NAME]"
|
);
|
}
|
} else {
|
if (window.sceneObj.baseEqumentLayer != null) {
|
// window.sceneObj.baseEqumentLayer.setVisibility(this.BaseEqumentShow);
|
window.sceneObj.baseEqumentLayer.destroy();
|
}
|
}
|
},
|
|
//智能水表
|
// ShowWaterClock(){
|
|
// this.waterClockShow = !this.waterClockShow;
|
// if (this.waterClockShow) {
|
|
// //加载wfs服务
|
// if (window.sceneObj.wa != null) {
|
// window.sceneObj.waterClock.setVisibility(this.waterClockShow);
|
// } else {
|
// window.sceneObj.waterClock =this.createWFSLayer(
|
// "/gisserver/wfsserver/LC_JCSS_wfs", "LC_JCSS", "[NAME]");
|
// }
|
|
// } else {
|
|
// if (window.sceneObj.waterClock != null) {
|
// window.sceneObj.waterClock.setVisibility(this.waterClockShow);
|
// }
|
|
// }
|
// },
|
|
//加载图例数据
|
showLegend(parm) {
|
this.$refs.MainLegend.GetCurrentLegned(parm);
|
},
|
|
//点击事件
|
AddMXClick() {
|
this.handler && this.handler.destroy();
|
this.handler = new Cesium.ScreenSpaceEventHandler(
|
sgworld.Viewer.scene.canvas
|
);
|
let _that = this;
|
this.handler.setInputAction(function (event) {
|
var pickFeature = sgworld.Viewer.scene.pick(event.position);
|
if (pickFeature.id) {
|
if (pickFeature.id.properties.state == "QY") {
|
// console.log(pickFeature.id.properties);
|
_that.TYSHXYDM = pickFeature.id.properties._TYSHXYDM._value;
|
_that.JJ = pickFeature.id.properties._JJ._value;
|
_that.DZ = pickFeature.id.properties._DZ._value;
|
_that.NDYDL = pickFeature.id.properties._NDYDL._value;
|
_that.NDYSL = pickFeature.id.properties._NDYSL._value;
|
_that.SS = pickFeature.id.properties._SS._value;
|
_that.CZ = pickFeature.id.properties._CZ._value;
|
_that.FDDBR = pickFeature.id.properties._FDDBR._value;
|
_that.NAME = pickFeature.id.properties._NAME._value;
|
_that.dialogVisible1 = true;
|
} else {
|
let cpid = pickFeature.id.properties.corpId._value;
|
if (cpid != "" && cpid != undefined) {
|
_that.GetParent(cpid);
|
}
|
}
|
} else {
|
_that.dialogVisible1 = false;
|
}
|
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
},
|
GetParent(parm) {
|
this.$store.commit("savePath", parm);
|
},
|
closeDialog() {
|
this.dialogVisible1 = false;
|
},
|
|
//去除左击事件
|
DeleteClick() {
|
if (this.handler != null) {
|
this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
this.handler = null;
|
}
|
},
|
|
//添加图表的tooltip事件
|
AddToolTip() { },
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.container {
|
height: 100%;
|
width: 100%;
|
}
|
|
#sdkContainer {
|
width: 100%;
|
height: 100%;
|
}
|
|
.top {
|
position: absolute;
|
top: 0px;
|
left: 0;
|
height: 148px;
|
width: 100%;
|
}
|
|
.bottom {
|
position: absolute;
|
bottom: 0px;
|
left: 0px;
|
height: 220px;
|
width: 100%;
|
background: url(../../assets/image/Bottom/底部框.png);
|
background-repeat: no-repeat;
|
background-size: 100% 100%;
|
}
|
|
.left,
|
.Right {
|
position: absolute;
|
width: 1050px;
|
height: 100%;
|
background-color: transparent;
|
}
|
|
.left {
|
left: 0px;
|
top: 0px;
|
background: url(../../assets/image/Left/左侧背景.png);
|
background-repeat: no-repeat;
|
background-size: 100% 100%;
|
}
|
|
.Right {
|
right: 0px;
|
top: 0px;
|
background: url(../../assets/image/Right/右侧背景.png);
|
background-repeat: no-repeat;
|
background-size: 100% 100%;
|
}
|
|
.WRight {
|
z-index: 999;
|
position: absolute;
|
right: 0px;
|
top: 200px;
|
width: 4000px;
|
height: calc(100% - 340px);
|
// background-color: red;
|
}
|
|
.topSon {
|
height: 100%;
|
width: 100%;
|
}
|
|
.tool {
|
position: absolute;
|
width: 300px;
|
height: 500px;
|
right: 2050px;
|
top: 200px;
|
background-color: red;
|
}
|
|
@-webkit-keyframes rotation {
|
from {
|
-webkit-transform: rotate(0deg);
|
}
|
|
to {
|
-webkit-transform: rotate(360deg);
|
}
|
}
|
|
.switchBtnActive {
|
box-shadow: inset 0px -3px 7px 0px #ffbb00 !important;
|
background: linear-gradient(to bottom, #ffbb00 5%, #fbff00 100%) !important;
|
background-color: #ffbb00 !important;
|
color: #000 !important;
|
}
|
|
.switchMenuBtn b {
|
width: 30px;
|
height: 30px;
|
margin: 25px;
|
display: block;
|
background: url("../../assets/image/tool/cd.png");
|
background-size: 100% 100%;
|
transition: all 0.2s;
|
}
|
|
.switchMenuBtn span {
|
text-align: center;
|
color: #ffffffff;
|
overflow: hidden;
|
font-size: 20px;
|
display: block;
|
visibility: hidden;
|
margin-top: -40px;
|
}
|
|
.switchMenuBtn:hover b {
|
margin-top: 10px;
|
visibility: hidden;
|
}
|
|
.switchMenuBtn:hover span {
|
visibility: visible;
|
}
|
|
.switchMenuBtn {
|
width: 80px;
|
height: 80px;
|
}
|
|
.switchMenuBtnBack {
|
-webkit-transform: rotate(360deg);
|
animation: rotation 8s linear infinite;
|
-moz-animation: rotation 8s linear infinite;
|
-webkit-animation: rotation 8s linear infinite;
|
-o-animation: rotation 8s linear infinite;
|
position: absolute;
|
top: 0px;
|
left: 0px;
|
background: url(../../assets/image/tool/switch.png) no-repeat;
|
background-size: 100% 100%;
|
width: 80px;
|
height: 80px;
|
}
|
|
.switchMenuBtnBack:hover {
|
background: url(../../assets/image/tool/switch_h.png) no-repeat;
|
background-size: 100% 100%;
|
}
|
|
.switchMenu {
|
position: absolute;
|
top: 125px;
|
left: 925px;
|
z-index: 999;
|
font-size: 20px;
|
}
|
|
.switchBtn {
|
width: 80%;
|
text-align: center;
|
line-height: 30px;
|
height: 30px;
|
box-shadow: inset 0px -3px 7px 0px #0d659c;
|
background: linear-gradient(to bottom, #0d659c 5%, #023e72 100%);
|
background-color: #0d659c;
|
border-radius: 3px;
|
display: inline-block;
|
cursor: pointer;
|
color: #ffffff;
|
font-family: Arial;
|
font-size: 20px;
|
letter-spacing: 4px;
|
padding: 9px 23px;
|
text-decoration: none;
|
text-shadow: 0px 1px 0px #263666;
|
border-radius: 10px;
|
}
|
|
.switchBtn:hover {
|
background: linear-gradient(to bottom, #023e72 5%, #0d659c 100%);
|
background-color: #023e72;
|
}
|
|
.switchBtn:active {
|
position: relative;
|
top: 1px;
|
}
|
|
.switchMenu ul {
|
position: absolute;
|
top: 80px;
|
}
|
|
.switchMenu li {
|
height: 40px;
|
margin-top: 23px;
|
width: 150px;
|
}
|
|
// //图例
|
// .legend {
|
// height: 560px;
|
// width: 350px;
|
// position: absolute;
|
// right: 970px;
|
// bottom: 95px;
|
// border: solid 1px #2c559d;
|
// background-color: rgba(44, 85, 157, 0.5);
|
// }
|
//图例
|
.legend {
|
height: 560px;
|
width: 250px;
|
position: absolute;
|
right: 970px;
|
bottom: 95px;
|
border: solid 1px #2c559d;
|
background-color: rgba(44, 85, 157, 0.5);
|
border-radius: 10px;
|
padding: 20px;
|
}
|
|
.HGTitle {
|
background-image: url("../../assets/image/Left/EnterpriseOperation/x1.png");
|
background-size: 100% 100%;
|
background-repeat: no-repeat;
|
// background-color: rgba(11, 43, 82, 1);
|
|
/* 兼容IE */
|
margin: 0 !important;
|
position: absolute;
|
top: 50%;
|
left: 50%;
|
transform: translate(-50%, -50%);
|
height: 800px;
|
// width: 1500px;
|
width: 880px;
|
}
|
|
.height_box {
|
color: #ffffff;
|
font-size: 35px;
|
padding-left: 145px;
|
padding-top: 95px;
|
padding-bottom: 20px;
|
}
|
|
.dialogHG {
|
padding-left: 80px;
|
padding-right: 80px;
|
|
border-radius: 10px;
|
height: calc(100% - 200px);
|
width: 100%;
|
box-sizing: border-box;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
color: #ffffff;
|
font-size: 40px;
|
// letter-spacing: 2px;
|
overflow: auto;
|
// overflow-y: scroll;
|
|
.td1 {
|
height: 80px;
|
width: 100%;
|
font-size: 28px;
|
display: flex;
|
flex-direction: row;
|
border-bottom: solid 1px #fff;
|
margin-bottom: 10px;
|
// margin-top: 20px;
|
}
|
|
.span1 {
|
width: 20%;
|
height: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.span2 {
|
width: 100%;
|
height: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: flex-start;
|
}
|
|
.span3 {
|
display: inline-block;
|
width: 35%;
|
}
|
|
.span4 {
|
color: #e69303;
|
|
}
|
}
|
|
::-webkit-scrollbar {
|
width: 6px;
|
height: 6px;
|
background-color: #00000040;
|
}
|
|
::-webkit-scrollbar-thumb {
|
background-color: rgba(0, 0, 0, 1);
|
border-radius: 10px;
|
}
|
|
::-webkit-scrollbar-track {
|
background-color: transparent;
|
}
|
</style>
|