|
@@ -138,6 +138,8 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ GeoJsonLayerList: [],
|
|
|
+ liudongGntities: [],
|
|
|
sharedState: store.state,
|
|
|
isNightscaoe: false,
|
|
|
directionalLight_1: null,
|
|
@@ -226,14 +228,18 @@ export default {
|
|
|
this.hyp = new Cesium.HypsometricSetting();
|
|
|
this.startNight(false);
|
|
|
},
|
|
|
+
|
|
|
//夜景开关
|
|
|
startNight(isNight) {
|
|
|
+ let that = this;
|
|
|
scene.globe.show = true;
|
|
|
viewer.scene.hdrEnabled = isNight;
|
|
|
viewer.scene.bloomEffect.show = false;
|
|
|
|
|
|
// 是否开启夜景
|
|
|
if (!isNight) {
|
|
|
+ scene.layers.find("白天").visible = true;
|
|
|
+ scene.layers.find("夜晚").visible = false;
|
|
|
scene.sun.show = true;
|
|
|
this.clearLightSource(true, true);
|
|
|
|
|
@@ -243,8 +249,162 @@ export default {
|
|
|
this.setHypsometric(false); //夜景材质
|
|
|
viewer.imageryLayers.remove(this.imageLayer);
|
|
|
} else {
|
|
|
- this.switchLight(false);
|
|
|
scene.sun.show = false;
|
|
|
+ scene.layers.find("白天").visible = false;
|
|
|
+ scene.layers.find("夜晚").visible = true;
|
|
|
+ // 泛光线底纹
|
|
|
+ let roadLine1 = Cesium.GeoJsonDataSource.load("static/data/fg.json");
|
|
|
+
|
|
|
+ roadLine1
|
|
|
+ .then(function (dataSource) {
|
|
|
+ viewer.dataSources.add(dataSource);
|
|
|
+ that.GeoJsonLayerList.push(dataSource);
|
|
|
+ let lines_1 = dataSource.entities.values;
|
|
|
+ for (let i = 0; i < lines_1.length; i++) {
|
|
|
+ let line = lines_1[i];
|
|
|
+ line.polyline.material = new Cesium.PolylineGlowMaterialProperty({
|
|
|
+ //设置Glow材质
|
|
|
+ glowPower: 0.005,
|
|
|
+ color: Cesium.Color.ORANGE.withAlpha(0.9),
|
|
|
+ });
|
|
|
+ line.polyline.width = 50;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .otherwise(function (error) {
|
|
|
+ window.alert(error);
|
|
|
+ });
|
|
|
+ let roadLine2 = Cesium.GeoJsonDataSource.load("static/data/fg.json");
|
|
|
+ //泛光亮线
|
|
|
+ roadLine2
|
|
|
+ .then(function (dataSource) {
|
|
|
+ viewer.dataSources.add(dataSource);
|
|
|
+ that.GeoJsonLayerList.push(dataSource);
|
|
|
+ let lines_1 = dataSource.entities.values;
|
|
|
+ for (let i = 0; i < lines_1.length; i++) {
|
|
|
+ let line = lines_1[i];
|
|
|
+ line.polyline.material = new Cesium.PolylineGlowMaterialProperty({
|
|
|
+ //设置Glow材质
|
|
|
+ glowPower: 0.001,
|
|
|
+ color: Cesium.Color.white,
|
|
|
+ });
|
|
|
+ line.polyline.width = 5;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .otherwise(function (error) {
|
|
|
+ window.alert(error);
|
|
|
+ });
|
|
|
+
|
|
|
+ //一山湖灯光
|
|
|
+ Cesium.loadJson("static/data/lightPoint3D.json").then((response) => {
|
|
|
+ let features = response.features;
|
|
|
+ features.forEach((element) => {
|
|
|
+ let p = element.geometry.coordinates;
|
|
|
+ var SpotLightPos3 = new Cesium.Cartesian3.fromDegrees(
|
|
|
+ p[0],
|
|
|
+ p[1],
|
|
|
+ p[2] + 20
|
|
|
+ );
|
|
|
+ var SpotLightPos32 = new Cesium.Cartesian3.fromDegrees(
|
|
|
+ p[0],
|
|
|
+ p[1],
|
|
|
+ p[2]
|
|
|
+ );
|
|
|
+ var SpotLightOptions3 = {
|
|
|
+ cutoffDistance: 50,
|
|
|
+ color: Cesium.Color.ORANGE,
|
|
|
+ decay: 1,
|
|
|
+ intensity: 2,
|
|
|
+ };
|
|
|
+
|
|
|
+ let SpotLight33 = new Cesium.PointLight(
|
|
|
+ SpotLightPos3,
|
|
|
+ // SpotLightPos32,
|
|
|
+ SpotLightOptions3
|
|
|
+ );
|
|
|
+ scene.addLightSource(SpotLight33);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 体育场灯光
|
|
|
+ Cesium.loadJson("static/data/bpLight.json").then((response) => {
|
|
|
+ let features = response.features;
|
|
|
+ features.forEach((element) => {
|
|
|
+ let p = element.geometry.coordinates;
|
|
|
+ var SpotLightPos3 = new Cesium.Cartesian3.fromDegrees(
|
|
|
+ p[0],
|
|
|
+ p[1],
|
|
|
+ p[2] + 10
|
|
|
+ );
|
|
|
+
|
|
|
+ var SpotLightOptions3 = {
|
|
|
+ cutoffDistance: 150,
|
|
|
+ color: new Cesium.Color(245 / 255, 250 / 255, 216 / 255, 0.51),
|
|
|
+ decay: 1,
|
|
|
+ intensity: 1,
|
|
|
+ };
|
|
|
+
|
|
|
+ let SpotLight33 = new Cesium.PointLight(
|
|
|
+ SpotLightPos3,
|
|
|
+ // SpotLightPos32,
|
|
|
+ SpotLightOptions3
|
|
|
+ );
|
|
|
+ scene.addLightSource(SpotLight33);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // // 道路灯光
|
|
|
+ Cesium.loadJson("static/data/New_Point3D.json").then((response) => {
|
|
|
+ let features = response.features;
|
|
|
+ features.forEach((element) => {
|
|
|
+ let p = element.geometry.coordinates;
|
|
|
+ var SpotLightPos3 = new Cesium.Cartesian3.fromDegrees(
|
|
|
+ p[0],
|
|
|
+ p[1],
|
|
|
+ p[2] + 20
|
|
|
+ );
|
|
|
+ var SpotLightOptions3 = {
|
|
|
+ cutoffDistance: 130,
|
|
|
+ color: new Cesium.Color(209 / 255, 209 / 255, 147 / 255, 0.5),
|
|
|
+ decay: 1,
|
|
|
+ intensity: 1,
|
|
|
+ };
|
|
|
+
|
|
|
+ let SpotLight33 = new Cesium.PointLight(
|
|
|
+ SpotLightPos3,
|
|
|
+ // SpotLightPos32,
|
|
|
+ SpotLightOptions3
|
|
|
+ );
|
|
|
+ scene.addLightSource(SpotLight33);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // 草坪灯光
|
|
|
+ Cesium.loadJson("static/data/BPGYLight.json").then((response) => {
|
|
|
+ let features = response.features;
|
|
|
+ features.forEach((element) => {
|
|
|
+ let p = element.geometry.coordinates;
|
|
|
+ var SpotLightPos3 = new Cesium.Cartesian3.fromDegrees(
|
|
|
+ p[0],
|
|
|
+ p[1],
|
|
|
+ p[2] + 20
|
|
|
+ );
|
|
|
+
|
|
|
+ var SpotLightOptions3 = {
|
|
|
+ cutoffDistance: 90,
|
|
|
+ color: new Cesium.Color(209 / 255, 209 / 255, 147 / 255, 1),
|
|
|
+ decay: 1,
|
|
|
+ intensity: 1,
|
|
|
+ };
|
|
|
+
|
|
|
+ let SpotLight33 = new Cesium.PointLight(
|
|
|
+ SpotLightPos3,
|
|
|
+ // SpotLightPos32,
|
|
|
+ SpotLightOptions3
|
|
|
+ );
|
|
|
+ scene.addLightSource(SpotLight33);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ this.loadldx();
|
|
|
+ this.switchLight(false);
|
|
|
scene.skyAtmosphere.show = false;
|
|
|
|
|
|
this.setHypsometric(true); //夜景
|
|
@@ -254,6 +414,7 @@ export default {
|
|
|
})
|
|
|
);
|
|
|
this.imageLayer.alpha = 0.8;
|
|
|
+
|
|
|
this.gyTableData.forEach((element) => {
|
|
|
this.addLightSource(element);
|
|
|
});
|
|
@@ -271,110 +432,96 @@ export default {
|
|
|
1
|
|
|
);
|
|
|
} else {
|
|
|
- // //设置环境光(夜晚)
|
|
|
- // scene.lightSource.ambientLightColor = new Cesium.Color(
|
|
|
- // 0.15,
|
|
|
- // 0.15,
|
|
|
- // 0.15,
|
|
|
- // 1
|
|
|
- // );
|
|
|
-
|
|
|
- // // 添加光源
|
|
|
- // let gyData1 = {
|
|
|
- // gyType: "点光源",
|
|
|
- // cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
- // 109.49115721355469,
|
|
|
- // 18.29592136116859,
|
|
|
- // 80
|
|
|
- // ),
|
|
|
- // gyDecay: 1,
|
|
|
- // gyDistance: 800,
|
|
|
- // gyColor: "rgba(255,20,147,0.37)",
|
|
|
- // gyIntensity: 2,
|
|
|
- // };
|
|
|
- // this.addLightSource(gyData1);
|
|
|
+ //设置环境光(夜晚)
|
|
|
+ // scene.lightSource.ambientLightColor = new Cesium.Color(0.3, 0.3, 0.3, 1);
|
|
|
+ // 添加光源
|
|
|
|
|
|
- // //主建筑光源
|
|
|
- // let gyData2 = {
|
|
|
+ // this.addLightSource({
|
|
|
// gyType: "点光源",
|
|
|
// cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
- // 109.55348802331464,
|
|
|
- // 18.278824564764143,
|
|
|
- // 80
|
|
|
+ // 109.51762123055649,
|
|
|
+ // 18.308419781897452,
|
|
|
+ // 20.784050116021502
|
|
|
// ),
|
|
|
- // gyDecay: 1,
|
|
|
- // gyDistance: 800,
|
|
|
- // gyColor: "rgba(240,248,255,1)",
|
|
|
- // gyIntensity: 1,
|
|
|
- // };
|
|
|
- // this.addLightSource(gyData2);
|
|
|
- // let gyData3 = {
|
|
|
+ // gyDecay: 5,
|
|
|
+ // gyDistance: 300,
|
|
|
+ // gyColor: "rgba(255,255,255,1)",
|
|
|
+ // gyIntensity: 5,
|
|
|
+ // });
|
|
|
+ // this.addLightSource({
|
|
|
// gyType: "点光源",
|
|
|
// cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
- // 109.54991809813524,
|
|
|
- // 18.28458792962873,
|
|
|
- // 80
|
|
|
+ // 109.51604504373526,
|
|
|
+ // 18.30819674716975,
|
|
|
+ // 15.12013402227458
|
|
|
// ),
|
|
|
// gyDecay: 1,
|
|
|
- // gyDistance: 800,
|
|
|
- // gyColor: "rgba(240,248,255,1)",
|
|
|
- // gyIntensity: 1,
|
|
|
- // };
|
|
|
- // this.addLightSource(gyData3);
|
|
|
-
|
|
|
- // let gyData4 = {
|
|
|
+ // gyDistance: 200,
|
|
|
+ // gyColor: "rgba(255,255,255,1)",
|
|
|
+ // gyIntensity: 2,
|
|
|
+ // });
|
|
|
+ // this.addLightSource({
|
|
|
// gyType: "点光源",
|
|
|
// cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
- // 109.5490688547866,
|
|
|
- // 18.283227701313386,
|
|
|
- // 40
|
|
|
+ // 109.51119765783854,
|
|
|
+ // 18.311007882958762,
|
|
|
+ // 15.514382420330742
|
|
|
// ),
|
|
|
- // gyDecay: 2,
|
|
|
- // gyDistance: 80,
|
|
|
- // gyColor: "rgba(13,128,247,0.15)",
|
|
|
- // gyIntensity: 0.5,
|
|
|
- // };
|
|
|
- // this.addLightSource(gyData4);
|
|
|
- // let gyData5 = {
|
|
|
+ // gyDecay: 1,
|
|
|
+ // gyDistance: 200,
|
|
|
+ // gyColor: "rgba(255,255,255,1)",
|
|
|
+ // gyIntensity: 2,
|
|
|
+ // });
|
|
|
+ // this.addLightSource({
|
|
|
// gyType: "点光源",
|
|
|
// cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
- // 109.55236475164054,
|
|
|
- // 18.278884181031398,
|
|
|
- // 40
|
|
|
+ // 109.5109719906024,
|
|
|
+ // 18.312138464239744,
|
|
|
+ // 15.514382420330742
|
|
|
// ),
|
|
|
- // gyDecay: 2,
|
|
|
- // gyDistance: 80,
|
|
|
- // gyColor: "rgba(13,128,247,0.15)",
|
|
|
- // gyIntensity: 0.5,
|
|
|
- // };
|
|
|
- // this.addLightSource(gyData5);
|
|
|
- // let gyData6 = {
|
|
|
+ // gyDecay: 1,
|
|
|
+ // gyDistance: 200,
|
|
|
+ // gyColor: "rgba(255,255,255,1)",
|
|
|
+ // gyIntensity: 2,
|
|
|
+ // });
|
|
|
+ // this.addLightSource({
|
|
|
// gyType: "点光源",
|
|
|
// cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
- // 109.55195212379788,
|
|
|
- // 18.283303465199854,
|
|
|
- // 40
|
|
|
+ // 109.5155257151904,
|
|
|
+ // 18.312710967602822,
|
|
|
+ // 15.0056539031313925
|
|
|
// ),
|
|
|
- // gyDecay: 2,
|
|
|
- // gyDistance: 80,
|
|
|
- // gyColor: "rgba(13,128,247,0.15)",
|
|
|
- // gyIntensity: 0.5,
|
|
|
- // };
|
|
|
- // this.addLightSource(gyData6);
|
|
|
- // let gyData7 = {
|
|
|
+ // gyDecay: 1,
|
|
|
+ // gyDistance: 200,
|
|
|
+ // gyColor: "rgba(255,255,255,1)",
|
|
|
+ // gyIntensity: 2,
|
|
|
+ // });
|
|
|
+ // this.addLightSource({
|
|
|
// gyType: "点光源",
|
|
|
// cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
- // 109.55549715519659,
|
|
|
- // 18.279573531714174,
|
|
|
- // 40
|
|
|
+ // 109.51794125594411,
|
|
|
+ // 18.310599330540743,
|
|
|
+ // 14.172257598338254
|
|
|
// ),
|
|
|
- // gyDecay: 2,
|
|
|
- // gyDistance: 80,
|
|
|
- // gyColor: "rgba(13,128,247,0.15)",
|
|
|
- // gyIntensity: 0.5,
|
|
|
- // };
|
|
|
- // this.addLightSource(gyData7);
|
|
|
- // 添加光源
|
|
|
+ // gyDecay: 1,
|
|
|
+ // gyDistance: 200,
|
|
|
+ // gyColor: "rgba(255,255,255,1)",
|
|
|
+ // gyIntensity: 2,
|
|
|
+ // });
|
|
|
+ //操场光源
|
|
|
+ this.addLightSource({
|
|
|
+ gyType: "点光源",
|
|
|
+ cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
+ 109.51144104226398,
|
|
|
+ 18.311654492261003,
|
|
|
+ 24.172257598338254
|
|
|
+ ),
|
|
|
+ gyDecay: 2,
|
|
|
+ gyDistance: 200,
|
|
|
+ gyColor: "rgba(255,255,255,1)",
|
|
|
+ gyIntensity: 2,
|
|
|
+ });
|
|
|
+
|
|
|
// 新增直射光1--西南侧光
|
|
|
var position = new Cesium.Cartesian3.fromDegrees(
|
|
|
108.64028472779978,
|
|
@@ -535,6 +682,352 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 流动线
|
|
|
+ */
|
|
|
+ loadldx() {
|
|
|
+ let that = this;
|
|
|
+ Cesium.loadJson("static/data/道路中线_1.json").then((jsonData) => {
|
|
|
+ debugger;
|
|
|
+ jsonData.features.forEach((route) => {
|
|
|
+ let list = route.geometry.coordinates.flat(Infinity);
|
|
|
+
|
|
|
+ let dl = viewer.entities.add({
|
|
|
+ // 用于打底的线
|
|
|
+ polyline: {
|
|
|
+ positions: Cesium.Cartesian3.fromDegreesArrayHeights(list),
|
|
|
+ width: 5, // 线的宽度,像素为单位
|
|
|
+ material: Cesium.Color.BLACK.withAlpha(0.3),
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.liudongGntities.push(dl);
|
|
|
+ let dls = viewer.entities.add({
|
|
|
+ id: route.properties.OBJECTID,
|
|
|
+ polyline: {
|
|
|
+ positions: Cesium.Cartesian3.fromDegreesArrayHeights(list),
|
|
|
+ width: 4.0,
|
|
|
+ material: new Cesium.PolylineTrailMaterialProperty({
|
|
|
+ outlineColor: Cesium.Color.WHITE,
|
|
|
+ outlineWidth: 3,
|
|
|
+ color: Cesium.Color.fromCssColorString("rgba(127, 255, 0, 1)"),
|
|
|
+ trailLength: 0.3,
|
|
|
+ period: 4.0,
|
|
|
+ }),
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.liudongGntities.push(dls);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // //夜景开关
|
|
|
+ // startNight(isNight) {
|
|
|
+ // scene.globe.show = true;
|
|
|
+ // viewer.scene.hdrEnabled = isNight;
|
|
|
+ // viewer.scene.bloomEffect.show = false;
|
|
|
+
|
|
|
+ // // 是否开启夜景
|
|
|
+ // if (!isNight) {
|
|
|
+ // scene.sun.show = true;
|
|
|
+ // this.clearLightSource(true, true);
|
|
|
+
|
|
|
+ // scene.skyAtmosphere.show = true;
|
|
|
+
|
|
|
+ // this.switchLight(true); //白天
|
|
|
+ // this.setHypsometric(false); //夜景材质
|
|
|
+ // viewer.imageryLayers.remove(this.imageLayer);
|
|
|
+ // } else {
|
|
|
+ // this.switchLight(false);
|
|
|
+ // scene.sun.show = false;
|
|
|
+ // scene.skyAtmosphere.show = false;
|
|
|
+
|
|
|
+ // this.setHypsometric(true); //夜景
|
|
|
+ // this.imageLayer = viewer.imageryLayers.addImageryProvider(
|
|
|
+ // new Cesium.SingleTileImageryProvider({
|
|
|
+ // url: "static/images/zt/Nightscape/BlackMarble_2016-1.jpg",
|
|
|
+ // })
|
|
|
+ // );
|
|
|
+ // this.imageLayer.alpha = 0.8;
|
|
|
+ // this.gyTableData.forEach((element) => {
|
|
|
+ // this.addLightSource(element);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+
|
|
|
+ // //设置环境光
|
|
|
+ // switchLight(isDayLight) {
|
|
|
+ // if (isDayLight) {
|
|
|
+ // //设置环境光(白天)
|
|
|
+ // scene.lightSource.ambientLightColor = new Cesium.Color(
|
|
|
+ // 0.65,
|
|
|
+ // 0.65,
|
|
|
+ // 0.65,
|
|
|
+ // 1
|
|
|
+ // );
|
|
|
+ // } else {
|
|
|
+ // // //设置环境光(夜晚)
|
|
|
+ // // scene.lightSource.ambientLightColor = new Cesium.Color(
|
|
|
+ // // 0.15,
|
|
|
+ // // 0.15,
|
|
|
+ // // 0.15,
|
|
|
+ // // 1
|
|
|
+ // // );
|
|
|
+
|
|
|
+ // // // 添加光源
|
|
|
+ // // let gyData1 = {
|
|
|
+ // // gyType: "点光源",
|
|
|
+ // // cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // // 109.49115721355469,
|
|
|
+ // // 18.29592136116859,
|
|
|
+ // // 80
|
|
|
+ // // ),
|
|
|
+ // // gyDecay: 1,
|
|
|
+ // // gyDistance: 800,
|
|
|
+ // // gyColor: "rgba(255,20,147,0.37)",
|
|
|
+ // // gyIntensity: 2,
|
|
|
+ // // };
|
|
|
+ // // this.addLightSource(gyData1);
|
|
|
+
|
|
|
+ // // //主建筑光源
|
|
|
+ // // let gyData2 = {
|
|
|
+ // // gyType: "点光源",
|
|
|
+ // // cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // // 109.55348802331464,
|
|
|
+ // // 18.278824564764143,
|
|
|
+ // // 80
|
|
|
+ // // ),
|
|
|
+ // // gyDecay: 1,
|
|
|
+ // // gyDistance: 800,
|
|
|
+ // // gyColor: "rgba(240,248,255,1)",
|
|
|
+ // // gyIntensity: 1,
|
|
|
+ // // };
|
|
|
+ // // this.addLightSource(gyData2);
|
|
|
+ // // let gyData3 = {
|
|
|
+ // // gyType: "点光源",
|
|
|
+ // // cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // // 109.54991809813524,
|
|
|
+ // // 18.28458792962873,
|
|
|
+ // // 80
|
|
|
+ // // ),
|
|
|
+ // // gyDecay: 1,
|
|
|
+ // // gyDistance: 800,
|
|
|
+ // // gyColor: "rgba(240,248,255,1)",
|
|
|
+ // // gyIntensity: 1,
|
|
|
+ // // };
|
|
|
+ // // this.addLightSource(gyData3);
|
|
|
+
|
|
|
+ // // let gyData4 = {
|
|
|
+ // // gyType: "点光源",
|
|
|
+ // // cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // // 109.5490688547866,
|
|
|
+ // // 18.283227701313386,
|
|
|
+ // // 40
|
|
|
+ // // ),
|
|
|
+ // // gyDecay: 2,
|
|
|
+ // // gyDistance: 80,
|
|
|
+ // // gyColor: "rgba(13,128,247,0.15)",
|
|
|
+ // // gyIntensity: 0.5,
|
|
|
+ // // };
|
|
|
+ // // this.addLightSource(gyData4);
|
|
|
+ // // let gyData5 = {
|
|
|
+ // // gyType: "点光源",
|
|
|
+ // // cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // // 109.55236475164054,
|
|
|
+ // // 18.278884181031398,
|
|
|
+ // // 40
|
|
|
+ // // ),
|
|
|
+ // // gyDecay: 2,
|
|
|
+ // // gyDistance: 80,
|
|
|
+ // // gyColor: "rgba(13,128,247,0.15)",
|
|
|
+ // // gyIntensity: 0.5,
|
|
|
+ // // };
|
|
|
+ // // this.addLightSource(gyData5);
|
|
|
+ // // let gyData6 = {
|
|
|
+ // // gyType: "点光源",
|
|
|
+ // // cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // // 109.55195212379788,
|
|
|
+ // // 18.283303465199854,
|
|
|
+ // // 40
|
|
|
+ // // ),
|
|
|
+ // // gyDecay: 2,
|
|
|
+ // // gyDistance: 80,
|
|
|
+ // // gyColor: "rgba(13,128,247,0.15)",
|
|
|
+ // // gyIntensity: 0.5,
|
|
|
+ // // };
|
|
|
+ // // this.addLightSource(gyData6);
|
|
|
+ // // let gyData7 = {
|
|
|
+ // // gyType: "点光源",
|
|
|
+ // // cartesian: new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // // 109.55549715519659,
|
|
|
+ // // 18.279573531714174,
|
|
|
+ // // 40
|
|
|
+ // // ),
|
|
|
+ // // gyDecay: 2,
|
|
|
+ // // gyDistance: 80,
|
|
|
+ // // gyColor: "rgba(13,128,247,0.15)",
|
|
|
+ // // gyIntensity: 0.5,
|
|
|
+ // // };
|
|
|
+ // // this.addLightSource(gyData7);
|
|
|
+ // // 添加光源
|
|
|
+ // // 新增直射光1--西南侧光
|
|
|
+ // var position = new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // 108.64028472779978,
|
|
|
+ // 17.253899597841926,
|
|
|
+ // 10
|
|
|
+ // );
|
|
|
+ // var targetPosition1 = new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // 108.98714556856183,
|
|
|
+ // 17.660729210061046,
|
|
|
+ // 10
|
|
|
+ // );
|
|
|
+ // var dirLightOptions = {
|
|
|
+ // targetPosition: targetPosition1,
|
|
|
+ // color: new Cesium.Color(220 / 255, 230 / 255, 240 / 255, 0.5),
|
|
|
+ // intensity: 1,
|
|
|
+ // };
|
|
|
+ // this.directionalLight_1 &&
|
|
|
+ // scene.removeLightSource(this.directionalLight_1);
|
|
|
+ // this.directionalLight_1 = new Cesium.DirectionalLight(
|
|
|
+ // position,
|
|
|
+ // dirLightOptions
|
|
|
+ // );
|
|
|
+ // scene.addLightSource(this.directionalLight_1);
|
|
|
+
|
|
|
+ // //新增直射光1--东北侧光
|
|
|
+ // var position3 = new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // 110.1833740842942,
|
|
|
+ // 19.23480287256715,
|
|
|
+ // 10
|
|
|
+ // );
|
|
|
+ // var targetPosition3 = new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // 109.92243671490641,
|
|
|
+ // 18.823627245617516,
|
|
|
+ // 10
|
|
|
+ // );
|
|
|
+ // var dirLightOptions3 = {
|
|
|
+ // targetPosition: targetPosition3,
|
|
|
+ // color: new Cesium.Color(220 / 255, 223 / 255, 227 / 255, 0.5),
|
|
|
+ // intensity: 1.5,
|
|
|
+ // };
|
|
|
+ // this.directionalLight_3 &&
|
|
|
+ // scene.removeLightSource(this.directionalLight_3);
|
|
|
+ // this.directionalLight_3 = new Cesium.DirectionalLight(
|
|
|
+ // position3,
|
|
|
+ // dirLightOptions3
|
|
|
+ // );
|
|
|
+ // scene.addLightSource(this.directionalLight_3);
|
|
|
+ // //新增直射光1--顶光
|
|
|
+ // var position4 = new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // 109.5264539133307,
|
|
|
+ // 18.2736162462657,
|
|
|
+ // 500
|
|
|
+ // );
|
|
|
+ // var targetPosition4 = new Cesium.Cartesian3.fromDegrees(
|
|
|
+ // 109.5264539133307,
|
|
|
+ // 18.2736162462657,
|
|
|
+ // 400
|
|
|
+ // );
|
|
|
+ // var dirLightOptions4 = {
|
|
|
+ // targetPosition: targetPosition4,
|
|
|
+
|
|
|
+ // color: Cesium.Color.SILVER.withAlpha(0.5),
|
|
|
+ // intensity: 0.1,
|
|
|
+ // };
|
|
|
+ // this.directionalLight_4 &&
|
|
|
+ // scene.removeLightSource(this.directionalLight_4);
|
|
|
+ // this.directionalLight_4 = new Cesium.DirectionalLight(
|
|
|
+ // position4,
|
|
|
+ // dirLightOptions4
|
|
|
+ // );
|
|
|
+ // scene.addLightSource(this.directionalLight_4);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // //设置白膜自发光纹理
|
|
|
+ // setHypsometric(isShow = true) {
|
|
|
+ // if (isShow) {
|
|
|
+ // scene.layers.layerQueue.forEach((layer) => {
|
|
|
+ // let hyp = null;
|
|
|
+ // let LayerName = window.NightViewLayerName.find(
|
|
|
+ // (c) => c == layer.name
|
|
|
+ // );
|
|
|
+ // if (LayerName) {
|
|
|
+ // // 关掉边框线
|
|
|
+ // layer.style3D.fillStyle = Cesium.FillStyle.Fill;
|
|
|
+ // hyp = new Cesium.HypsometricSetting();
|
|
|
+ // hyp.emissionTextureArray = [
|
|
|
+ // {
|
|
|
+ // url: "static/images/zt/Nightscape/Texture05.jpg",
|
|
|
+ // USpeed: 0.5,
|
|
|
+ // VSpeed: 0,
|
|
|
+ // UTiling: 1,
|
|
|
+ // VTiling: 1,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // url: "static/images/zt/Nightscape/Texture01.jpg",
|
|
|
+ // USpeed: 0.5,
|
|
|
+ // VSpeed: 0,
|
|
|
+ // UTiling: 1,
|
|
|
+ // VTiling: 1,
|
|
|
+ // },
|
|
|
+
|
|
|
+ // {
|
|
|
+ // url: "static/images/zt/Nightscape/build008.JPG",
|
|
|
+ // USpeed: 0,
|
|
|
+ // VSpeed: 0,
|
|
|
+ // UTiling: 1,
|
|
|
+ // VTiling: 3,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // url: "static/images/zt/Nightscape/build129.JPG",
|
|
|
+ // USpeed: 0,
|
|
|
+ // VSpeed: 0,
|
|
|
+ // UTiling: 1,
|
|
|
+ // VTiling: 3,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // url: "static/images/zt/Nightscape/build216.JPG",
|
|
|
+ // USpeed: 0,
|
|
|
+ // VSpeed: 0,
|
|
|
+ // UTiling: 1,
|
|
|
+ // VTiling: 3,
|
|
|
+ // },
|
|
|
+ // // {
|
|
|
+ // // url: "static/images/zt/Nightscape/HighRiseNight0008_4_S.jpg",
|
|
|
+ // // USpeed: 0,
|
|
|
+ // // VSpeed: 0,
|
|
|
+ // // UTiling: 1,
|
|
|
+ // // VTiling: 1,
|
|
|
+ // // },
|
|
|
+ // // {
|
|
|
+ // // url: "static/images/zt/Nightscape/HighRiseNight0016_3_L.jpg",
|
|
|
+ // // USpeed: 0,
|
|
|
+ // // VSpeed: 0,
|
|
|
+ // // UTiling: 1,
|
|
|
+ // // VTiling: 1,
|
|
|
+ // // },
|
|
|
+ // // {
|
|
|
+ // // url: "static/images/zt/Nightscape/HighRiseNight0020_L.jpg",
|
|
|
+ // // USpeed: 0,
|
|
|
+ // // VSpeed: 0,
|
|
|
+ // // UTiling: 1,
|
|
|
+ // // VTiling: 1,
|
|
|
+ // // },
|
|
|
+ // ];
|
|
|
+ // layer.hypsometricSetting = {
|
|
|
+ // hypsometricSetting: hyp,
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // scene.layers.layerQueue.forEach((layer) => {
|
|
|
+ // layer.hypsometricSetting = {
|
|
|
+ // hypsometricSetting: undefined,
|
|
|
+ // };
|
|
|
+ // layer.style3D.fillStyle = Cesium.FillStyle.Fill;
|
|
|
+ // // 刷新场景
|
|
|
+ // // layer.refresh();
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // },
|
|
|
|
|
|
//提交光源数据
|
|
|
onSubmit() {
|
|
@@ -918,6 +1411,12 @@ export default {
|
|
|
while (scene.lightSource.directionalLight.values.length > 0) {
|
|
|
scene.removeLightSource(scene.lightSource.directionalLight.values[0]);
|
|
|
}
|
|
|
+ this.GeoJsonLayerList.forEach((element) => {
|
|
|
+ viewer.dataSources.remove(element);
|
|
|
+ });
|
|
|
+ this.liudongGntities.forEach((element) => {
|
|
|
+ viewer.entities.remove(element);
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
cartesianToWgs84(x, y, z) {
|