Skip to main content
Module bbox
basemapper_
core
0.1.1
Module bbox
Module Items
Structs
Functions
In crate basemapper_
core
basemapper_core
Module
bbox
Copy item path
Source
Structs
§
Render
Request
Render
Result
Spatial
Bounds
Functions
§
bbox_
from_
center
EPSG:3857 bbox of a
width x height
CSS-pixel view centred on (
lon
,
lat
) at MapLibre zoom
zoom
(512 px tiles; fractional zooms allowed), as MapLibre’s camera shows it.
compute_
zoom
fit_
bounds
MapLibre zoom at which a
width x height
CSS-pixel view fits the EPSG:3857
bounds
(fitBounds without padding), and the bounds’ centre as (lon, lat).
mercator_
to_
tile
Convert Web Mercator metres to slippy-map tile coordinates.
raster_
tile_
zoom
Compute tile zoom from bbox width and target pixel width.
tile_
count
Count how many tiles cover a bbox at a given zoom level.