4248ae6a by jikai

111111

1 parent de000489
export default {
attribute: {
zoomIn: { func: "Navigate.ZoomIn", args: [] },
zoomOut: { func: "Navigate.ZoomOut", args: [] },
rotate : { func : 'Command.Execute', args : [1507, 1]},
measure: { func: "Command.Execute", args: [1035, 0] },
vertical: { func: "Command.Execute", args: [1034, 0] },
terrain: { func: "Command.Execute", args: [1165, 0] },
plane: { func: "Command.Execute", args: [1037, 0] }
}
}
\ No newline at end of file
import maps from './mapUtils'
let SGWorld;
export default {
methods: {
getMap: {
tree: {el: 'object', id: 'TerraExplorerInformationWindow', classid: 'CLSID:3a4f9193-65a8-11d5-85c1-0001023952c1', style: { width: '10%', height: '100%'}},
map: {el: 'object', id: 'TerraExplorer3DWindow', classid: "CLSID:3a4f9192-65a8-11d5-85c1-0001023952c1", style: { width: '90%', height: '100%' }},
sgword: {el: 'object', id: 'SGWorld', classid: 'CLSID:3A4F919C-65A8-11D5-85C1-0001023952C1', style: { width: '1px', height: '1px' }}
},
getTree() {
if(!(SGWorld = maps.sgWorld)) return;
let tree = SGWorld.ProjectTree, current = tree.GetNextItem(SGWorld.ProjectTree.RootID, 18), child = undefined,
arr = [{id : current, label : tree.GetItemName(current), children : []}], calculation = [current], last = [],
position = {[current] : [0]}, index = 1,
func = (a = 13) => {
a === 11 && (child = []);
while(current) {
current = tree.GetNextItem(current, a);
if(current)
Object.prototype.toString.call(child) !== '[object Array]' ?
arr.push({id : current, label : tree.GetItemName(current), children : []}) :
(() => {
let evalstr = 'arr', i = 0;
for( ; i < last.length ; i++ ) evalstr += '[last['+i+']].children';
evalstr += '.push({id : current, label : tree.GetItemName(current), children : []})'
eval(evalstr);
})(),
calculation.push(current),
position[current] = last.concat([index++]);
a = 13;
}
for( ; current = calculation.shift() ; )
if(tree.IsGroup(current)) {
last = position[current];
index = 0;
func(11);
break;
}
};
func();
return arr;
},
menu () {
return {
main : [
{text : '新建组', func : 'ProjectTree.CreateGroup', args : ['新建组'], callback : 'Initialization'},
{text : '加载矢量图层', func : 'Command.Execute', args : [1013, 5], callback : 'Initialization'},
{text : '加载影像图层', func : 'Command.Execute', args : [1014, 2], callback : 'Initialization'},
{text : '加载高程图层', func : 'Command.Execute', args : [1014, 19], callback : 'Initialization'},
{text : '加载Kml图层', func : 'Command.Execute', args : [1013, 3], callback : 'Initialization'},
{text : '加载3D网格图层', func : 'Command.Execute', args : [2110, 0], callback : 'Initialization'},
{key : 'interest', text : '兴趣点', func : 'ProjectTree.CreateGroup', args : ['兴趣点'], callback : 'Initialization'},
// {key : 'animation', text : '演示工具', func : 'ProjectTree.CreateGroup', args : ['演示工具'], callback : 'Initialization'},
// this.presentation = maps.sgWorld.Creator.CreatePresentation(maps.sgWorld.ProjectTree.RootID, "自建飞行轨迹");
{text : '演示工具', func : 'Creator.CreatePresentation', args : ['.RootID', '演示工具'], callback : 'playback'},
{text : '树信息', func : 'Navigate.FlyTo', args : ['.id', 0]}
],
public : [
{text : '飞行到图层', func : 'Navigate.FlyTo', args : ['.id', 0]},
{text : '跳转到图层', func : 'Navigate.FlyTo', args : ['.id', 0]},
{text : '刷新图层', func : 'Navigate.FlyTo', args : ['.id', 0]},
{text : '删除', func : 'ProjectTree.DeleteItem', args : ['.id'], callback : 'Initialization'},
// {text : '重命名', func : 'ProjectTree.RenameGroup', args : ['.id', 'aaa']},
{text : '属性表', func : 'Command.Execute', args : [1086, 0]},
{text : '另存为', func : 'Command.Execute', args : [1089, 0]},
{text : '属性', func : 'ProjectTree.EditItem', args : ['.id', 0]}
],
play : [
{text : '添加兴趣点', func : 'Command.Execute', args : [1099, 0]},
{text : '播放漫游路线', args : [], callback : 'play'},
{text : '停止', func : 'Command.Execute', args : [1113, 0]},
{text : '上一个节点', func : 'Command.Execute', args : [1114, 0]},
{text : '下一个节点', func : 'Command.Execute', args : [1115, 0]}
]
}
}
}
}
let maps = {
popups: {}
}
export default maps
export default {
attribute: {
visual: ['可视域分析', 'http://localhost:8081/toolbar/analysis/viewshedAnalysis.html', 1100, 20, 530, 620],
flood: ['淹没分析', 'http://localhost:8081/toolbar/analysis/floodAnalysis.html', 933, 20, 370, 230],
sunshine: ['日照分析', 'http://localhost:8081/toolbar/analysis/sunshineAnalysis.html', 933, 20, 540, 385],
contour: ['等高线分析', 'http://localhost:8081/toolbar/analysis/contourAnalysis.html', 933, 20, 400, 440],
flowto: ['流向分析', 'http://localhost:8081/toolbar/analysis/flowAnalysis.html', 933, 20, 350, 140],
pointQuery: ['点击查询', 'http://localhost:8081/toolbar/search/pointQuery.html', 933, 20, 350, 140],
rectQuery: ['点击查询', 'http://localhost:8081/toolbar/search/rectangleQuery.html', 933, 20, 350, 140],
polygonQuery: ['点击查询', 'http://localhost:8081/toolbar/search/polygonQuery.html', 933, 20, 350, 140],
}
}
\ No newline at end of file
......@@ -21,7 +21,6 @@ export default {
}
create(e) {
this.type[e].startCreate();
return this.type[e];
}
clearAll() {
for (var i = 0; i < this._lineArr.length; i++) {
......@@ -106,7 +105,7 @@ export default {
$this.handler.destroy();
$this._positions.pop();
$this._positions.push(cartesian);
func($this._positions);
func && func($this._positions);
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
}
createPolygon(obj) {
......@@ -116,14 +115,16 @@ export default {
hierarchy: new Cesium.CallbackProperty(function () {
return new Cesium.PolygonHierarchy($this._positions);
}, false),
clampToGround: true,
show: true,
fill: true,
material: Cesium.Color.RED,
width: 3,
// clampToGround: true,
// show: true,
// fill: false,
// material: Cesium.Color.RED,
// width: 3,
material: new Cesium.Color.fromCssColorString("#FFD700").withAlpha(.2),
perPositionHeight: true,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 1,
outline: false
outlineWidth: 3,
outline: true
}
});
}
......@@ -136,7 +137,7 @@ export default {
}, false),
clampToGround: true,
material: Cesium.Color.YELLOW,
width: 3
width: 5
}
});
}
......@@ -167,11 +168,9 @@ export default {
constructor(arg) {
this.objId = Number((new Date()).getTime() + "" + Number(Math.random() * 1000).toFixed(0));
this.viewer = arg.viewer;
this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
this._position = null;
this._billboard = null;
}
get billboard() {
return this._billboard;
}
......@@ -180,26 +179,27 @@ export default {
}
startCreate() {
var $this = this;
this.handler.setInputAction(function (evt) { //单机开始绘制
this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
this.handler.setInputAction(evt => { //单机开始绘制
var cartesian = $this.getCatesian3FromPX(evt.position);
if (!cartesian) return;
if(!Cesium.defined($this._billboard)){
$this._billboard = $this.createBillboard(cartesian);
$this.handler.destroy();
}
// if(!Cesium.defined($this._billboard)){
// $this._billboard = $this.createBillboard(cartesian);
// $this.handler.destroy();
// }
this.handler.destroy();
this.handler = undefined;
this.createBillboard(cartesian);
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
}
createBillboard(cartesian) {
var billboard = this.viewer.entities.add({
position: cartesian,
billboard: {
// image: '../Apicture/icon_标注.png',
image: 'http://localhost:8080/assets/Apicture/icon_标注.png',
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance:Number.MAX_VALUE
point: {
color: Cesium.Color.SKYBLUE,
pixelSize: 10,
outlineColor: Cesium.Color.YELLOW,
outlineWidth: 3,
disableDepthTestDistance: Number.POSITIVE_INFINITY
}
});
billboard.objId = this.objId;
......@@ -285,7 +285,7 @@ export default {
}, false),
show: true,
material: Cesium.Color.YELLOW,
width: 3,
width:5 ,
clampToGround:true
}
});
......