xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.1k stars 195 forks source link

globe viewControl alpha and beta properties doesn't work #223

Open Kucy74 opened 4 years ago

Kucy74 commented 4 years ago

Hi! I'm using ngx-echarts with echarts-gl. It seems, that alpha and beta properties does nothing in globe viewControl.

this.seriesData = [{
    type: 'lines3D',
    effect: {
        show: true,
        trailWidth: 2,
        trailLength: 0.12,
        trailOpacity: 1,
        trailColor: 'rgb(30, 30, 60)'
    },
    lineStyle: {
        width: 2,
        color: 'rgb(50, 50, 150)',
        opacity: 0.4
    },
    blendMode: 'lighter',
    data: [[[13,52],[19,47]],[[17,43],[19,47]]]
}];

this.options = {
    color: #fff,
    backgroundColor: '#1f283a',
    globe: {
        show: true,
        zlevel: -10,
        baseTexture: 'assets/images/earth.jpg', //worldbathy.jpg
        heightTexture: 'assets/images/earth.jpg', //bathymetry4k.jpg

        shading: 'lambert',

        light: {
            ambient: {
                intensity: 0.4
            },
            main: {
                intensity: 0.4
            }
        },

        globeRadius: 200,
        viewControl: {
            autoRotate: false,
            targetCoord: [21.255592,27.436933],
            distance: 150,
            alpha: 30, // not rotating up or down
            beta: -30 // not rotating left or right
        }
    },
    series: this.seriesData
};

Can you check, that this properties working you well, or i missing something? In the original echart site its working nicely : https://echarts.apache.org/examples/en/editor.html?c=lines3d-flights&gl=1

Thx.

xieziyu commented 4 years ago

@Kucy74 Because you have already set targetCoord: [21.255592,27.436933]. Documents here: https://echarts.apache.org/en/option-gl.html#globe.viewControl.targetCoord

Kucy74 commented 4 years ago

Ok i see. But what to do when i need to show a specific coordinate in Europe fixed (no need rotation)? If i don't set targetCoord, than i getting center by default on Hawaii ... My plan was that i setting targetCoord, than i just "rotate" the globe a bit upwards with alpha to see the plan routes a bit curvy.

Any good advice to achive this?