赣州市洪水风险预警系统二维版本
xiebin
2023-02-24 ec1a74625890ff771fc5e46e39a15deaf618b479
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/**
 * 历史对比控件按钮
 * @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;
});