Incubator-echarts: echarts3能否响应鼠标滚轮事件

Created on 18 Mar 2016  ·  6Comments  ·  Source: apache/incubator-echarts

使用 echarts3 在地图上显示内容的时候,希望能够捕捉到用户的滚轮动作,这样在地图放大缩小的时候能够进行响应。

目前好像不支持 onmousewheel 之类的事件。

Most helpful comment

可以使用 myChart.getZr() 获得的 zr 实例监听 mousewheel 事件

myChart.getZr().on('mousewheel', function () {} )

也可以监听地图缩放的 action 事件

myChart.on('georoam', function () {} );

All 6 comments

可以使用 myChart.getZr() 获得的 zr 实例监听 mousewheel 事件

myChart.getZr().on('mousewheel', function () {} )

也可以监听地图缩放的 action 事件

myChart.on('georoam', function () {} );

@pissang 事件响应函数里面,如何拿到 geo 当前的 scale ,为什么拿到的 zoom 不是 0.9090909090909091 就是 1.1

@xiaoDC 为什么拿到的zoom一直是1.1啊,怎么解决啊

算了,只能通过getOption().geo[0].zoom

@ArrayZheng 放大的时候每次拿到的都是 1.1,这个是源码里面写死的,我是求累乘值。

@pissang bmap上的地图缩放不能响应 georoam 事件,有别的办法吗?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antorman picture antorman  ·  3Comments

decadef20 picture decadef20  ·  3Comments

arssam picture arssam  ·  3Comments

kirazxyun picture kirazxyun  ·  3Comments

publisherfk picture publisherfk  ·  3Comments