Skip to main content

SourcePlugin

Trait SourcePlugin 

Source
pub trait SourcePlugin:
    Send
    + Sync
    + 'static {
    // Required methods
    fn options(&self) -> SourceTypeOptions<'_>;
    fn fetch_tile(&self, info: TileFetchInfo<'_>, request: TileRequest);

    // Provided method
    fn cancel_tile(&self, _info: TileCancelInfo<'_>) { ... }
}
Expand description

Custom tile source type implemented against the MapLibre Plugin SDK.

Required Methods§

Source

fn options(&self) -> SourceTypeOptions<'_>

Returns the source type’s name, data kind, and default tiling options.

Source

fn fetch_tile(&self, info: TileFetchInfo<'_>, request: TileRequest)

Called when the renderer needs a tile.

Answer synchronously or move request to another thread/task and call TileRequest::deliver.

Provided Methods§

Source

fn cancel_tile(&self, _info: TileCancelInfo<'_>)

Called when the renderer no longer needs a previously requested tile.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§