Class RenderService
Implements
Inherited Members
Namespace: Mapsui.Rendering
Assembly: Mapsui.dll
Syntax
public sealed class RenderService : IDisposable
Constructors
| Edit this page View SourceRenderService(int)
Declaration
public RenderService(int vectorCacheCapacity = 30000)
Parameters
| Type | Name | Description |
|---|---|---|
| int | vectorCacheCapacity |
Properties
| Edit this page View SourceCreateDrawable
Factory delegate for creating drawables from features and styles. Set by the MapRenderer during initialization when the Map is assigned to a MapControl. This enables the fetch pipeline to create drawables directly without needing access to renderer internals.
Declaration
public Func<Viewport, ILayer, IFeature, IStyle, RenderService, IDrawable?>? CreateDrawable { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<Viewport, ILayer, IFeature, IStyle, RenderService, IDrawable> |
CurrentIteration
Declaration
public long CurrentIteration { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
DrawableImageCache
Declaration
public DrawableImageCache DrawableImageCache { get; }
Property Value
| Type | Description |
|---|---|
| DrawableImageCache |
ImageSourceCache
Declaration
public ImageSourceCache ImageSourceCache { get; }
Property Value
| Type | Description |
|---|---|
| ImageSourceCache |
TileCache
Global tile cache. Kept for backward compatibility.
Declaration
public TileCache TileCache { get; }
Property Value
| Type | Description |
|---|---|
| TileCache |
VectorCache
Declaration
public VectorCache VectorCache { get; }
Property Value
| Type | Description |
|---|---|
| VectorCache |
Methods
| Edit this page View SourceCleanupLayerCaches(int)
Cleans up all caches associated with a layer. Call this when a layer is removed from the map.
Declaration
public void CleanupLayerCaches(int layerId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | layerId | The unique identifier of the layer. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
GetLayerDrawableCache(int)
Returns the drawable cache for the specified layer, or null if it has not been created yet. The cache is always created through GetOrCreateLayerDrawableCache(int, Func<IDrawableCache>) so that the correct type is chosen by the renderer (e.g. TileDrawableCache vs DrawableCache). A silent DrawableCache fallback here would create the wrong type and cause tile-layer entries to be evicted unexpectedly.
Declaration
public IDrawableCache? GetLayerDrawableCache(int layerId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | layerId | The unique identifier of the layer. |
Returns
| Type | Description |
|---|---|
| IDrawableCache | The cache, or null when the layer has not yet been through UpdateDrawables. |
GetOrCreateLayerDrawableCache(int, Func<IDrawableCache>)
Gets or creates a drawable cache for the specified layer using a custom factory. This allows renderers to specify their own cache type (e.g. TileDrawableCache). If a cache already exists for this layer, it is returned regardless of the factory.
Declaration
public IDrawableCache GetOrCreateLayerDrawableCache(int layerId, Func<IDrawableCache> cacheFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| int | layerId | The unique identifier of the layer. |
| Func<IDrawableCache> | cacheFactory | Factory to create the cache if it doesn't exist yet. |
Returns
| Type | Description |
|---|---|
| IDrawableCache | An IDrawableCache dedicated to the specified layer. |
IncrementIteration()
Atomically increments CurrentIteration and returns the new value.
Declaration
public long IncrementIteration()
Returns
| Type | Description |
|---|---|
| long |