Projections and bounding boxes¶
The public TypeScript renderer expects the BBOX as four Web Mercator values:
That is west, south, east, north in EPSG:3857, for example:
Validate before sending¶
- Supply exactly four finite numeric values.
- Ensure
minX < maxXandminY < maxY. - Use the same CRS for all four values.
- Preserve enough decimal precision for the required extent.
- Confirm that the BBOX aspect ratio agrees with the requested width and height, or expect fitting/cropping effects.
Converting longitude and latitude¶
Transform EPSG:4326 coordinates to EPSG:3857 with a well-tested geospatial library. Do not relabel longitude/latitude degrees as Web Mercator metres.
When the geographic area crosses the antimeridian or approaches the Web Mercator latitude limit, test the exact renderer behavior rather than assuming a conventional rectangular extent.
Rust renderer¶
The newer Rust implementation accepts an optional epsg parameter, defaults it to 3857, and uses PROJ to transform the BBOX corners to EPSG:4326 before fitting the map. This is experimental implementation behavior and is not yet part of the public TypeScript request contract.