/////////////////////////////////////////////////////////////////////////// // 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); topic.publish('closeNavigation', this.name); $(".jimu-widget-Layermanagement .layer-list").stop().hide(); if ($(".jimu-widget-Layermanagement .layer-list").is(":hidden")) { $(".jimu-widget-Layermanagement .tree-layer-opcity").stop().hide(); } $('.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(); }) }, closeToolBox: function (item) { if (item != this.name) { $('.tool-y-box').hide(); } }, closefenxi: function () { // 关闭空间分析页面 $(".jimu-widget-spatialAnalysis").hide(); // 关闭空间分析子元素 topic.publish('closeOnceUse'); }, 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); } }); });