Struct slippy_map_tiles::Tile
[−]
[src]
pub struct Tile { /* fields omitted */ }
A single tile.
Methods
impl Tile
[src]
fn new(zoom: u8, x: u32, y: u32) -> Option<Tile>
[src]
Constucts a Tile with the following zoom, x and y values.
Returns None if the x/y are invalid for that zoom level, or if the zoom is >= 100.
Examples
assert!(Tile::new(0, 3, 3).is_none());
fn zoom(&self) -> u8
[src]
zoom of this tile
fn x(&self) -> u32
[src]
X value of this tile
fn y(&self) -> u32
[src]
Y value of tile
fn from_tms(tms: &str) -> Option<Tile>
[src]
Constucts a Tile with the following zoom, x and y values based on a TMS URL. Returns None if the TMS url is invalid, or those
Examples
let t = Tile::from_tms("/10/547/380.png"); assert_eq!(t, Tile::new(10, 547, 380)); assert_eq!(Tile::from_tms("foobar"), None);
fn parent(&self) -> Option<Tile>
[src]
Returns the parent tile for this tile, i.e. the tile at the zoom-1
that this tile is
inside.
assert_eq!(Tile::new(1, 0, 0).unwrap().parent(), Tile::new(0, 0, 0));
None if there is no parent, which is at zoom 0.
assert_eq!(Tile::new(0, 0, 0).unwrap().parent(), None);
fn subtiles(&self) -> Option<[Tile; 4]>
[src]
Returns the subtiles (child) tiles for this tile. The 4 tiles at zoom+1 which cover this tile. Returns None if this is at the maximum permissable zoom level, and hence there are no subtiles.
let t = Tile::new(0, 0, 0).unwrap(); let subtiles: [Tile; 4] = t.subtiles().unwrap(); assert_eq!(subtiles[0], Tile::new(1, 0, 0).unwrap()); assert_eq!(subtiles[1], Tile::new(1, 1, 0).unwrap()); assert_eq!(subtiles[2], Tile::new(1, 0, 1).unwrap()); assert_eq!(subtiles[3], Tile::new(1, 1, 1).unwrap());
fn all_subtiles_iter(&self) -> AllSubTilesIterator
[src]
Iterate on all child tiles of this tile
fn centre_point(&self) -> LatLon
[src]
Returns the LatLon for the centre of this tile.
fn center_point(&self) -> LatLon
[src]
Returns the LatLon for the centre of this tile.
fn nw_corner(&self) -> LatLon
[src]
Returns the LatLon of the top left, i.e. north west corner, of this tile.
fn ne_corner(&self) -> LatLon
[src]
Returns the LatLon of the top right, i.e. north east corner, of this tile.
fn sw_corner(&self) -> LatLon
[src]
Returns the LatLon of the bottom left, i.e. south west corner, of this tile.
fn se_corner(&self) -> LatLon
[src]
Returns the LatLon of the bottom right, i.e. south east corner, of this tile.
fn top(&self) -> f32
[src]
fn bottom(&self) -> f32
[src]
fn left(&self) -> f32
[src]
fn right(&self) -> f32
[src]
fn tc_path<T: Display>(&self, ext: T) -> String
[src]
Returns the TC (TileCache) path for storing this tile.
fn mp_path<T: Display>(&self, ext: T) -> String
[src]
Returns the MP (MapProxy) path for storing this tile.
fn ts_path<T: Display>(&self, ext: T) -> String
[src]
Returns the TS (TileStash safe) path for storing this tile.
fn zxy(&self) -> String
[src]
Returns the Z/X/Y representation of this tile
fn zxy_path<T: Display>(&self, ext: T) -> String
[src]
Returns the ZXY path for storing this tile.
fn mt_path<T: Display>(&self, ext: T) -> String
[src]
Returns the ModTileMetatile path for storing this tile
fn all() -> AllTilesIterator
[src]
Returns an iterator that yields all the tiles possible, starting from 0/0/0
. Tiles are
generated in a breath first manner, with all zoom 1 tiles before zoom 2 etc.
let mut all_tiles_iter = Tile::all();
fn all_to_zoom(max_zoom: u8) -> AllTilesToZoomIterator
[src]
Returns an iterator that yields all the tiles from zoom 0 down to, and including, all the
tiles at max_zoom
zoom level. Tiles are
generated in a breath first manner, with all zoom 1 tiles before zoom 2 etc.
fn bbox(&self) -> BBox
[src]
The BBox for this tile.
fn metatile(&self, scale: u8) -> Option<Metatile>
[src]
fn modtile_metatile(&self) -> Option<ModTileMetatile>
[src]
Trait Implementations
impl PartialEq for Tile
[src]
fn eq(&self, __arg_0: &Tile) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Tile) -> bool
[src]
This method tests for !=
.
impl Eq for Tile
[src]
impl Debug for Tile
[src]
impl Clone for Tile
[src]
fn clone(&self) -> Tile
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more