apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.71k stars 19.62k forks source link

[Bug] boundingCoords feature makes geoJSON map unresponsive and sluggish #20412

Open supportdesk-si opened 1 month ago

supportdesk-si commented 1 month ago

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

Any OS and browser. No framework

Any additional comments?

No response

helgasoft commented 1 month ago

boundingCoords are not well explained in API. In addition of zooming to a predefined area, they also limit the mouse interaction with the map. Pan/zoom are disabled outside the rectangular boundary. Use geo.center and geo.zoom instead of geo.boundingCoords if you want to pan/zoom over the entire map. Demo

image 📌 please close issue if problem solved.