pub struct TileCoord {
pub zoom: u8,
pub x: f64,
pub y: f64,
}Expand description
A fractional position within the tile grid at a given zoom level.
Where TileId addresses an integer tile, TileCoord addresses an
exact point within the grid – for example (zoom=10, x=560.7, y=342.3)
means “70% across tile column 560, 30% down tile row 342”.
Useful for sub-tile precision when mapping world coordinates to tiles.
Fields§
§zoom: u8Zoom level.
x: f64Fractional column position (0.0 = west edge, 2^zoom = east edge).
y: f64Fractional row position (0.0 = north edge, 2^zoom = south edge).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TileCoord
impl<'de> Deserialize<'de> for TileCoord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for TileCoord
impl StructuralPartialEq for TileCoord
Auto Trait Implementations§
impl Freeze for TileCoord
impl RefUnwindSafe for TileCoord
impl Send for TileCoord
impl Sync for TileCoord
impl Unpin for TileCoord
impl UnsafeUnpin for TileCoord
impl UnwindSafe for TileCoord
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