SuperMap.Include.js
2.93 KB
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
(function() {
var isWinRT = (typeof Windows === "undefined") ? false : true;
var r = new RegExp("(^|(.*?\\/))(SuperMap.Include\.js)(\\?|$)"),
s = document.getElementsByTagName('script'),
src, m, baseurl = "";
for(var i=0, len=s.length; i<len; i++) {
src = s[i].getAttribute('src');
if(src) {
var m = src.match(r);
if(m) {
baseurl = m[1];
break;
}
}
}
function inputScript(inc){
if (!isWinRT) {
var script = '<' + 'script type="text/javascript" src="' + inc + '"' + '><' + '/script>';
document.writeln(script);
} else {
var script = document.createElement("script");
script.src = inc;
document.getElementsByTagName("HEAD")[0].appendChild(script);
}
}
function inputCSS(style){
if (!isWinRT) {
var css = '<' + 'link rel="stylesheet" href="' + baseurl + '../theme/default/' + style + '"' + '><' + '/>';
document.writeln(css);
} else {
var link = document.createElement("link");
link.rel = "stylesheet";
link.href = "/theme/default/" + style;
document.getElementsByTagName("HEAD")[0].appendChild(link);
}
}
function inputMyCSS(style){
if (!isWinRT) {
var css = '<' + 'link rel="stylesheet" href="' + style + '"' + '><' + '/>';
document.writeln(css);
} else {
var link = document.createElement("link");
link.rel = "stylesheet";
link.href = style;
document.getElementsByTagName("HEAD")[0].appendChild(link);
}
}
//加载类库资源文件
function loadSMLibs() {
inputCSS('style.css');
inputCSS('google.css');
// inputScript(baseurl+'SuperMap_Basic-8.1.1-15216.js');
// inputScript(baseurl+'SuperMap_Visualization-8.1.1-15216.js');
inputScript(baseurl+"/SuperMap-8.1.0-14126.js");
// inputScript(baseurl+"/SuperMap_Basic-8.1.1-15216.js");
// inputScript(baseurl+"/SuperMap_Visualization-8.1.1-15216.js");
// inputScript(baseurl+'SuperMap-8.0.2-13626.js');
// inputScript(baseurl+'SelectFeature.js');
// inputScript(baseurl+'Feature.js');
inputScript(baseurl+'CloudLayer.js');
inputScript(baseurl+'jquery.min.js');
inputScript(baseurl+'layer/Baidu.js');
/*inputScript(baseurl+'Class.js');
inputScript(baseurl+'Snap.js');*/
// inputScript("http://api.map.baidu.com/api?v=2.0&ak=214c94f370aa31822201489ae44e4018");
// inputScript(baseurl+'baidu/bmap.min.js');
// inputScript(baseurl+'baidu/mapv.min.js');
// inputScript(baseurl+'baidu/dat.gui.js');
}
//引入汉化资源文件
function loadLocalization() {
inputScript(baseurl + 'Lang/zh-CN.js');
}
loadSMLibs();loadLocalization();
})();