Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

飞线图remove图层时,飞线动画(LineStringAnimationOverlay)没有一起移除,代码如下 #26

Closed
iamllitog opened this issue Aug 3, 2018 · 0 comments

Comments

@iamllitog
Copy link
Contributor

let data = [{"from":{"name":"广州","coordinates":[113.270793,23.135308]},"to":{"name":"衡山","coordinates":[112.612787,27.317599]},"count":1},{"from":{"name":"广州","coordinates":[113.270793,23.135308]},"to":{"name":"北京","coordinates":[116.413554,39.911013]},"count":2},{"from":{"name":"广州","coordinates":[113.270793,23.135308]},"to":{"name":"三亚","coordinates":[109.518646,18.258217]},"count":3},{"from":{"name":"广州","coordinates":[113.270793,23.135308]},"to":{"name":"上海","coordinates":[121.480237,31.236305]},"count":4},{"from":{"name":"广州","coordinates":[113.270793,23.135308]},"to":{"name":"韶关","coordinates":[113.603757,24.816174]},"count":4}] 
var inmap = new inMap.Map({
    id: 'allmap',
    skin: "Blueness",
    center: [112.03956, 26.063677],
    zoom: {
        value: 6,
        show: true,
        max: 18,
        min: 5
    },
});
var overlay = new inMap.MoveLineOverlay({
    style: {
        point: { //散点配置
            tooltip: {
                show: true,
                formatter: "{name}"
            },
            style: {
                normal: {
                    backgroundColor: 'rgba(200, 200, 50, 1)',
                    borderWidth: 1,
                    borderColor: "rgba(255,255,255,1)",
                    size: 6,
                    label: {
                        show: true,
                        color: 'rgba(255,255,255,1)'

                    },
                },
                mouseOver: {
                    backgroundColor: 'rgba(200, 200, 200, 1)',
                    borderColor: "rgba(255,255,255,1)",
                    borderWidth: 4,
                },
                selected: {
                    backgroundColor: 'rgba(184,0,0,1)',
                    borderColor: "rgba(255,255,255,1)"
                },
            },
            event: {
                onMouseClick: function (item) {}
            }
        },
        line: { //线的配置
            style: {
                normal: {
                    borderColor: 'rgba(200, 200, 50, 1)',
                    borderWidth: 1,
                    // shadowColor: 'rgba(255, 250, 50, 1)',
                    // shadowBlur: 20,
                    lineCurive: "curve"
                }
            }
        },
        lineAnimation: {
            style: {
                size: 2,
                //移动点颜色
                fillColor: '#fff',
                //移动点阴影颜色
                shadowColor: '#fff',
                //移动点阴影大小
                shadowBlur: 10,
                lineOrCurve: 'curve',
            }

        },
    },
    data: data,

});
inmap.add(overlay); 
setTimeout(function() {
  inmap.remove(overlay);
},3000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant