pub struct TileWorker {
pub id: usize,
pub minzoom: u8,
pub maxzoom: u8,
pub vector_store: MultiMap<S2CellId, MVectorFeature>,
pub cluster_stores: BTreeMap<String, PointCluster<MValue>>,
pub raster_stores: BTreeMap<String, PointGrid<RGBA>>,
pub grid_stores: BTreeMap<String, PointGrid<f64>>,
/* private fields */
}Expand description
Convert a vector feature to a collection of tiles and store each tile feature
Fields§
§id: usizeId of the worker (useful for threads)
minzoom: u8total minzoom
maxzoom: u8total maxzoom
vector_store: MultiMap<S2CellId, MVectorFeature>Store Vector Features whose key are Tile IDs.
cluster_stores: BTreeMap<String, PointCluster<MValue>>Unique store for each layer that describes itself as a cluster source
raster_stores: BTreeMap<String, PointGrid<RGBA>>Unique store for each layer that describes itself as a raster source
grid_stores: BTreeMap<String, PointGrid<f64>>Unique store for each layer that describes itself as a grid source
Implementations§
Source§impl TileWorker
impl TileWorker
Sourcepub fn new(id: usize, build_guide: BuildGuide) -> Self
pub fn new(id: usize, build_guide: BuildGuide) -> Self
Create a new TileWorker
Sourcepub fn store_feature<M: Clone + HasLayer, P: MValueCompatible, D: MValueCompatible>(
&mut self,
feature: VectorFeature<M, P, D>,
source_name: String,
on_layer_feature: Option<&Vec<LayerHandler<M, P, D>>>,
)
pub fn store_feature<M: Clone + HasLayer, P: MValueCompatible, D: MValueCompatible>( &mut self, feature: VectorFeature<M, P, D>, source_name: String, on_layer_feature: Option<&Vec<LayerHandler<M, P, D>>>, )
Store a feature to the appropriate store
§Parameters
feature: The feature to storesource_name: The name of the source to store the feature inon_layer_feature: An optional handler to update or filter the feature
Sourcepub fn store_vector_feature(
&mut self,
feature: MVectorFeature,
layer: VectorLayerGuide,
)
pub fn store_vector_feature( &mut self, feature: MVectorFeature, layer: VectorLayerGuide, )
Store a vector feature across all appropriate zooms
§Parameters
feature: The vector feature to storelayer: The layer guide on how to shape for storage
Sourcepub fn build_tiles(&mut self) -> TileWorkerTileBuilder<'_> ⓘ
pub fn build_tiles(&mut self) -> TileWorkerTileBuilder<'_> ⓘ
Iterate through all the stores and sort/cluster as needed and build tiles
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TileWorker
impl !RefUnwindSafe for TileWorker
impl Send for TileWorker
impl !Sync for TileWorker
impl Unpin for TileWorker
impl !UnwindSafe for TileWorker
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more