4248ae6a by jikai

111111

1 parent de000489
1 export default {
2 attribute: {
3 zoomIn: { func: "Navigate.ZoomIn", args: [] },
4 zoomOut: { func: "Navigate.ZoomOut", args: [] },
5 rotate : { func : 'Command.Execute', args : [1507, 1]},
6 measure: { func: "Command.Execute", args: [1035, 0] },
7 vertical: { func: "Command.Execute", args: [1034, 0] },
8 terrain: { func: "Command.Execute", args: [1165, 0] },
9 plane: { func: "Command.Execute", args: [1037, 0] }
10 }
11 }
...\ No newline at end of file ...\ No newline at end of file
1 import maps from './mapUtils'
2
3 let SGWorld;
4 export default {
5 methods: {
6 getMap: {
7 tree: {el: 'object', id: 'TerraExplorerInformationWindow', classid: 'CLSID:3a4f9193-65a8-11d5-85c1-0001023952c1', style: { width: '10%', height: '100%'}},
8 map: {el: 'object', id: 'TerraExplorer3DWindow', classid: "CLSID:3a4f9192-65a8-11d5-85c1-0001023952c1", style: { width: '90%', height: '100%' }},
9 sgword: {el: 'object', id: 'SGWorld', classid: 'CLSID:3A4F919C-65A8-11D5-85C1-0001023952C1', style: { width: '1px', height: '1px' }}
10 },
11 getTree() {
12 if(!(SGWorld = maps.sgWorld)) return;
13 let tree = SGWorld.ProjectTree, current = tree.GetNextItem(SGWorld.ProjectTree.RootID, 18), child = undefined,
14 arr = [{id : current, label : tree.GetItemName(current), children : []}], calculation = [current], last = [],
15 position = {[current] : [0]}, index = 1,
16 func = (a = 13) => {
17 a === 11 && (child = []);
18 while(current) {
19 current = tree.GetNextItem(current, a);
20 if(current)
21 Object.prototype.toString.call(child) !== '[object Array]' ?
22 arr.push({id : current, label : tree.GetItemName(current), children : []}) :
23 (() => {
24 let evalstr = 'arr', i = 0;
25 for( ; i < last.length ; i++ ) evalstr += '[last['+i+']].children';
26 evalstr += '.push({id : current, label : tree.GetItemName(current), children : []})'
27 eval(evalstr);
28 })(),
29 calculation.push(current),
30 position[current] = last.concat([index++]);
31 a = 13;
32 }
33 for( ; current = calculation.shift() ; )
34 if(tree.IsGroup(current)) {
35 last = position[current];
36 index = 0;
37 func(11);
38 break;
39 }
40 };
41 func();
42 return arr;
43 },
44 menu () {
45 return {
46 main : [
47 {text : '新建组', func : 'ProjectTree.CreateGroup', args : ['新建组'], callback : 'Initialization'},
48 {text : '加载矢量图层', func : 'Command.Execute', args : [1013, 5], callback : 'Initialization'},
49 {text : '加载影像图层', func : 'Command.Execute', args : [1014, 2], callback : 'Initialization'},
50 {text : '加载高程图层', func : 'Command.Execute', args : [1014, 19], callback : 'Initialization'},
51 {text : '加载Kml图层', func : 'Command.Execute', args : [1013, 3], callback : 'Initialization'},
52 {text : '加载3D网格图层', func : 'Command.Execute', args : [2110, 0], callback : 'Initialization'},
53 {key : 'interest', text : '兴趣点', func : 'ProjectTree.CreateGroup', args : ['兴趣点'], callback : 'Initialization'},
54 // {key : 'animation', text : '演示工具', func : 'ProjectTree.CreateGroup', args : ['演示工具'], callback : 'Initialization'},
55 // this.presentation = maps.sgWorld.Creator.CreatePresentation(maps.sgWorld.ProjectTree.RootID, "自建飞行轨迹");
56 {text : '演示工具', func : 'Creator.CreatePresentation', args : ['.RootID', '演示工具'], callback : 'playback'},
57 {text : '树信息', func : 'Navigate.FlyTo', args : ['.id', 0]}
58 ],
59 public : [
60 {text : '飞行到图层', func : 'Navigate.FlyTo', args : ['.id', 0]},
61 {text : '跳转到图层', func : 'Navigate.FlyTo', args : ['.id', 0]},
62 {text : '刷新图层', func : 'Navigate.FlyTo', args : ['.id', 0]},
63 {text : '删除', func : 'ProjectTree.DeleteItem', args : ['.id'], callback : 'Initialization'},
64 // {text : '重命名', func : 'ProjectTree.RenameGroup', args : ['.id', 'aaa']},
65 {text : '属性表', func : 'Command.Execute', args : [1086, 0]},
66 {text : '另存为', func : 'Command.Execute', args : [1089, 0]},
67 {text : '属性', func : 'ProjectTree.EditItem', args : ['.id', 0]}
68 ],
69 play : [
70 {text : '添加兴趣点', func : 'Command.Execute', args : [1099, 0]},
71 {text : '播放漫游路线', args : [], callback : 'play'},
72 {text : '停止', func : 'Command.Execute', args : [1113, 0]},
73 {text : '上一个节点', func : 'Command.Execute', args : [1114, 0]},
74 {text : '下一个节点', func : 'Command.Execute', args : [1115, 0]}
75 ]
76 }
77 }
78 }
79 }
1 let maps = {
2 popups: {}
3 }
4
5 export default maps
1 export default {
2 attribute: {
3 visual: ['可视域分析', 'http://localhost:8081/toolbar/analysis/viewshedAnalysis.html', 1100, 20, 530, 620],
4 flood: ['淹没分析', 'http://localhost:8081/toolbar/analysis/floodAnalysis.html', 933, 20, 370, 230],
5 sunshine: ['日照分析', 'http://localhost:8081/toolbar/analysis/sunshineAnalysis.html', 933, 20, 540, 385],
6 contour: ['等高线分析', 'http://localhost:8081/toolbar/analysis/contourAnalysis.html', 933, 20, 400, 440],
7 flowto: ['流向分析', 'http://localhost:8081/toolbar/analysis/flowAnalysis.html', 933, 20, 350, 140],
8 pointQuery: ['点击查询', 'http://localhost:8081/toolbar/search/pointQuery.html', 933, 20, 350, 140],
9 rectQuery: ['点击查询', 'http://localhost:8081/toolbar/search/rectangleQuery.html', 933, 20, 350, 140],
10 polygonQuery: ['点击查询', 'http://localhost:8081/toolbar/search/polygonQuery.html', 933, 20, 350, 140],
11 }
12 }
...\ No newline at end of file ...\ No newline at end of file
...@@ -21,7 +21,6 @@ export default { ...@@ -21,7 +21,6 @@ export default {
21 } 21 }
22 create(e) { 22 create(e) {
23 this.type[e].startCreate(); 23 this.type[e].startCreate();
24 return this.type[e];
25 } 24 }
26 clearAll() { 25 clearAll() {
27 for (var i = 0; i < this._lineArr.length; i++) { 26 for (var i = 0; i < this._lineArr.length; i++) {
...@@ -106,7 +105,7 @@ export default { ...@@ -106,7 +105,7 @@ export default {
106 $this.handler.destroy(); 105 $this.handler.destroy();
107 $this._positions.pop(); 106 $this._positions.pop();
108 $this._positions.push(cartesian); 107 $this._positions.push(cartesian);
109 func($this._positions); 108 func && func($this._positions);
110 }, Cesium.ScreenSpaceEventType.RIGHT_CLICK); 109 }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
111 } 110 }
112 createPolygon(obj) { 111 createPolygon(obj) {
...@@ -116,14 +115,16 @@ export default { ...@@ -116,14 +115,16 @@ export default {
116 hierarchy: new Cesium.CallbackProperty(function () { 115 hierarchy: new Cesium.CallbackProperty(function () {
117 return new Cesium.PolygonHierarchy($this._positions); 116 return new Cesium.PolygonHierarchy($this._positions);
118 }, false), 117 }, false),
119 clampToGround: true, 118 // clampToGround: true,
120 show: true, 119 // show: true,
121 fill: true, 120 // fill: false,
122 material: Cesium.Color.RED, 121 // material: Cesium.Color.RED,
123 width: 3, 122 // width: 3,
123 material: new Cesium.Color.fromCssColorString("#FFD700").withAlpha(.2),
124 perPositionHeight: true,
124 outlineColor: Cesium.Color.BLACK, 125 outlineColor: Cesium.Color.BLACK,
125 outlineWidth: 1, 126 outlineWidth: 3,
126 outline: false 127 outline: true
127 } 128 }
128 }); 129 });
129 } 130 }
...@@ -136,7 +137,7 @@ export default { ...@@ -136,7 +137,7 @@ export default {
136 }, false), 137 }, false),
137 clampToGround: true, 138 clampToGround: true,
138 material: Cesium.Color.YELLOW, 139 material: Cesium.Color.YELLOW,
139 width: 3 140 width: 5
140 } 141 }
141 }); 142 });
142 } 143 }
...@@ -167,11 +168,9 @@ export default { ...@@ -167,11 +168,9 @@ export default {
167 constructor(arg) { 168 constructor(arg) {
168 this.objId = Number((new Date()).getTime() + "" + Number(Math.random() * 1000).toFixed(0)); 169 this.objId = Number((new Date()).getTime() + "" + Number(Math.random() * 1000).toFixed(0));
169 this.viewer = arg.viewer; 170 this.viewer = arg.viewer;
170 this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
171 this._position = null; 171 this._position = null;
172 this._billboard = null; 172 this._billboard = null;
173 } 173 }
174
175 get billboard() { 174 get billboard() {
176 return this._billboard; 175 return this._billboard;
177 } 176 }
...@@ -180,26 +179,27 @@ export default { ...@@ -180,26 +179,27 @@ export default {
180 } 179 }
181 startCreate() { 180 startCreate() {
182 var $this = this; 181 var $this = this;
183 this.handler.setInputAction(function (evt) { //单机开始绘制 182 this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
183 this.handler.setInputAction(evt => { //单机开始绘制
184 var cartesian = $this.getCatesian3FromPX(evt.position); 184 var cartesian = $this.getCatesian3FromPX(evt.position);
185 if (!cartesian) return; 185 // if(!Cesium.defined($this._billboard)){
186 if(!Cesium.defined($this._billboard)){ 186 // $this._billboard = $this.createBillboard(cartesian);
187 $this._billboard = $this.createBillboard(cartesian); 187 // $this.handler.destroy();
188 $this.handler.destroy(); 188 // }
189 } 189 this.handler.destroy();
190 this.handler = undefined;
191 this.createBillboard(cartesian);
190 }, Cesium.ScreenSpaceEventType.LEFT_CLICK); 192 }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
191 } 193 }
192 createBillboard(cartesian) { 194 createBillboard(cartesian) {
193 var billboard = this.viewer.entities.add({ 195 var billboard = this.viewer.entities.add({
194 position: cartesian, 196 position: cartesian,
195 billboard: { 197 point: {
196 // image: '../Apicture/icon_标注.png', 198 color: Cesium.Color.SKYBLUE,
197 image: 'http://localhost:8080/assets/Apicture/icon_标注.png', 199 pixelSize: 10,
198 scale: 1, 200 outlineColor: Cesium.Color.YELLOW,
199 horizontalOrigin: Cesium.HorizontalOrigin.CENTER, 201 outlineWidth: 3,
200 verticalOrigin: Cesium.VerticalOrigin.BOTTOM, 202 disableDepthTestDistance: Number.POSITIVE_INFINITY
201 heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,
202 disableDepthTestDistance:Number.MAX_VALUE
203 } 203 }
204 }); 204 });
205 billboard.objId = this.objId; 205 billboard.objId = this.objId;
...@@ -285,7 +285,7 @@ export default { ...@@ -285,7 +285,7 @@ export default {
285 }, false), 285 }, false),
286 show: true, 286 show: true,
287 material: Cesium.Color.YELLOW, 287 material: Cesium.Color.YELLOW,
288 width: 3, 288 width:5 ,
289 clampToGround:true 289 clampToGround:true
290 } 290 }
291 }); 291 });
......