[Feature Request / Bug]: Limitations in scattergeo and natural earth projection when handling antimeridian crossing and programmatic centering
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
Description
When working with long-haul transpacific flight tracks that cross the 180° meridian (antimeridian) on a 2D map view (natural earth projection), scattergeo exhibits severe limitations regarding automatic centering, zooming, and boundary rendering.
Specifically, attempting to programmatically center the map on routes crossing the dateline results in projection clipping or shifts the view incorrectly (e.g., to the Atlantic/African perspective). While injecting null values into coordinate arrays successfully prevents straight lines from stretching awkwardly across the entire globe, it breaks standard spherical centroid and midpoint calculations. Furthermore, because bounded 2D projections like natural earth lack infinite horizontal wrapping, smooth centering across the antimeridian is virtually unsupported.
Steps to reproduce
Set up a scattergeo plot using the natural earth projection (geo.projection.type: 'natural earth').
Plot a flight path with coordinates crossing the 180° meridian (e.g., from Vancouver [-123.18, 49.19] across the Pacific to Seoul [126.44, 37.46]).
Attempt to programmatically update geo.center or geo.projection.rotation.lon to focus/zoom into the midpoint of the route.
Note the issue: The flat 2D projection either clips/shifts the viewport entirely away from the Pacific or forces lines to span across the map, as there is no native antimeridian-aware centering support for bounded 2D geo projections.
Notes
This issue impacts custom flight dash applications using scattergeo where users want to select specific routes to zoom into. Having native support for antimeridian-aware bounding/centering or seamless horizontal wrapping in flat 2D projections would eliminate the need for complex workaround scripts.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从使用 natural earth 投影的 scattergeo 配置开始,重点关注 geo.center 和 geo.projection.rotation.lon,并复现跨越对日界线的 Vancouver–Seoul 航线。调查在此情况下居中、缩放、边界渲染和坐标数组的行为。完成标准是:2D natural earth 地图能够聚焦于此类航线,而不会发生裁剪、错误偏移或绘制跨越整个地球的线条。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100