pub fn camera_for_tile(
tile: CanonicalTileId,
logical_size: LogicalSize,
) -> Result<CameraOptions>Expand description
Computes the camera that shows exactly one tile on a square map.
Jump a map in MapMode::Tile to the camera to render tile, where
logical_size is the map’s size. The camera centers the tile, zooms
until the tile fills the map, and looks straight down with north up and
no padding. The map keeps its camera within its zoom limits, so for a
deep tile, raise the maximum zoom past the camera’s with
MapHandle::set_bounds().
See mln_camera_for_tile in the
C API reference.
§Errors
Status::InvalidArgumentwhenlogical_sizeisn’t square, or is wider than 512 pixels. For denser tiles, raise the map’s scale factor instead.Status::InvalidArgumentwhentile.xortile.yisn’t less than 2 to the powertile.z, or when the tile can’t fill the map at a zoom from 0 to 25.5, as for tile 0/0/0 on a 256-pixel map.