map.getBounds() not providing full coverage when terrain enabled
ted-piotrowski opened this issue · 1 comments
ted-piotrowski commented
mapbox-gl-js version: Latest
browser: Firefox
Steps to Trigger Behavior
- Create map with terrain layer
- Center map on "mountainous" region, wait for terrain to load, and call
getBounds()
Link to Demonstration
Creating a GeoJSON Polygon using map.getBounds()
coordinates does not cover the entire map (see example and screenshots)
https://jsbin.com/lekonabole/edit?html,output
Expected Behavior
Actual Behavior
Potential solution
It appears that changing https://github.com/mapbox/mapbox-gl-js/blob/main/src/geo/transform.js#L1424 from
let tl = this.pointCoordinate(topLeft, min);
let tr = this.pointCoordinate(topRight, min);
const br = this.pointCoordinate(bottomRight, max);
const bl = this.pointCoordinate(bottomLeft, max);
to
let tl = this.pointCoordinate(topLeft, min);
let tr = this.pointCoordinate(topRight, min);
const br = this.pointCoordinate(bottomRight, min);
const bl = this.pointCoordinate(bottomLeft, min);
fixes the issue but I'm not sure if it affects other projections, etc. Just thought I'd offer it as a potential starting point.
Thebigbignooby commented
any news on this?