您当前的位置: 首页 >  ar

262Echarts - 3D 路径图(Flights on Geo3D)

杨林伟 发布时间:2019-05-06 11:11:15 ,浏览量:3

效果图

在这里插入图片描述

源代码
$.getJSON('data-gl/asset/data/flights.json', function(data) {
    function getAirportCoord(idx) {
        return [data.airports[idx][3], data.airports[idx][4]];
    }
    var routes = data.routes.map(function(airline) {
        return [
            getAirportCoord(airline[1]),
            getAirportCoord(airline[2])
        ];
    });

    myChart.setOption({
        geo3D: {
            map: 'world',
            shading: 'color',

            environment: 'data-gl/asset/starfield.jpg',

            silent: true,

            groundPlane: {
                show: false
            },
            light: {
                main: {
                    intensity: 0
                },
                ambient: {
                    intensity: 0
                }
            },
            viewControl: {
                distance: 50
            },

            itemStyle: {
                areaColor: '#111'
            },

            boxHeight: 0.5
        },
        series: [{
            type: 'lines3D',

            coordinateSystem: 'geo3D',

            effect: {
                show: true,
                trailWidth: 2,
                trailLength: 0.2
            },

            blendMode: 'lighter',

            lineStyle: {
                width: 0,
                color: 'rgb(50, 50, 150)',
                opacity: 0.2
            },

            data: routes
        }]
    });
});

window.addEventListener('keydown', function () {
    myChart.dispatchAction({
        type: 'lines3DToggleEffect',
        seriesIndex: 0
    });
});
关注
打赏
1688896170
查看更多评论

杨林伟

暂无认证

  • 3浏览

    0关注

    3183博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0554s