pub trait CustomLayer {
// Required methods
fn name(&self) -> &str;
fn draw(&self, ctx: &mut DrawContext<'_>);
// Provided methods
fn pick(&self, _ctx: &PickContext<'_>) -> Vec<Pick> { ... }
fn bounds(&self) -> Option<(f64, f64, f64, f64)> { ... }
}Expand description
Something drawn on the map by your own code.
Required Methods§
Sourcefn draw(&self, ctx: &mut DrawContext<'_>)
fn draw(&self, ctx: &mut DrawContext<'_>)
Add this layer’s lines, fills, markers and labels for the current view.
Provided Methods§
Sourcefn pick(&self, _ctx: &PickContext<'_>) -> Vec<Pick>
fn pick(&self, _ctx: &PickContext<'_>) -> Vec<Pick>
Features of this layer under ctx.target, most specific first.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".