math.gl icon indicating copy to clipboard operation
math.gl copied to clipboard

fitBounds antimeridian support

Open goszczynskip opened this issue 4 years ago • 1 comments

fitBounds method doesn't handle antimeridian crossing bboxes correctly. For them fitBounds produces wrong outputs.

There is section in geojson RFC that touches antimeridian crossing bboxes topic https://tools.ietf.org/html/rfc7946#section-5.2

Consider a set of point Features within the Fiji archipelago, straddling the antimeridian between 16 degrees S and 20 degrees S. The southwest corner of the box containing these Features is at 20 degrees S and 177 degrees E, and the northwest corner is at 16 degrees S and 178 degrees W. The antimeridian-spanning GeoJSON bounding box for this FeatureCollection is

"bbox": [177.0, -20.0, -178.0, -16.0]

and covers 5 degrees of longitude.

goszczynskip avatar Jul 02 '20 11:07 goszczynskip