Comments (6)
@changqingom 这个看起来是新版ol引发的问题,我抽空看下
from ol3echarts.
@sakitam-fdd 我自己尝试解决,但是卡在了echarts自身事件交互的逻辑这,希望您处理后可以分享下思路 :)
from ol3echarts.
@changqingom 刚刚查了一下,应该是 openlayer的事件处理这边有些变化,事件捕获到 ol-overlaycontainer-stopevent
就终止了。临时解决的话可以暂时继承 Map:
class OMap extends Map {
handleMapBrowserEvent(mapBrowserEvent) {
if (!this.frameState_) {
// With no view defined, we cannot translate pixels into geographical
// coordinates so interactions cannot be used.
return;
}
// 注释掉事件阻止
// let target = /** @type {Node} */ (mapBrowserEvent.originalEvent.target);
// while (target) {
// if (target.parentElement === this.overlayContainerStopEvent_) {
// return;
// }
// target = target.parentElement;
// }
mapBrowserEvent.frameState = this.frameState_;
const interactionsArray = this.getInteractions().getArray();
if (this.dispatchEvent(mapBrowserEvent) !== false) {
for (let i = interactionsArray.length - 1; i >= 0; i--) {
const interaction = interactionsArray[i];
if (!interaction.getActive()) {
continue;
}
const cont = interaction.handleEvent(mapBrowserEvent);
if (!cont) {
break;
}
}
}
}
}
并且开启
{
stopEvent: true,
insertFirst: true,
}
示例:https://codesandbox.io/s/ol-echarts-example-sfzvh
目前没办法从插件本身处理,如果可能的话可以去mock所有的鼠标事件,可以尝试一下
from ol3echarts.
@sakitam-fdd ok! 谢谢分享
from ol3echarts.
维护项目的时候也遇到了这个问题. 看了下代码. ol-overlaycontainer
现在不在事件分发路径上了. 感觉更改 ol-overlaycontainer-stopevent
的约定不好. 只能 mock 了, zrender 监听的事件, 只有 mousemove 这个事件比较重要, 又没有 mock.
示例: https://codesandbox.io/s/ol-echarts-example-hs7c5
from ol3echarts.
@kyleinfo 感谢! 那我就写个交互扩展去做这块的派发了
from ol3echarts.
Related Issues (20)
- echarts导入问题 HOT 2
- 在EchartsLayer上叠加openlayer图层是否可行 HOT 1
- coordinateSystem的问题
- lines飞线投影 HOT 1
- ECharts 5 support
- 大佬,文档是看不了吗,怎么没有参数和api介绍呢 HOT 1
- 请教~ new EChartsLayer 报错怎么回事 HOT 8
- hideOnZooming不生效 HOT 3
- How to run the code? HOT 1
- bug - openlayers v6.4.3 HOT 5
- bug - map 销毁问题 HOT 1
- 使用北京地方坐标系,画lines图(航线图),看不见 HOT 1
- 有没有可能把L7封装到ol里面呢? HOT 1
- 似乎不支持 series.map 类型? HOT 1
- 拖动地图后数据没有完全加载 HOT 1
- mapBrowserPointerEvent HOT 1
- Cannot set property 'disposed' of null HOT 2
- Uncaught TypeError: EChartsLayer__default.default is not a constructor HOT 2
- Cannot read properties of undefined (reading 'transform') MapDraw.draw (MapDraw.js:210:32) HOT 5
- echarts geo maps are not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ol3echarts.