Expand description
Abstractions and functions for working with OpenStreetMap (etc.) tiles
§Examples
use slippy_map_tiles::Tile;
let t = Tile::new(6, 35, 23).unwrap();
You cannot create invalid tiles
assert!(Tile::new(0, 3, 3).is_none());
Structs§
- AllSub
Tiles Iterator - AllTiles
Iterator - Iterates over all the tiles in the world.
- AllTiles
ToZoom Iterator - Iterates over all the tiles from 0/0/0 up to, and including,
max_zoom
. - BBox
- A Bounding box
- BBox
Tiles Iterator - LatLon
- A single point in the world.
- Metatile
- Metatiles are NxN tiles
- Metatiles
Iterator - Iterates over all the metatiles in the world.
- ModTile
Metatile - Metatiles as found by mod_tile, always 8x8
- Tile
- A single tile.
Functions§
- lat_
lon_ to_ tile - Return the x,y of a tile which has this lat/lon for this zoom level
- merc_
location_ to_ tile_ coords - Return the x,y of a tile which (for this zoom) has this web mercator 3857 x/y, and then the x,y of the pixel within that image (presuming a 256x256 image)
- size_
bbox_ zoom - How many tiles does this bbox cover at this zoom
If there is an overflow for usize,
None
is returned, if not, aSome(...)
- size_
bbox_ zoom_ metatiles - How many metatiles, of this scale, does this bbox cover at this zoom
If there is an overflow for usize,
None
is returned, if not, aSome(...)
This is less likely to overflow thansize_bbox_zoom
because metatiles are larger - xy_
to_ zorder - zorder_
to_ xy