pub struct Tile { /* fields omitted */ }
A tile represents a rectangular region of a map.
Each tile can contain any number of layers.
When all layers have been added to the tile, it can be
written out or
converted to a Vec.
use mvt::Tile;
let mut tile = Tile::new(4096);
let layer = tile.create_layer("First Layer");
tile.add_layer(layer)?;
let data = tile.to_bytes()?;
Create a new tile.
extent
Size in screen coördinates.
Get extent in screen coördinates.
Get the number of layers.
Add a layer.
Returns an error if:
- a layer with the same name already exists
- the layer extent does not match the tile extent
Write the tile.
out
Writer to output the tile.
Encode the tile and return the bytes.
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)