Search Results for

    Show / Hide Table of Contents

    Class ImageSourceCache

    Class for managing all bitmaps, which are registered for Mapsui drawing

    Inheritance
    object
    ImageSourceCache
    Implements
    IFetchableSource
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Mapsui.Styles
    Assembly: Mapsui.dll
    Syntax
    public sealed class ImageSourceCache : IFetchableSource

    Properties

    | Edit this page View Source

    Id

    The layer identifier.

    Declaration
    public int Id { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    ClearCache()

    Clears the cache of this layer. Call this if source data has was invalidated or the layer is removed.

    Declaration
    public void ClearCache()
    | Edit this page View Source

    FetchAllImageDataAsync(ConcurrentDictionary<string, string>)

    This variant is currently only used in tests. By awaiting the method the user can be sure that the images are loaded.

    Declaration
    public Task<bool> FetchAllImageDataAsync(ConcurrentDictionary<string, string> sourceToSourceId)
    Parameters
    Type Name Description
    ConcurrentDictionary<string, string> sourceToSourceId
    Returns
    Type Description
    Task<bool>
    | Edit this page View Source

    Get(Image)

    Get a image from the cache

    Declaration
    public byte[]? Get(Image image)
    Parameters
    Type Name Description
    Image image
    Returns
    Type Description
    byte[]
    | Edit this page View Source

    GetFetchJobs(int, int)

    Gets the fetch requests for this layer. The requests are based on the viewport stored within the layer.

    Declaration
    public FetchJob[] GetFetchJobs(int activeFetchCount, int availableFetchSlots)
    Parameters
    Type Name Description
    int activeFetchCount

    Number of active fetches for this layer. It is relevant if the layer itself has a maximum on the number of active fetches for itself.

    int availableFetchSlots

    Number of available fetch slots in the caller. It is the maximum number of fetch jobs the method should return.

    Returns
    Type Description
    FetchJob[]
    | Edit this page View Source

    TryRegisterAsync(string, string)

    Register an image for drawing

    Declaration
    public Task<bool> TryRegisterAsync(string sourceId, string source)
    Parameters
    Type Name Description
    string sourceId
    string source
    Returns
    Type Description
    Task<bool>

    If true a new image was registered and a refresh is needed. If false the image was already registered and no refresh is needed.

    | Edit this page View Source

    Unregister(Image)

    Unregister a image from the cache

    Declaration
    public byte[]? Unregister(Image image)
    Parameters
    Type Name Description
    Image image
    Returns
    Type Description
    byte[]
    | Edit this page View Source

    ViewportChanged(FetchInfo)

    Informs the layer that the viewport has changed and it should update its data accordingly.

    Declaration
    public void ViewportChanged(FetchInfo fetchInfo)
    Parameters
    Type Name Description
    FetchInfo fetchInfo

    Events

    | Edit this page View Source

    FetchRequested

    Indicates to the listener that it should fetch data again. This event is raised when there was a change in source data, so only relevant for dynamic data. The fetches triggered by viewport changes do not depend on it.

    Declaration
    public event EventHandler<FetchRequestedEventArgs>? FetchRequested
    Event Type
    Type Description
    EventHandler<FetchRequestedEventArgs>

    Implements

    IFetchableSource

    Extension Methods

    DisposableExtension.DisposeIfDisposable(object?)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX