Skip to content

Commit c7aa2f0

Browse files
committed
新增新版中国2000的mapboxgl的配置及其说明
2 parents 6314385 + 3e3494e commit c7aa2f0

10 files changed

Lines changed: 497 additions & 8 deletions

config/config-cesium.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var config = {
1+
var CESIUM_CONFIG = config = {
22
name: "",
33
title: "MapGIS WebClinet-Cesium演示网站",
44
mapmode: "cesium",
@@ -227,7 +227,7 @@ var config = {
227227
name: "可视域分析",
228228
file: "viewshedAn",
229229
diffcult: "3",
230-
detail: "",
230+
detail: "www.smaryun.com",
231231
icon: "viewshedAn.png",
232232
person: "基础平台-韩彦生",
233233
update: "最后更新时间:2018-07-09"
@@ -760,4 +760,4 @@ var config = {
760760
}]
761761
}
762762
]
763-
};
763+
};

config/config-leaflet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var config = {
1+
var LEAFLET_CONFIG = config = {
22
name: "",
33
title: "MapGIS WebClinet-Leaflet演示网站",
44
mapmode: "leaflet",

config/config-mapboxgl.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var config = {
1+
var MAPBOXGL_CONFIG = config = {
22
name: "",
33
title: "MapGIS WebClinet-MapboxGL演示网站",
44
mapmode: "mapbox",
@@ -2057,6 +2057,22 @@ var config = {
20572057
detail: "通过webgl直接绘制的方式,显示电力线绘制",
20582058
icon: "line.png",
20592059
update: "最后更新时间:2018-01-02"
2060+
},
2061+
{
2062+
name: "加载地形",
2063+
file: "dem",
2064+
diffcult: "1",
2065+
detail: "通过dem加上内部制图优化的样式实现地形",
2066+
icon: "dem.png",
2067+
update: "最后更新时间:2018-01-12"
2068+
},
2069+
{
2070+
name: "实时计算速度,轨迹",
2071+
file: "speed",
2072+
diffcult: "1",
2073+
detail: "通过实时插值的方式实现计算速度,轨迹",
2074+
icon: "speed.png",
2075+
update: "最后更新时间:2018-01-15"
20602076
}
20612077
]
20622078
}

config/config-openlayers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var config = {
1+
var OPENLAYERS_CONFIG = config = {
22
name: "",
33
title: "MapGIS WebClinet-OpenLayers3演示网站",
44
mapmode: "openlayers",

js/charts.js

Lines changed: 299 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,299 @@
1+
function colorMappingChange(value) {
2+
var levelOption = getLevelOption(value);
3+
chart.setOption({
4+
series: [
5+
{
6+
levels: levelOption
7+
}
8+
]
9+
});
10+
}
11+
12+
var formatUtil = echarts.format;
13+
14+
function getLevelOption() {
15+
return [
16+
{
17+
itemStyle: {
18+
normal: {
19+
borderWidth: 0,
20+
gapWidth: 5
21+
}
22+
}
23+
},
24+
{
25+
itemStyle: {
26+
normal: {
27+
gapWidth: 1
28+
}
29+
}
30+
},
31+
{
32+
colorSaturation: [0.35, 0.5],
33+
itemStyle: {
34+
normal: {
35+
gapWidth: 1,
36+
borderColorSaturation: 0.6
37+
}
38+
}
39+
}
40+
];
41+
}
42+
43+
function initCube(config, divid, name) {
44+
var data = config.childs.map(item => {
45+
if (item.leaffolder) {
46+
var diff = 0;
47+
var first = item.childs.map(e => {
48+
diff += parseInt(e.diffcult);
49+
return {
50+
name: e.name,
51+
value: e.diffcult,
52+
path: item.name + "/" + e.name,
53+
url: item.folder + "-" + e.file
54+
};
55+
});
56+
return { children: first, name: item.name, value: diff, path: item.name };
57+
} else {
58+
var first = item.childs.map(child => {
59+
var diff = 0;
60+
var second = child.childs.map(e => {
61+
diff += parseInt(e.diffcult);
62+
return {
63+
name: e.name,
64+
value: e.diffcult,
65+
path: item.name + "/" + child.name + "/" + e.name,
66+
url: item.folder + "-" + child.folder + "-" + e.file
67+
};
68+
});
69+
return {
70+
children: second,
71+
name: child.name,
72+
value: diff,
73+
path: item.name + "/" + child.name
74+
};
75+
});
76+
return { children: first, name: item.name, path: item.name };
77+
}
78+
});
79+
80+
var myChart = echarts.init(document.getElementById(divid), "light");
81+
myChart.on("click", function(params) {
82+
window.open("../ui/demos-" + name + ".html#" + params.data.url);
83+
});
84+
myChart.setOption(
85+
(option = {
86+
title: {
87+
text: name,
88+
left: "center"
89+
},
90+
91+
tooltip: {
92+
formatter: function(info) {
93+
var value = info.value;
94+
var treePathInfo = info.treePathInfo;
95+
var treePath = [];
96+
97+
for (var i = 1; i < treePathInfo.length; i++) {
98+
treePath.push(treePathInfo[i].name);
99+
}
100+
101+
return [
102+
'<div class="tooltip-title">' +
103+
formatUtil.encodeHTML(treePath.join("/")) +
104+
"</div>",
105+
"难度等级: " + formatUtil.addCommas(value) + " 星"
106+
].join("");
107+
}
108+
},
109+
110+
series: [
111+
{
112+
name: name,
113+
type: "treemap",
114+
visibleMin: 300,
115+
label: {
116+
show: true,
117+
formatter: "{b}"
118+
},
119+
upperLabel: {
120+
normal: {
121+
show: true,
122+
height: 30,
123+
color: "#000"
124+
}
125+
},
126+
itemStyle: {
127+
normal: {
128+
borderColor: "#fff"
129+
}
130+
},
131+
levels: getLevelOption(),
132+
data: data
133+
}
134+
]
135+
})
136+
);
137+
}
138+
139+
function initTree(config, divid, name) {
140+
var data = config.childs.map(item => {
141+
if (item.leaffolder) {
142+
var diff = 0;
143+
var first = item.childs.map(e => {
144+
diff += parseInt(e.diffcult);
145+
return {
146+
name: e.name,
147+
value: e.diffcult,
148+
path: item.name + "/" + e.name
149+
};
150+
});
151+
return { children: first, name: item.name, value: diff, path: item.name };
152+
} else {
153+
var first = item.childs.map(child => {
154+
var diff = 0;
155+
var second = child.childs.map(e => {
156+
diff += parseInt(e.diffcult);
157+
return {
158+
name: e.name,
159+
value: e.diffcult,
160+
path: item.name + "/" + child.name + "/" + e.name
161+
};
162+
});
163+
return {
164+
children: second,
165+
name: child.name,
166+
value: diff,
167+
path: item.name + "/" + child.name
168+
};
169+
});
170+
return { children: first, name: item.name, path: item.name };
171+
}
172+
});
173+
174+
var treedata = { name: name, children: data };
175+
176+
var myChart = echarts.init(document.getElementById(divid), "light");
177+
178+
myChart.setOption(
179+
(option = {
180+
tooltip: {
181+
trigger: "item",
182+
triggerOn: "mousemove"
183+
},
184+
series: [
185+
{
186+
type: "tree",
187+
name: name,
188+
data: [treedata],
189+
top: "5%",
190+
left: "30%",
191+
bottom: "5%",
192+
right: "30%",
193+
symbolSize: 7,
194+
label: {
195+
normal: {
196+
position: "left",
197+
verticalAlign: "middle",
198+
align: "right"
199+
}
200+
},
201+
leaves: {
202+
label: {
203+
normal: {
204+
position: "right",
205+
verticalAlign: "middle",
206+
align: "left"
207+
}
208+
}
209+
},
210+
expandAndCollapse: true,
211+
animationDuration: 550,
212+
animationDurationUpdate: 750
213+
}
214+
]
215+
})
216+
);
217+
}
218+
219+
function initBar(config, divid, name) {
220+
var data = config.childs.map(item => {
221+
if (item.leaffolder) {
222+
var diff = 0;
223+
var first = item.childs.map(e => {
224+
diff += parseInt(e.diffcult);
225+
return {
226+
name: e.name,
227+
value: e.diffcult,
228+
path: item.name + "/" + e.name
229+
};
230+
});
231+
return { children: first, name: item.name, value: diff, path: item.name };
232+
} else {
233+
var first = item.childs.map(child => {
234+
var diff = 0;
235+
var second = child.childs.map(e => {
236+
diff += parseInt(e.diffcult);
237+
return {
238+
name: e.name,
239+
value: e.diffcult,
240+
path: item.name + "/" + child.name + "/" + e.name
241+
};
242+
});
243+
return {
244+
children: second,
245+
name: child.name,
246+
value: diff,
247+
path: item.name + "/" + child.name
248+
};
249+
});
250+
return { children: first, name: item.name, path: item.name };
251+
}
252+
});
253+
254+
var myChart = echarts.init(document.getElementById(divid), "light");
255+
256+
myChart.setOption(
257+
(option = {
258+
series: {
259+
type: "sunburst",
260+
highlightPolicy: "ancestor",
261+
data: data,
262+
radius: [0, "95%"],
263+
sort: null,
264+
levels: [
265+
{},
266+
{
267+
r0: "15%",
268+
r: "35%",
269+
itemStyle: {
270+
borderWidth: 1
271+
},
272+
label: {
273+
rotate: "tangential"
274+
}
275+
},
276+
{
277+
r0: "35%",
278+
r: "70%",
279+
label: {
280+
align: "right"
281+
}
282+
},
283+
{
284+
r0: "70%",
285+
r: "72%",
286+
label: {
287+
position: "outside",
288+
padding: 3,
289+
silent: false
290+
},
291+
itemStyle: {
292+
borderWidth: 3
293+
}
294+
}
295+
]
296+
}
297+
})
298+
);
299+
}

libs/zondyclient/include-lib-local.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
if (inArray(includes, 'proj4')) {
8989
inputScript(httpUrl + "/cdn/proj4/proj4.js");
9090
}
91+
if (inArray(includes, 'echarts')) {
92+
inputScript(httpUrl + "/cdn/echarts/echarts.min.js");
93+
}
9194
if (inArray(includes, 'checkjs')) {
9295
inputScript(httpUrl + "/cdn/checkjs/checkjs.js");
9396
}

libs/zondyclient/include-lib.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@
8989
if (inArray(includes, 'turf')) {
9090
inputScript(httpUrl + "/cdn/turf/turf.min.js");
9191
}
92-
92+
if (inArray(includes, 'echarts')) {
93+
inputScript("https://cdn.bootcss.com/echarts/4.2.0-rc.2/echarts-en.common.js");
94+
}
9395
if (inArray(includes, 'proj4')) {
9496
inputScript(httpUrl + "/cdn/proj4/proj4.js");
9597
}

ui/header.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
<a href="./total-detailservice.html" class="dropdown-item">
3232
<i class="material-icons">layers</i> 详细服务
3333
</a>
34-
34+
<a href="./total-charts.html" class="dropdown-item">
35+
<i class="material-icons">layers</i> 详细图表
36+
</a>
3537
<a href="./total-plugins.html" class="dropdown-item">
3638
<i class="material-icons">dns</i> 插件列表
3739
</a>

0 commit comments

Comments
 (0)