pub struct TileId {
pub z: u8,
pub x: u32,
pub y: u32,
}Expand description
A Web-Mercator XYZ tile identifier.
Fields§
§z: u8§x: u32§y: u32Implementations§
Source§impl TileId
impl TileId
pub const fn new(z: u8, x: u32, y: u32) -> Self
Sourcepub fn axis_tiles(self) -> u32
pub fn axis_tiles(self) -> u32
Number of tiles along one axis at this zoom level.
Sourcepub fn parent(self) -> Option<TileId>
pub fn parent(self) -> Option<TileId>
The tile one zoom level up that contains this tile, or None
at zoom 0 (which has no parent).
Sourcepub fn ancestor_at(self, z: u8) -> Option<TileId>
pub fn ancestor_at(self, z: u8) -> Option<TileId>
The ancestor tile at the given (lower) zoom, or None if z
is greater than or equal to this tile’s zoom.
Sourcepub fn is_ancestor_of(self, other: TileId) -> bool
pub fn is_ancestor_of(self, other: TileId) -> bool
true iff other lies inside this tile’s spatial bounds at a
deeper zoom. A tile is not considered its own ancestor.
Trait Implementations§
impl Copy for TileId
impl Eq for TileId
impl StructuralPartialEq for TileId
Auto Trait Implementations§
impl Freeze for TileId
impl RefUnwindSafe for TileId
impl Send for TileId
impl Sync for TileId
impl Unpin for TileId
impl UnsafeUnpin for TileId
impl UnwindSafe for TileId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more