apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.59k stars 19.62k forks source link

Echarts4.0的ScatterGL类型,如何使用mapbox作为底图? #7923

Closed yutozh closed 3 years ago

yutozh commented 6 years ago

One-line summary [问题简述]

用Echarts4.0的ScatterGL类型显示10000000个GPS数据点,官方示例的coordinateSystem是用的‘geo’,但如果改成mapbox,则会报错(已经引用了mapbox-gl脚本): Uncaught (in promise) TypeError: Cannot read property '0' of undefined at PointsBuilder.update (echarts-gl.js?3dd9:23605) at ExtendedClass.render (echarts-gl.js?3dd9:51321) at Task.progress [as _progress] (Chart.js?6258:228) at Task.taskProto.perform (task.js?815e:89) at eval (echarts.js?21c7:1330) at ExtendedClass.eval (Global.js?46d7:479) at Array.forEach () at each (util.js?fe0c:298) at ExtendedClass.eachSeries (Global.js?46d7:476) at renderSeries (echarts.js?21c7:1320)

请问如果想使用‘mapbox’,应该如何配置?

Version & Environment [版本及环境]

Expected behaviour [期望结果]

以mapbox为底图,实现用ScatterGL类型显示10000000个GPS点(即ScatterGL的官方示例)。

ECharts option [ECharts配置项]

option = {
backgroundColor: '#000',
            title: {
              text: '10000000 GPS Points',
              left: 'center',
              textStyle: {
                color: '#fff'
              }
            },
            mapbox: {
              center: [114.3017578125,30.5906370269],
              zoom: 4.2,
              style: 'mapbox://styles/mapbox/dark-v9',
              boxHeight: 2
            },
            series: [{
              name: '弱',
              type: 'scatterGL',
              progressive: 1e6,
              coordinateSystem: 'mapbox',
              symbolSize: 1,
              zoomScale: 0.2,
              blendMode: 'lighter',
              large: true,
              itemStyle: {
                color: 'rgb(200, 15, 2)'
              },
              postEffect: {
                enable: true
              },
              silent: true,
              // dimensions: ['lng', 'lat'],
              // data: new Float32Array()
              data: [121.46106499999999, 30.911165999999998,
                120.22291499999999, 30.202965999999996]
            }]
}

Other comments [其他信息]

huohuli008 commented 5 years ago

我估计是mapbox是三维的,而scatterGL只是二维的散点图,所以无法支持,只能考虑使用scatter3D,但是貌似效果也不太好,那些symbol在三维下呈现不好。

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] commented 3 years ago

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!