Interface IDrawableStyleRenderer
A style renderer that supports the two-step drawable architecture:
- CreateDrawables: Creates platform-specific drawable objects (can run on a background thread).
- DrawDrawable: Draws a pre-created drawable to the canvas (runs on the UI thread, should be fast).
Namespace: Mapsui.Rendering
Assembly: Mapsui.dll
Syntax
public interface IDrawableStyleRenderer : IStyleRenderer
Methods
| Edit this page View SourceCreateDrawables(Viewport, ILayer, IFeature, IStyle, RenderService)
Creates drawable objects for the given feature and style. This method does the heavy work of creating platform-specific rendering objects (e.g. SKPath, SKPaint) and can be called on a background thread.
Declaration
IReadOnlyList<IDrawable> CreateDrawables(Viewport viewport, ILayer layer, IFeature feature, IStyle style, RenderService renderService)
Parameters
| Type | Name | Description |
|---|---|---|
| Viewport | viewport | The viewport at the time of creation (used for world coordinate extraction). |
| ILayer | layer | The layer containing the feature. |
| IFeature | feature | The feature to create drawables for. |
| IStyle | style | The style to apply. |
| RenderService | renderService | The render service for cache access. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<IDrawable> | A list of drawables representing the feature with the given style. |
DrawDrawable(object, Viewport, IDrawable, ILayer)
Draws a pre-created drawable to the canvas. This should be a fast operation that only applies viewport transforms and calls canvas draw methods.
Declaration
void DrawDrawable(object canvas, Viewport viewport, IDrawable drawable, ILayer layer)
Parameters
| Type | Name | Description |
|---|---|---|
| object | canvas | The platform-specific canvas (e.g. SKCanvas). |
| Viewport | viewport | The current viewport (for world-to-screen transform). |
| IDrawable | drawable | The drawable to draw. |
| ILayer | layer | The layer containing the feature (for opacity). |