Skip to content

Commit

Permalink
submit code
Browse files Browse the repository at this point in the history
  • Loading branch information
beginner-fei committed May 7, 2020
1 parent cafcf51 commit 9f10be5
Show file tree
Hide file tree
Showing 9 changed files with 1,864 additions and 4 deletions.
279 changes: 279 additions & 0 deletions chaoxi/Earth_view/guizhou_map_3d.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Awesome-pyecharts</title>
<script type="text/javascript" src="https://assets.pyecharts.org/assets/echarts.min.js"></script>
<script type="text/javascript" src="https://assets.pyecharts.org/assets/echarts-gl.min.js"></script>
<script type="text/javascript" src="https://assets.pyecharts.org/assets/maps/guizhou.js"></script>

</head>
<body>
<div id="1422512d69694e5d865817ea3afc1868" class="chart-container" style="width:1200px; height:1200px;"></div>
<script>
var chart_1422512d69694e5d865817ea3afc1868 = echarts.init(
document.getElementById('1422512d69694e5d865817ea3afc1868'), 'white', {renderer: 'canvas'});
var option_1422512d69694e5d865817ea3afc1868 = {
"animation": true,
"animationThreshold": 2000,
"animationDuration": 1000,
"animationEasing": "cubicOut",
"animationDelay": 0,
"animationDurationUpdate": 300,
"animationEasingUpdate": "cubicOut",
"animationDelayUpdate": 0,
"color": [
"#c23531",
"#2f4554",
"#61a0a8",
"#d48265",
"#749f83",
"#ca8622",
"#bda29a",
"#6e7074",
"#546570",
"#c4ccd3",
"#f05b72",
"#ef5b9c",
"#f47920",
"#905a3d",
"#fab27b",
"#2a5caa",
"#444693",
"#726930",
"#b2d235",
"#6d8346",
"#ac6767",
"#1d953f",
"#6950a1",
"#918597"
],
"series": [
{
"type": "lines3D",
"coordinateSystem": "geo3D",
"geo3DIndex": 0,
"globeIndex": 0,
"polyline": false,
"effect": {
"show": true,
"period": 4,
"trailWidth": 3,
"trailLength": 0.5,
"trailColor": "#f00",
"trailOpacity": 1
},
"lineStyle": {
"show": true,
"width": 1,
"opacity": 1,
"curveness": 0,
"type": "solid"
},
"data": [
[
[
106.70722,
26.5982,
1000
],
[
106.63024,
26.64702,
1000
]
],
[
[
104.83023,
26.59336
],
[
106.92723,
27.72545
]
],
[
[
105.30504,
27.29847
],
[
107.52034,
26.29322
]
],
[
[
107.89868,
26.52881
],
[
104.948571,
25.077502
]
],
[
[
105.9462,
26.25367
],
[
109.18099,
27.69066
]
]
],
"blendMode": "source-over",
"zlevel": -10,
"silent": false
}
],
"legend": [
{
"data": [
""
],
"selected": {
"": true
},
"show": true,
"padding": 5,
"itemGap": 10,
"itemWidth": 25,
"itemHeight": 14
}
],
"tooltip": {
"show": true,
"trigger": "item",
"triggerOn": "mousemove|click",
"axisPointer": {
"type": "line"
},
"textStyle": {
"fontSize": 14
},
"borderWidth": 0
},
"geo3D": {
"map": "\u8d35\u5dde",
"boxWidth": 100,
"boxHeight": 10,
"regionHeight": 3,
"groundPlane": {
"show": false,
"color": "#aaa"
},
"instancing": false,
"itemStyle": {
"color": "rgb(5,101,123)",
"borderColor": "rgb(62,215,213)",
"borderWidth": 0.8,
"opacity": 1
},
"emphasis": {},
"light": {
"main": {
"color": "#fff",
"intensity": 1.2,
"shadow": true,
"shadowQuality": "medium",
"alpha": 55,
"beta": 10
},
"ambient": {
"color": "#fff",
"intensity": 0.3
},
"ambientCubemap": {
"diffuseIntensity": 0.5,
"specularIntensity": 0.5
}
},
"postEffect": {
"enable": true,
"bloom": {
"enable": false,
"bloomIntensity": 0.1
},
"depthOfField": {
"enable": false,
"focalDistance": 50,
"focalRange": 20,
"fstop": 2.8,
"blurRadius": 10
},
"SSAO": {
"enable": false,
"quality": "medium",
"radius": 2,
"intensity": 1
},
"colorCorrection": {
"enable": false,
"exposure": 0,
"brightness": 0,
"contrast": 1,
"saturation": 1
},
"FXAA": {
"enable": false
}
},
"temporalSuperSampling": {
"enable": "auto"
},
"viewControl": {
"projection": "perspective",
"autoRotate": false,
"autoRotateDirection": "cw",
"autoRotateSpeed": 10,
"autoRotateAfterStill": 3,
"damping": 0.8,
"rotateSensitivity": 1,
"zoomSensitivity": 1,
"panSensitivity": 1,
"panMouseButton": "left",
"rotateMouseButton": "middle",
"distance": 100,
"minDistance": 40,
"maxDistance": 400,
"orthographicSize": 100,
"minOrthographicSize": 20,
"maxOrthographicSize": 400,
"alpha": 40,
"beta": 0,
"center": [
-10,
0,
10
],
"minAlpha": 5,
"maxAlpha": 90,
"minBeta": -80,
"maxBeta": 80,
"animation": true,
"animationDurationUpdate": 1000,
"animationEasingUpdate": "cubicInOut"
},
"zlevel": -10,
"left": "auto",
"top": "auto",
"right": "auto",
"bottom": "auto",
"width": "auto",
"height": "auto"
},
"title": [
{
"text": "Map3D-GuiZhou3D",
"padding": 5,
"itemGap": 10
}
]
};
chart_1422512d69694e5d865817ea3afc1868.setOption(option_1422512d69694e5d865817ea3afc1868);
</script>
</body>
</html>
52 changes: 52 additions & 0 deletions chaoxi/Earth_view/guizhou_map_3d.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from pyecharts import options as opts
from pyecharts.charts import Map3D
from pyecharts.globals import ChartType

