///////////////////////////////////////////////////////////////////////////
|
// Copyright © 2019 zhongsong. All Rights Reserved.
|
// 模块描述:显示坐标
|
///////////////////////////////////////////////////////////////////////////
|
define([
|
'dojo/_base/declare',
|
'dojo/_base/lang',
|
'dojo/_base/array',
|
'dojo/_base/html',
|
'dojo/topic',
|
'jimu/BaseWidget',
|
'jimu/utils',
|
'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css',
|
'libs/zTree_v3/js/jquery.ztree.all'
|
],
|
function (declare,
|
lang,
|
array,
|
html,
|
topic,
|
BaseWidget,
|
aspect,
|
string,
|
utils
|
) {
|
return declare([BaseWidget], {
|
baseClass: 'jimu-widget-Tool',
|
name: 'Tool',
|
layers: {},
|
startup: function () {
|
var that = this;
|
// 暴露在外的接口
|
topic.subscribe("closeTool", lang.hitch(this, this.closeToolBox));
|
this.inherited(arguments);
|
$('.tool-bar .tool-btn span').click(function () {
|
topic.publish('closeMap', this.name);
|
topic.publish('closeZtree', this.name);
|
$('.tool-y-box').toggle();
|
})
|
|
// 图上量算
|
$('.measure-tool').click(function () {
|
that.map.scene.globe.depthTestAgainstTerrain = false;
|
// 关闭卷帘
|
topic.publish('closeRolling', 'Rolling');
|
// 关闭分屏
|
topic.publish('closeSplitScreen', 'SplitScreen');
|
// 关闭标记
|
topic.publish('closeSign', 'Sign');
|
topic.publish('closeFlyRoute', 'FlyRoute');
|
$('.jimu-widget-Sign').hide();
|
$('.jimu-widget-CoorPosition').hide();
|
$('.jimu-widget-MapPrinting').hide();
|
|
|
that.closefenxi();
|
|
|
$('.tool-y-box').stop().hide();
|
//关闭飞行
|
$('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
|
topic.publish('closeFly', 'closeFly');
|
|
|
|
|
$('.jimu-widget-Measurement').show();
|
|
|
})
|
|
// 卷帘对比
|
$('.rolling-tool').click(function () {
|
|
that.map.scene.globe.depthTestAgainstTerrain = false;
|
// 关闭量算
|
topic.publish('closeMeasurement', 'Measurement');
|
// 关闭分屏
|
topic.publish('closeSplitScreen', 'SplitScreen');
|
// 关闭标记
|
topic.publish('closeSign', 'Sign');
|
topic.publish('closeFlyRoute', 'FlyRoute');
|
|
$('.jimu-widget-CoorPosition').hide();
|
$('.jimu-widget-MapPrinting').hide();
|
|
|
that.closefenxi();
|
|
|
$('.tool-y-box').stop().hide();
|
//关闭飞行
|
$('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
|
topic.publish('closeFly', 'closeFly');
|
|
topic.publish('openRolling', 'Rolling');
|
|
|
})
|
|
// 分屏对比
|
$('.splitScreen-tool').click(function () {
|
that.map.scene.globe.depthTestAgainstTerrain = false;
|
// 关闭量算
|
topic.publish('closeMeasurement', 'Measurement');
|
// 关闭卷帘
|
topic.publish('closeRolling', 'Rolling');
|
// 关闭标记
|
topic.publish('closeSign', 'Sign');
|
topic.publish('closeFlyRoute', 'FlyRoute');
|
$('.jimu-widget-CoorPosition').hide();
|
$('.jimu-widget-MapPrinting').hide();
|
|
|
that.closefenxi();
|
|
|
$('.tool-y-box').stop().hide();
|
//关闭飞行
|
$('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
|
topic.publish('closeFly', 'closeFly');
|
|
topic.publish('openSplitScreen', 'SplitScreen');
|
|
})
|
|
// 我的标记
|
$('.sign-tool').click(function () {
|
|
that.map.scene.globe.depthTestAgainstTerrain = false;
|
// 关闭量算
|
topic.publish('closeMeasurement', 'Measurement');
|
// 关闭卷帘
|
topic.publish('closeRolling', 'Rolling');
|
// 关闭分屏
|
topic.publish('closeSplitScreen', 'SplitScreen');
|
topic.publish('closeFlyRoute', 'FlyRoute');
|
$('.jimu-widget-CoorPosition').hide();
|
$('.jimu-widget-MapPrinting').hide();
|
|
|
that.closefenxi();
|
|
|
$('.tool-y-box').stop().hide();
|
//关闭飞行
|
$('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
|
topic.publish('closeFly', 'closeFly');
|
|
topic.publish('openSign', 'Sign');
|
|
|
})
|
|
// 坐标定位
|
$('.CoorPosition-tool').click(function () {
|
|
that.map.scene.globe.depthTestAgainstTerrain = false;
|
// 关闭量算
|
topic.publish('closeMeasurement', 'Measurement');
|
// 关闭卷帘
|
topic.publish('closeRolling', 'Rolling');
|
// 关闭分屏
|
topic.publish('closeSplitScreen', 'SplitScreen');
|
// 关闭标记
|
topic.publish('closeSign', 'Sign');
|
topic.publish('closeFlyRoute', 'FlyRoute');
|
$('.jimu-widget-MapPrinting').hide();
|
|
|
that.closefenxi();
|
|
|
$('.tool-y-box').stop().hide();
|
//关闭飞行
|
$('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
|
topic.publish('closeFly', 'closeFly');
|
|
$('.jimu-widget-CoorPosition').show();
|
|
|
})
|
|
|
// 地图打印
|
$('.MapPrinting-tool').click(function () {
|
|
that.map.scene.globe.depthTestAgainstTerrain = false;
|
// 关闭量算
|
topic.publish('closeMeasurement', 'Measurement');
|
// 关闭卷帘
|
topic.publish('closeRolling', 'Rolling');
|
// 关闭分屏
|
topic.publish('closeSplitScreen', 'SplitScreen');
|
// 关闭标记
|
topic.publish('closeSign', 'Sign');
|
|
topic.publish('closeFlyRoute', 'FlyRoute');
|
|
$('.jimu-widget-CoorPosition').hide();
|
|
|
that.closefenxi();
|
|
|
$('.tool-y-box').stop().hide();
|
//关闭飞行
|
$('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
|
topic.publish('closeFly', 'closeFly');
|
|
$('.jimu-widget-MapPrinting').show();
|
|
|
})
|
// 空间分析
|
$('.spatialAnalysis-tool').click(function () {
|
that.map.scene.globe.depthTestAgainstTerrain = true;
|
// 关闭量算
|
topic.publish('closeMeasurement', 'Measurement');
|
// 关闭卷帘
|
topic.publish('closeRolling', 'Rolling');
|
// 关闭分屏
|
topic.publish('closeSplitScreen', 'SplitScreen');
|
// 关闭标记
|
topic.publish('closeSign', 'Sign');
|
topic.publish('closeFlyRoute', 'FlyRoute');
|
$('.jimu-widget-CoorPosition').hide();
|
$('.jimu-widget-MapPrinting').hide();
|
$('.tool-y-box').stop().hide();
|
|
|
that.closefenxi();
|
|
|
//关闭飞行
|
$('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
|
topic.publish('closeFly', 'closeFly');
|
|
$(".jimu-widget-spatialAnalysis").show();
|
})
|
|
// // 可视分析
|
// $('.visibleArea-tool').click(function () {
|
// that.map.scene.globe.depthTestAgainstTerrain = true;
|
// // 关闭量算
|
// topic.publish('closeMeasurement', 'Measurement');
|
// // 关闭卷帘
|
// topic.publish('closeRolling', 'Rolling');
|
// // 关闭分屏
|
// topic.publish('closeSplitScreen', 'SplitScreen');
|
// // 关闭标记
|
// topic.publish('closeSign', 'Sign');
|
// topic.publish('closeFlyRoute', 'FlyRoute');
|
// $('.jimu-widget-CoorPosition').hide();
|
// $('.jimu-widget-MapPrinting').hide();
|
// // 关闭可视
|
// // topic.publish('closev', '');
|
// // 关闭剖面
|
// topic.publish('closep', '');
|
// $(".jimu-widget-profileAnalysis").hide();
|
// $(".jimu-widget-slope").hide();
|
// $('.tool-y-box').stop().hide();
|
|
// $(".jimu-widget-visibleArea").show();
|
// })
|
// 剖面分析
|
// $('.profileAnalysis-tool').click(function () {
|
// that.map.scene.globe.depthTestAgainstTerrain = true;
|
// // 关闭量算
|
// topic.publish('closeMeasurement', 'Measurement');
|
// // 关闭卷帘
|
// topic.publish('closeRolling', 'Rolling');
|
// // 关闭分屏
|
// topic.publish('closeSplitScreen', 'SplitScreen');
|
// // 关闭标记
|
// topic.publish('closeSign', 'Sign');
|
// topic.publish('closeFlyRoute', 'FlyRoute');
|
// $('.jimu-widget-CoorPosition').hide();
|
// $('.jimu-widget-MapPrinting').hide();
|
// // 关闭可视
|
// topic.publish('closev', '');
|
// // 关闭剖面
|
// // topic.publish('closep', '');
|
// $(".jimu-widget-visibleArea").hide();
|
// $(".jimu-widget-slope").hide();
|
// $('.tool-y-box').stop().hide();
|
|
// $(".jimu-widget-profileAnalysis").show();
|
// })
|
//坡度分析
|
// $('.slope-tool').click(function () {
|
// that.map.scene.globe.depthTestAgainstTerrain = true;
|
// // 关闭量算
|
// topic.publish('closeMeasurement', 'Measurement');
|
// // 关闭卷帘
|
// topic.publish('closeRolling', 'Rolling');
|
// // 关闭分屏
|
// topic.publish('closeSplitScreen', 'SplitScreen');
|
// // 关闭标记
|
// topic.publish('closeSign', 'Sign');
|
// topic.publish('closeFlyRoute', 'FlyRoute');
|
// $('.jimu-widget-CoorPosition').hide();
|
// $('.jimu-widget-MapPrinting').hide();
|
// // 关闭可视
|
// topic.publish('closev', '');
|
// // 关闭剖面
|
// topic.publish('closep', '');
|
// $(".jimu-widget-visibleArea").hide();
|
// $(".jimu-widget-profileAnalysis").hide();
|
// $('.tool-y-box').stop().hide();
|
|
// $(".jimu-widget-slope").show();
|
// topic.publish('getbeginSlope', this.beginSlope);
|
// })
|
|
},
|
|
closeToolBox: function (item) {
|
if (item != this.name) {
|
$('.tool-y-box').hide();
|
}
|
},
|
closefenxi: function () {
|
// 关闭可视
|
topic.publish('closev', '');
|
// 关闭剖面
|
topic.publish('closep', '');
|
// 关闭坡度
|
topic.publish('closes', '');
|
$(".jimu-widget-profileAnalysis").hide();
|
$(".jimu-widget-slope").hide();
|
$(".jimu-widget-visibleArea").hide();
|
$(".jimu-widget-spatialAnalysis").hide();
|
//清除实体
|
this.map.entities.removeAll();
|
$(".jimu-widget-modelDiagram").hide();
|
|
},
|
onOpen: function () {
|
//面板打开的时候触发 (when open this panel trigger)
|
},
|
|
onClose: function () {
|
//面板关闭的时候触发 (when this panel is closed trigger)
|
},
|
|
onMinimize: function () {
|
this.resize();
|
},
|
|
onMaximize: function () {
|
this.resize();
|
},
|
|
resize: function () {
|
|
},
|
|
|
destroy: function () {
|
//销毁的时候触发
|
//todo
|
//do something before this func
|
this.inherited(arguments);
|
}
|
|
});
|
});
|