Struct Tile

Source
pub struct Tile<M> {
    pub id: CellId,
    pub layers: BTreeMap<String, Layer<M>>,
    pub transformed: bool,
}
Expand description

Tile Class to contain the tile information for splitting or simplifying

Fields§

§id: CellId

the tile id

§layers: BTreeMap<String, Layer<M>>

the tile’s layers

§transformed: bool

whether the tile feature geometry has been transformed

Implementations§

Source§

impl<M: HasLayer + Clone> Tile<M>

Source

pub fn new(id: CellId) -> Self

Create a new Tile

Source

pub fn is_empty(&self) -> bool

Returns true if the tile is empty of features

Source

pub fn add_feature(&mut self, feature: VectorFeature<M>, layer: Option<String>)

Add a feature to the tile

Source

pub fn transform(&mut self, tolerance: f64, maxzoom: Option<u8>)

Simplify the geometry to have a tolerance which will be relative to the tile’s zoom level. NOTE: This should be called after the tile has been split into children if that functionality is needed.

Source§

impl<M: HasLayer + Clone> Tile<M>

Source

pub fn split(&mut self, buffer: Option<f64>) -> TileChildren<M>

split tile into 4 children

Auto Trait Implementations§

§

impl<M> Freeze for Tile<M>

§

impl<M> RefUnwindSafe for Tile<M>
where M: RefUnwindSafe,

§

impl<M> Send for Tile<M>
where M: Send,

§

impl<M> Sync for Tile<M>
where M: Sync,

§

impl<M> Unpin for Tile<M>

§

impl<M> UnwindSafe for Tile<M>
where M: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.