apache / apache/echarts

[Feature] Enable mouse zooming and translating on maps even when the mouse is not over the map itself

Open
#20,444 3 comments 0 reactions 0 assignees View on GitHub
en new-feature
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### What problem does this feature solve?

It's a bit confusing that you can only zoom with the mouse when it's over the map. On some maps with too much space between regions you can't zoom with the mouse in the middle. On the other hand, on any map (like https://echarts.apache.org/examples/en/editor.html?c=map-usa) if you zoom out enough, the map becomes very small and there's not much room left to zoom again:
![image](https://github.com/user-attachments/assets/ed797de8-e5de-4600-9599-dc29f78f02c0)
Additionally, it appears that regions with no associated data are also ignored when zooming the map.

### What does the proposed API look like?

Probably the API shouldn't change, but in case someone prefers to keep the current behavior maybe something like:
`{ roam: true, roamOn: ("everywhere" | "map")}`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.