# 写入省份内各地区经纬度
example_data = [
[[106.70722,26.59820, 1000],[106.63024, 26.64702, 1000]],
[[104.83023, 26.59336], [106.92723, 27.72545]],
[[105.30504, 27.29847], [107.52034, 26.29322]],
[[107.89868, 26.52881], [104.948571, 25.077502]],
[[105.9462, 26.25367], [109.18099, 27.69066]],
]
# 添加 3D 地图
c = (
Map3D(init_opts=opts.InitOpts(width='1200px', height='1200px'))
.add_schema(
maptype="贵州",
itemstyle_opts=opts.ItemStyleOpts(
color="rgb(5,101,123)",
opacity=1,
border_width=0.8,
border_color="rgb(62,215,213)",
),
light_opts=opts.Map3DLightOpts(
main_color="#fff",
main_intensity=1.2,
is_main_shadow=True,
main_alpha=55,
main_beta=10,
ambient_intensity=0.3,
),
view_control_opts=opts.Map3DViewControlOpts(center=[-10, 0, 10]),
post_effect_opts=opts.Map3DPostEffectOpts(is_enable=True),

)
.add(
series_name="",
data_pair=example_data,
type_=ChartType.LINES3D,
effect=opts.Lines3DEffectOpts(
is_show=True,
period=4,
trail_width=3,
trail_length=0.5,
trail_color="#f00",
trail_opacity=1,
),
label_opts=opts.LabelOpts(is_show=True),
)
.set_global_opts(title_opts=opts.TitleOpts(title="Map3D-GuiZhou3D"))
.render("guizhou_map_3d.html")
)
Loading

0 comments on commit 9f10be5

Please sign in to comment.