apache / apache/echarts

[Bug] boundingCoords feature makes geoJSON map unresponsive and sluggish

Open
#20,412 1 comment 0 reactions 0 assignees View on GitHub
bug en pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.5.1

### Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=map-usa-pie

### Steps to Reproduce

Adding the following code to live sandbox will reproduce the effect
`
boundingCoords:[
[ -85.658363, 37.932836 ],
[ -84.377731, 39.152745 ]
],
`

As suggested below, this locks out zoom and pan outside of the bounding area and it is recommended to use zoom and center.

`geo.zoom` and `geo.center` are not a good recommendation.

**Explanation:**
By calculating `boundingCoords` one can set the map to include all data points into the view. Zoom is a relative measure which with current framework, can't be calculated to include all data points and make them fit into the view. That's the reason why other map solutions are using bounding coordinates to set view. This should be reconsidered or new option to be added such as `viewCoords` to allow zoom to a specific part of the map.

### Current Behavior

After several clicks and pans, the map will lock, stop zoom and pan.

### Expected Behavior

Continuously zoom and pan

### Environment

```markdown
Any OS and browser. No framework
```

### Any additional comments?

_No response_

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.