0527650f by jikai

111111

1 parent 18a74691
...@@ -71,13 +71,12 @@ ...@@ -71,13 +71,12 @@
71 <horizon @closePop='closePop'></horizon> 71 <horizon @closePop='closePop'></horizon>
72 </div> 72 </div>
73 73
74 <div class="allSee tjx-anslysis" v-if='tjxAnslysis'> 74 <div class="allSee" v-if='visualField'>
75 <tjxAnslysis @closePop='closePop'></tjxAnslysis> 75 <visualField @closePop='closePop'></visualField>
76 </div> 76 </div>
77 77
78 78 <div class="allSee" v-if='tjxAnslysis'>
79 <div class="allSee tjx-anslysis" v-if='visualField'> 79 <tjxAnslysis @closePop='closePop'></tjxAnslysis>
80 <visualField @closePop='closePop'></visualField>
81 </div> 80 </div>
82 81
83 <div class="allSee" v-if='yyAnslysis'> 82 <div class="allSee" v-if='yyAnslysis'>
...@@ -93,8 +92,6 @@ ...@@ -93,8 +92,6 @@
93 <div id="horizontal-slider" style="display: none;"></div> 92 <div id="horizontal-slider" style="display: none;"></div>
94 </div> 93 </div>
95 94
96
97
98 <!-- <div id="split_up" style="display: none;"></div> 95 <!-- <div id="split_up" style="display: none;"></div>
99 <div id="split_bottom" style="display: none;"></div> 96 <div id="split_bottom" style="display: none;"></div>
100 <div id="split_left" style="display: none;"></div> 97 <div id="split_left" style="display: none;"></div>
...@@ -127,9 +124,9 @@ ...@@ -127,9 +124,9 @@
127 import objectManage from '../assets/js/map/maputils'; 124 import objectManage from '../assets/js/map/maputils';
128 import createDraw from '../assets/js/map/createDraw'; 125 import createDraw from '../assets/js/map/createDraw';
129 import roller from "../assets/js/map/roller"; 126 import roller from "../assets/js/map/roller";
130 import flood from "../assets/js/map/flood"; 127 // import flood from "../assets/js/map/flood";
131 import viewpoint from "../assets/js/map/viewpoint"; 128 // import viewpoint from "../assets/js/map/viewpoint";
132 import visual from "../assets/js/map/visual"; 129 // import visual from "../assets/js/map/visual";
133 130
134 131
135 import TopTitle from '../components/topTitle'; 132 import TopTitle from '../components/topTitle';
...@@ -145,9 +142,10 @@ ...@@ -145,9 +142,10 @@
145 import tjxAnslysis from '../components/tjxAnslysis'; // 天际线分析 142 import tjxAnslysis from '../components/tjxAnslysis'; // 天际线分析
146 import yyAnslysis from '../components/yyAnslysis'; // 阴影分析 143 import yyAnslysis from '../components/yyAnslysis'; // 阴影分析
147 import kgAnalusis from '../components/kgAnalusis'; // 控高分析 144 import kgAnalusis from '../components/kgAnalusis'; // 控高分析
145 import visualField from '../components/visualField' //可视域分析
148 import URL_CONFIG from "./../config/urlConfig.vue"; 146 import URL_CONFIG from "./../config/urlConfig.vue";
149 const Cesium = window.Cesium; 147 const Cesium = window.Cesium;
150 import visualField from '../components/visualField' //可视域分析 148
151 149
152 export default { 150 export default {
153 components: { 151 components: {
...@@ -161,8 +159,8 @@ ...@@ -161,8 +159,8 @@
161 allSee, 159 allSee,
162 ymAnslysis, 160 ymAnslysis,
163 horizon, 161 horizon,
164 tjxAnslysis,
165 visualField, 162 visualField,
163 tjxAnslysis,
166 yyAnslysis, 164 yyAnslysis,
167 kgAnalusis, 165 kgAnalusis,
168 }, 166 },
...@@ -192,21 +190,21 @@ ...@@ -192,21 +190,21 @@
192 keepArr: ['isReturn', 'enlarge', 'narrow', 'coordinate', 'distance', 190 keepArr: ['isReturn', 'enlarge', 'narrow', 'coordinate', 'distance',
193 'area', 'marker', 'rollerShutter', 'splitScreen', 'toNorth', 191 'area', 'marker', 'rollerShutter', 'splitScreen', 'toNorth',
194 'topSee', 'roundSee', 'horizon', 'allSee', 'ymAnslysis', 192 'topSee', 'roundSee', 'horizon', 'allSee', 'ymAnslysis',
195 'tjxAnslysis', 'yyAnslysis', 'kgAnalusis', 'visualField'] 193 'tjxAnslysis', 'yyAnslysis', 'visualField', 'kgAnalusis']
196 } 194 }
197 }, 195 },
198 mounted() { 196 mounted() {
199 this.viewer = new Cesium.Viewer('cesiumContainer'); 197 this.viewer = new Cesium.Viewer('cesiumContainer', {shadows : true});
200 this.viewer.imageryLayers.addImageryProvider(new Cesium.TiandituImageryProvider({ 198 this.viewer.imageryLayers.addImageryProvider(new Cesium.TiandituImageryProvider({
201 credit : new Cesium.Credit('天地图全球影像服务'), 199 credit : new Cesium.Credit('天地图全球影像服务'),
202 token: URL_CONFIG.TOKEN_TIANDITU 200 token: URL_CONFIG.TOKEN_TIANDITU
203 })); 201 }));
204 let scene = this.viewer.scene 202 let scene = this.viewer.scene
205 scene.shadowMap.darkness = 1.275; //设置第二重烘焙纹理的效果(明暗程度) 203 scene.shadowMap.darkness = 1; //设置第二重烘焙纹理的效果(明暗程度)
206 scene.skyAtmosphere.brightnessShift=0.4; 204 scene.skyAtmosphere.brightnessShift=0.4;
207 scene.debugShowFramesPerSecond = true; 205 scene.debugShowFramesPerSecond = true;
208 scene.hdrEnabled = false; 206 scene.hdrEnabled = false;
209 scene.sun.show = false; 207 scene.sun.show = true;
210 this.draw = new createDraw(this.viewer); 208 this.draw = new createDraw(this.viewer);
211 Cesium.when.all([ 209 Cesium.when.all([
212 scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_GROUND1, { 210 scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_GROUND1, {
...@@ -215,9 +213,13 @@ ...@@ -215,9 +213,13 @@
215 scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_BUILD, { 213 scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_BUILD, {
216 name: 'build' 214 name: 'build'
217 }) 215 })
218 ], layer => { 216 ], layers => {
219 // this.layers = layer; 217 // this.layers = layer;
220 objectManage.viewer = this.viewer; 218 objectManage.viewer = this.viewer;
219 layers[0].selectEnabled = false;
220 layers[1].selectEnabled = false;
221 layers[0].shadowType = 2;
222 layers[1].shadowType = 2;
221 scene.camera.setView({ 223 scene.camera.setView({
222 destination : Cesium.Cartesian3.fromDegrees(116.44621857300415, 39.899281526734555, 216.7793905027196), 224 destination : Cesium.Cartesian3.fromDegrees(116.44621857300415, 39.899281526734555, 216.7793905027196),
223 orientation : { 225 orientation : {
...@@ -308,93 +310,7 @@ ...@@ -308,93 +310,7 @@
308 ,EtopSee() {} 310 ,EtopSee() {}
309 // 环视 311 // 环视
310 ,EroundSee() { 312 ,EroundSee() {
311 // var parentEntity = this.viewer.entities.add(new Cesium.Entity()), positions = [], cartesian, polyline; 313
312 // this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)
313 // this.handler.setInputAction(evt => {
314
315 // cartesian = this.viewer.scene.pickPosition(evt.position);
316 // // cartesian = this.draw.getCatesian3FromPX(evt.position, this.viewer, []);
317 // positions.push(cartesian.clone());
318 // // addCompany.createPoint.call(this, {position: cartesian})
319
320 // if(positions.length === 1) {
321 // this.handler.setInputAction(moveEvent => {
322 // positions[1] = this.viewer.scene.pickPosition(moveEvent.endPosition);
323 // // positions[1] = this.draw.getCatesian3FromPX(moveEvent.endPosition, this.viewer, []);
324 // !polyline && (polyline = addCompany.createPolyline.call(this, positions));
325 // }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
326 // return;
327 // }
328
329
330 // this.handler.destroy();
331 // // console.log(Cesium.Cartesian3.distance(positions[0], positions[1]));
332 // // var cartesian = this.draw.getCatesian3FromPX(evt.position, this.viewer, []);
333 // var viewPointEntity = this.viewer.entities.add({
334 // parent: parentEntity,
335 // position: positions[0],
336 // ellipsoid: {
337 // radii: new Cesium.Cartesian3(5, 5, 5),
338 // material: Cesium.Color.GREEN
339 // }
340 // });
341 // // // 世界坐标转换为投影坐标
342 // var webMercatorProjection = new Cesium.WebMercatorProjection(this.viewer.scene.globe.ellipsoid);
343 // var viewPointWebMercator = webMercatorProjection.project(Cesium.Cartographic.fromCartesian(positions[0]));
344 // // // 排除碰撞监测的对象
345 // var objectsToExclude = [viewPointEntity];
346
347 // // 目标点集合
348 // var destPoints = [];
349 // // 视域点和目标点的距离
350 // var radius = Cesium.Cartesian3.distance(positions[0], positions[1]); // 视距1000米
351 // // 计算一圈
352 // for (var i = 0; i <= 30; i++) {
353 // // 度数转弧度
354 // var radians = Cesium.Math.toRadians(i);
355 // // 计算目标点
356 // var toPoint = new Cesium.Cartesian3(viewPointWebMercator.x + radius * Math.cos(radians), viewPointWebMercator.y + radius * Math.sin(radians), 10);
357 // // 投影坐标转世界坐标
358 // toPoint = webMercatorProjection.unproject(toPoint);
359 // destPoints.push(Cesium.Cartographic.toCartesian(toPoint.clone()));
360 // }
361 // let viewer = this.viewer;
362 // // 绘制线
363 // function drawLine(leftPoint, secPoint, color) {
364 // viewer.entities.add({
365 // polyline: {
366 // positions: [leftPoint, secPoint],
367 // arcType: Cesium.ArcType.NONE,
368 // width: 5,
369 // material: color,
370 // depthFailMaterial: color
371 // }
372 // })
373 // }
374 // pickFromRay.call(this);
375 // function pickFromRay() {
376 // for (var i = 0; i < destPoints.length; i++) {
377 // // 计算射线的方向,目标点left 视域点right
378 // var direction = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(destPoints[i], positions[0], new Cesium.Cartesian3()), new Cesium.Cartesian3());
379 // console.log(direction);
380 // // 建立射线
381 // var ray = new Cesium.Ray(positions[0], direction);
382 // var result = viewer.scene.pickFromRay(ray, objectsToExclude); // 计算交互点,返回第一个
383 // showIntersection(result, destPoints[i], positions[0]);
384 // }
385 // }
386 // // 处理交互点
387 // function showIntersection(result, destPoint, cartesian) {
388 // // 如果是场景模型的交互点,排除交互点是地球表面
389 // if (Cesium.defined(result) && Cesium.defined(result.object)) {
390 // drawLine(result.position, cartesian, Cesium.Color.GREEN); // 可视区域
391 // drawLine(result.position, destPoint, Cesium.Color.RED); // 不可视区域
392 // } else {
393 // drawLine(cartesian, destPoint, Cesium.Color.GREEN);
394 // }
395 // }
396 // this.handler.destroy();
397 // }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
398 } 314 }
399 // 视域 315 // 视域
400 ,Ehorizon(val) { 316 ,Ehorizon(val) {
...@@ -405,13 +321,11 @@ ...@@ -405,13 +321,11 @@
405 ,EallSee(val) { 321 ,EallSee(val) {
406 this[val] = !this[val]; 322 this[val] = !this[val];
407 this.onlySelect(val); 323 this.onlySelect(val);
408 this.viewpoint instanceof viewpoint || (this.viewpoint = new viewpoint(this.viewer));
409 }, 324 },
410 // 淹没分析 325 // 淹没分析
411 EymAnslysis(val) { 326 EymAnslysis(val) {
412 this[val] = !this[val]; 327 this[val] = !this[val];
413 this.onlySelect(val); 328 this.onlySelect(val);
414 this.flood instanceof flood || (this.flood = new flood(this.viewer));
415 }, 329 },
416 // 天际线分析 330 // 天际线分析
417 EtjxAnslysis(val) { 331 EtjxAnslysis(val) {
......