Toggle navigation
北京人口分布24小时潮汐
By
k***3
2019-01-03 07:47:56
脚本
16
21
作品使用的第三方脚本
https://api.mapbox.com/mapbox-gl-js/v0.38.0/mapbox-gl.js,http://echarts.baidu.com/resource/echarts-gl-latest/mapboxgl-token.js,http://echarts.baidu.com/gallery/vendors/echarts-gl/echarts-gl.min.js,https://libs.baidu.com/jquery/2.1.1/jquery.min.js,https://cdn.jsdelivr.net/npm/maptalks@0.39.3/dist/maptalks.min.js,https://deyihu.github.io/src/lib/echarts-gl.1.1.3.js?tdsourcetag=s_pctim_aiomsg
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
var uploadedDataURL = "/asset/get/s/data-1546499666218-RE8mF8aP8.json"; var MapboxStyleDataURL = "/asset/get/s/data-1546500855305-wBxWgJRZc.json"; myChart.showLoading(); var option = { baseOption: { timeline: { axisType: 'category', orient: 'vertical', autoPlay: true, inverse: true, playInterval: 300, left: null, right: 0, top: null, bottom: 50, width: 55, height: null, label: { normal: { textStyle: { color: '#fff' } }, emphasis: { textStyle: { color: '#aaa' } } }, symbol: 'circle', lineStyle: { color: '#555' }, checkpointStyle: { color: '#bbb', borderColor: '#777', borderWidth: 2 }, controlStyle: { normal: { color: '#666', borderColor: '#666' }, emphasis: { color: '#aaa', borderColor: '#aaa' } }, data: [] }, title: { text: "北京人口分布24小时潮汐", textStyle: { color: '#fff', fontSize: 30 }, right: '5%' }, visualMap: { show: false, calculable: true, realtime: false, inRange: { color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026'] }, outOfRange: { colorAlpha: 0 } }, maptalks3D: { center: [116.368655, 39.917726], zoom: 9, pitch: 40, urlTemplate: 'http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}', // altitudeScale: 1, postEffect: { enable: true, FXAA: { enable: true } }, light: { main: { intensity: 1, shadow: true, shadowQuality: 'high' }, ambient: { intensity: 0. }, ambientCubemap: { texture: '/asset/get/s/data-1491838644249-ry33I7YTe.hdr', exposure: 1, diffuseIntensity: 0.5, specularIntensity: 2 } } }, series: [{ type: 'bar3D', shading: 'realistic', coordinateSystem: 'maptalks3D', silent: true, barSize: 1.5, silent: true }] }, options: [] //timeline所用的多个option存放处,读取数据后添加 } $.getJSON(uploadedDataURL, function(linedata) { //读取24小时数据 myChart.hideLoading(); var timeline = []; for (var n = 0; n < linedata.features.length; n++) { //对数据中每天数据整理后添加到options中,以便timeline使用 timedata = linedata.features[n].gridChart_list; var data = [] var max = linedata.features[n].max; for (var i = 0; i < timedata.length; i += 1) { var _pheight = 1000; loncol = timedata[i].lon //经度 latcol = timedata[i].lat //纬度 var _v = JSON.parse(timedata[i].values); var value; var value = _v[0] + _v[1] + _v[2]; //数组中值相加 count = value / 2; data.push({ 'value': [loncol, latcol, count] }) } timeline.push(linedata.features[n].time); //时间(0时到24时) option.options.push({ visualMap: { max: max / 2 }, series: [{ data: data }] }); } option.baseOption.timeline.data = timeline; //时间轴 if (option && typeof option === "object") { myChart.setOption(option, true); } });