/**
|
* 历史对比控件按钮
|
* @author Tengzh 2018-11-21
|
**/
|
define([
|
"base/AppEvent",
|
"dojo",
|
"dojo/_base/declare",
|
"dojo/_base/lang",
|
"controls/toolbar/tools/BaseTool",
|
"dojo/dom-style",
|
"base/ConfigData",
|
], function (
|
AppEvent,
|
dojo,
|
declare,
|
lang,
|
BaseTool,
|
domStyle,
|
ConfigData
|
) {
|
var RL = declare([BaseTool], {
|
customExtentAndSR: "",
|
thisobj: "",
|
constructor: function (args) {
|
thisobj = this;
|
this._normalIconClass = "tool-multidate-normal";
|
this._overIconClass = "tool-multidate-over";
|
this._selectedIconClass = "tool-multidate-select";
|
this.tooltip = " 历史对比";
|
},
|
activate: function (args) {
|
this.inherited(arguments);
|
//移除屏幕现有图层
|
for (var x in ConfigData.layers) {
|
if (ConfigData.layers[x] != null) {
|
this.map.removeLayer(ConfigData.layers[x]);
|
}
|
}
|
//关闭打开的属性弹窗
|
if (this.map.infoWindow.isShowing) {
|
this.map.infoWindow.hide();
|
}
|
var mianSelectLayer = this.map.getLayer('mianSelectLayer');
|
if (mianSelectLayer) {
|
mianSelectLayer.setVisibility(true);
|
}
|
// $("#MapSwitchControl_0").css({"display": "none"});
|
$(".esriSimpleSlider").css({"display": "none"});
|
$(".Splittime-base").css({"display": "block"});
|
$("#toolBarDiv").css({"display": "none"});
|
$(".searchDiv").hide();
|
$("#fenping_colse").css({"display": "block"});
|
if ($("#tabcontainer").is(":visible")) {
|
$("#siderbutton").trigger("click").hide();
|
}
|
$("#siderbutton").hide();
|
$(".in-header li").unbind("mousedown").mousedown(function (e) {//防止重复绑定
|
AppEvent.dispatchAppEvent(AppEvent.MULTIDATE);//关闭分屏
|
});
|
$(".in-menu-ul li").unbind("mousedown").mousedown(function (e) {//防止重复绑定
|
AppEvent.dispatchAppEvent(AppEvent.MULTIDATE);//关闭分屏
|
});
|
//派发分屏事件
|
AppEvent.dispatchAppEvent(AppEvent.RUN_WIDGET, "MultidateWidget");
|
},
|
postCreate: function () {
|
this.inherited(arguments);
|
AppEvent.addAppEventListener(AppEvent.MULTIDATE, lang.hitch(this, function (evt) {
|
this.deactivate();
|
}));
|
},
|
deactivate: function () {
|
this.inherited(arguments);
|
var mianSelectLayer = this.map.getLayer('mianSelectLayer');
|
if (mianSelectLayer) {
|
mianSelectLayer.setVisibility(false);
|
}
|
$(".in-header li").unbind("mousedown");
|
$(".in-menu-ul li").unbind("mousedown");
|
// $("#MapSwitchControl_0").css({"display": "block"});
|
$(".esriSimpleSlider").css({"display": "block"});
|
$(".Splittime-base").css({"display": "none"});
|
$("#fenping_colse").css({"display": "none"});
|
$("#toolBarDiv").css({"display": "block"});
|
$(".searchDiv").show();
|
if ($("#tabcontainer").is(":hidden")) {
|
$("#siderbutton").show().trigger("click");
|
}
|
AppEvent.dispatchAppEvent(AppEvent.CLOSE_WIDGET, "MultidateWidget");
|
}
|
});
|
return RL;
|
});
|