TalkingData / inmap

大数据地理可视化

Home Page:https://fengluhome.github.io/inmap-doc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

飞线图点击事件?

531431988 opened this issue · comments

image
如图上标注的每个点能添加点击事件吗

demo code:
`

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) {
                alert(item)
                }
            }
        },
        line: { //线的配置
            style: {
                normal: {
                    borderColor: 'rgba(200, 200, 50, 1)',
                    borderWidth: 1,
                    // shadowColor: 'rgba(255, 250, 50, 1)',
                    // shadowBlur: 20,
                    lineOrCurive: "curve"
                }
            }
        },
        lineAnimation: {
            style: {
                size: 2,
                //移动点颜色
                fillColor: '#fff',
                //移动点阴影颜色
                shadowColor: '#fff',
                //移动点阴影大小
                shadowBlur: 10,
                lineOrCurve: 'curve',
            }

        },
    },
    data: data,

});
inmap.add(overlay); 

`