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

CanvasLayer,鼠标交互相关的bug #2392

Closed
hehuasa opened this issue Apr 10, 2024 · 3 comments
Closed

CanvasLayer,鼠标交互相关的bug #2392

hehuasa opened this issue Apr 10, 2024 · 3 comments
Assignees

Comments

@hehuasa
Copy link

hehuasa commented Apr 10, 2024

问题描述

使用CanvasLayer,绘制了元素,添加到sence后,CanvasLayer所在的dom,覆盖在了map所在的dom元素上,导致底图无法进行鼠标交互,比例拖拽、点击等。

重现链接

https://codesandbox.io/p/sandbox/l7-demo-forked-xmlnq9?file=%2FCanvasLayer.js%3A111%2C36

重现步骤

  1. 安装最新l7依赖,注册 CanvasLayer并添加到地图
  2. 此时地图无法进行鼠标交互,但CanvasLayer本身的鼠标交互(例如点击)是可以的。
  3. 控制台查看dom树,发现CanvasLayer所在的dom,覆盖在了map所在的dom元素上。CanvasLayer有一个样式类 .l7-canvas-layer。但是搜了下源代码,没有发现定义这个样式类的地方。
  4. 结合官网demo的dom样式,手动给CanvasLayer所在的dom添加了一个style:pointer-events: none。此时地图可以拖拽等鼠标交互,但是CanvasLayer本身的鼠标事件都不响应了。
    1
    2

预期行为

No response

平台

  • 操作系统: Windows
  • 网页浏览器: Google Chrome

屏幕截图或视频(可选)

No response

补充说明(可选)

感觉是遗漏了.l7-canvas-layer 这个 css样式类的定义。可否优先把这个css类发出来呢。
谢谢

Copy link
Contributor

hi @hehuasa, welcome!

Copy link
Contributor

Hi @hehuasa, Please star this repo if you find it useful! Thanks ⭐!
你好~ @hehuasa 🌟 给力支持一下吧!如果这个仓库对你有帮助,别忘了献上你的小星星 ⭐!你的每一颗星都是对我们努力的最美好认可!感谢你的闪亮赞赏!🌟

@heiyexing
Copy link
Contributor

#2393

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

2 participants