0527650f by jikai

111111

1 parent 18a74691
......@@ -71,13 +71,12 @@
<horizon @closePop='closePop'></horizon>
</div>
<div class="allSee tjx-anslysis" v-if='tjxAnslysis'>
<tjxAnslysis @closePop='closePop'></tjxAnslysis>
<div class="allSee" v-if='visualField'>
<visualField @closePop='closePop'></visualField>
</div>
<div class="allSee tjx-anslysis" v-if='visualField'>
<visualField @closePop='closePop'></visualField>
<div class="allSee" v-if='tjxAnslysis'>
<tjxAnslysis @closePop='closePop'></tjxAnslysis>
</div>
<div class="allSee" v-if='yyAnslysis'>
......@@ -93,8 +92,6 @@
<div id="horizontal-slider" style="display: none;"></div>
</div>
<!-- <div id="split_up" style="display: none;"></div>
<div id="split_bottom" style="display: none;"></div>
<div id="split_left" style="display: none;"></div>
......@@ -127,9 +124,9 @@
import objectManage from '../assets/js/map/maputils';
import createDraw from '../assets/js/map/createDraw';
import roller from "../assets/js/map/roller";
import flood from "../assets/js/map/flood";
import viewpoint from "../assets/js/map/viewpoint";
import visual from "../assets/js/map/visual";
// import flood from "../assets/js/map/flood";
// import viewpoint from "../assets/js/map/viewpoint";
// import visual from "../assets/js/map/visual";
import TopTitle from '../components/topTitle';
......@@ -145,9 +142,10 @@
import tjxAnslysis from '../components/tjxAnslysis'; // 天际线分析
import yyAnslysis from '../components/yyAnslysis'; // 阴影分析
import kgAnalusis from '../components/kgAnalusis'; // 控高分析
import visualField from '../components/visualField' //可视域分析
import URL_CONFIG from "./../config/urlConfig.vue";
const Cesium = window.Cesium;
import visualField from '../components/visualField' //可视域分析
export default {
components: {
......@@ -161,8 +159,8 @@
allSee,
ymAnslysis,
horizon,
tjxAnslysis,
visualField,
tjxAnslysis,
yyAnslysis,
kgAnalusis,
},
......@@ -192,21 +190,21 @@
keepArr: ['isReturn', 'enlarge', 'narrow', 'coordinate', 'distance',
'area', 'marker', 'rollerShutter', 'splitScreen', 'toNorth',
'topSee', 'roundSee', 'horizon', 'allSee', 'ymAnslysis',
'tjxAnslysis', 'yyAnslysis', 'kgAnalusis', 'visualField']
'tjxAnslysis', 'yyAnslysis', 'visualField', 'kgAnalusis']
}
},
mounted() {
this.viewer = new Cesium.Viewer('cesiumContainer');
this.viewer = new Cesium.Viewer('cesiumContainer', {shadows : true});
this.viewer.imageryLayers.addImageryProvider(new Cesium.TiandituImageryProvider({
credit : new Cesium.Credit('天地图全球影像服务'),
token: URL_CONFIG.TOKEN_TIANDITU
}));
let scene = this.viewer.scene
scene.shadowMap.darkness = 1.275; //设置第二重烘焙纹理的效果(明暗程度)
scene.shadowMap.darkness = 1; //设置第二重烘焙纹理的效果(明暗程度)
scene.skyAtmosphere.brightnessShift=0.4;
scene.debugShowFramesPerSecond = true;
scene.hdrEnabled = false;
scene.sun.show = false;
scene.sun.show = true;
this.draw = new createDraw(this.viewer);
Cesium.when.all([
scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_GROUND1, {
......@@ -215,9 +213,13 @@
scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_BUILD, {
name: 'build'
})
], layer => {
], layers => {
// this.layers = layer;
objectManage.viewer = this.viewer;
layers[0].selectEnabled = false;
layers[1].selectEnabled = false;
layers[0].shadowType = 2;
layers[1].shadowType = 2;
scene.camera.setView({
destination : Cesium.Cartesian3.fromDegrees(116.44621857300415, 39.899281526734555, 216.7793905027196),
orientation : {
......@@ -308,93 +310,7 @@
,EtopSee() {}
// 环视
,EroundSee() {
// var parentEntity = this.viewer.entities.add(new Cesium.Entity()), positions = [], cartesian, polyline;
// this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)
// this.handler.setInputAction(evt => {
// cartesian = this.viewer.scene.pickPosition(evt.position);
// // cartesian = this.draw.getCatesian3FromPX(evt.position, this.viewer, []);
// positions.push(cartesian.clone());
// // addCompany.createPoint.call(this, {position: cartesian})
// if(positions.length === 1) {
// this.handler.setInputAction(moveEvent => {
// positions[1] = this.viewer.scene.pickPosition(moveEvent.endPosition);
// // positions[1] = this.draw.getCatesian3FromPX(moveEvent.endPosition, this.viewer, []);
// !polyline && (polyline = addCompany.createPolyline.call(this, positions));
// }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
// return;
// }
// this.handler.destroy();
// // console.log(Cesium.Cartesian3.distance(positions[0], positions[1]));
// // var cartesian = this.draw.getCatesian3FromPX(evt.position, this.viewer, []);
// var viewPointEntity = this.viewer.entities.add({
// parent: parentEntity,
// position: positions[0],
// ellipsoid: {
// radii: new Cesium.Cartesian3(5, 5, 5),
// material: Cesium.Color.GREEN
// }
// });
// // // 世界坐标转换为投影坐标
// var webMercatorProjection = new Cesium.WebMercatorProjection(this.viewer.scene.globe.ellipsoid);
// var viewPointWebMercator = webMercatorProjection.project(Cesium.Cartographic.fromCartesian(positions[0]));
// // // 排除碰撞监测的对象
// var objectsToExclude = [viewPointEntity];
// // 目标点集合
// var destPoints = [];
// // 视域点和目标点的距离
// var radius = Cesium.Cartesian3.distance(positions[0], positions[1]); // 视距1000米
// // 计算一圈
// for (var i = 0; i <= 30; i++) {
// // 度数转弧度
// var radians = Cesium.Math.toRadians(i);
// // 计算目标点
// var toPoint = new Cesium.Cartesian3(viewPointWebMercator.x + radius * Math.cos(radians), viewPointWebMercator.y + radius * Math.sin(radians), 10);
// // 投影坐标转世界坐标
// toPoint = webMercatorProjection.unproject(toPoint);
// destPoints.push(Cesium.Cartographic.toCartesian(toPoint.clone()));
// }
// let viewer = this.viewer;
// // 绘制线
// function drawLine(leftPoint, secPoint, color) {
// viewer.entities.add({
// polyline: {
// positions: [leftPoint, secPoint],
// arcType: Cesium.ArcType.NONE,
// width: 5,
// material: color,
// depthFailMaterial: color
// }
// })
// }
// pickFromRay.call(this);
// function pickFromRay() {
// for (var i = 0; i < destPoints.length; i++) {
// // 计算射线的方向,目标点left 视域点right
// var direction = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(destPoints[i], positions[0], new Cesium.Cartesian3()), new Cesium.Cartesian3());
// console.log(direction);
// // 建立射线
// var ray = new Cesium.Ray(positions[0], direction);
// var result = viewer.scene.pickFromRay(ray, objectsToExclude); // 计算交互点,返回第一个
// showIntersection(result, destPoints[i], positions[0]);
// }
// }
// // 处理交互点
// function showIntersection(result, destPoint, cartesian) {
// // 如果是场景模型的交互点,排除交互点是地球表面
// if (Cesium.defined(result) && Cesium.defined(result.object)) {
// drawLine(result.position, cartesian, Cesium.Color.GREEN); // 可视区域
// drawLine(result.position, destPoint, Cesium.Color.RED); // 不可视区域
// } else {
// drawLine(cartesian, destPoint, Cesium.Color.GREEN);
// }
// }
// this.handler.destroy();
// }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
}
// 视域
,Ehorizon(val) {
......@@ -405,13 +321,11 @@
,EallSee(val) {
this[val] = !this[val];
this.onlySelect(val);
this.viewpoint instanceof viewpoint || (this.viewpoint = new viewpoint(this.viewer));
},
// 淹没分析
EymAnslysis(val) {
this[val] = !this[val];
this.onlySelect(val);
this.flood instanceof flood || (this.flood = new flood(this.viewer));
},
// 天际线分析
EtjxAnslysis(val) {
......