zengh
2022-05-16 63ad2c3598400370dd7da5534659fd7e768a0a4a
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//处理IE8以前版本不支持console.log()方法
if (!window["console"]) {
    window["console"] = {
        log: function () {
        }
    };
}
 
//检测用户的浏览器版本
function checkBrowder() {
    if (navigator.userAgent.indexOf("Opera") != -1) {
        alert('Opera');
    }
    else if (navigator.userAgent.indexOf("MSIE") != -1) {
        var ieversion = checkIEVersion();
        if (ieversion < 9) {
            alert('为了使您得到更好的用户体验,建议您使用IE9.0及以上版本的IE、火狐(Firefox)浏览器或Chrome浏览器。');
        }
    }
    else if (navigator.userAgent.indexOf("Firefox") != -1) {
    }
    else if (navigator.userAgent.indexOf("Netscape") != -1) {
    }
    else if (navigator.userAgent.indexOf("Chrome") != -1) {
        console.log("Chrome");
    }
    else if (navigator.userAgent.indexOf("Safari") != -1) {
    }
    else {
        if (isIE11()) {
 
        }
        else {
            alert('无法识别您的浏览器类型,为了使您得到更好的用户体验,建议您使用IE9.0及以上版本的IE、火狐(Firefox)浏览器或Chrome浏览器。');
        }
    }
}
 
function checkIEVersion() {
    var ua = navigator.userAgent;
    var b = ua.indexOf("MSIE ");
    if (b < 0) {
        return 0;
    }
    var v = parseFloat(ua.substring(b + 5, ua.indexOf(";", b)));
    return v;
}
 
function isIE11() {
    return ("ActiveXObject" in window);
}
 
checkBrowder();
String.prototype.trim = function () {
 
    return this.replace(/(^\s*)|(\s*$)/g, '');
}
var getIndexUrl = function (app) {
    var indexPath = location.protocol + "//" + location.host + app;
    return indexPath;
};
 
function uuid() {
    var s = [];
    var hexDigits = "0123456789abcdef";
    for (var i = 0; i < 36; i++) {
        s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
    }
    s[14] = "4";  // bits 12-15 of the time_hi_and_version field to 0010
    s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);  // bits 6-7 of the clock_seq_hi_and_reserved to 01
    s[8] = s[13] = s[18] = s[23] = "-";
 
    var uuid = s.join("");
    return uuid;
}
 
var baseUrl = getIndexUrl("/map");
// var baseUrl = getIndexUrl("/views/map");
//var baseUrl = getIndexUrl("/wnga/Police");
dojoConfig = {
    parseOnLoad: false,
    async: true,
    packages: [
        // Any references to a "demo" resource should load modules locally, *not* from CDN
        {
            name: "base",
            location: baseUrl + "/core"
        },
        {
            name: "manager",
            location: baseUrl + "/core/manager"
        },
        {
            name: "widgets",
            location: baseUrl + "/widgets"
        },
        {
            name: "esrichina",
            location: baseUrl + "/core/esrichina"
        },
        {
            name: "controls",
            location: baseUrl + "/controls"
        },
        {
            name: "utils",
            location: baseUrl + "/core/utils"
        }
    ]
};