Search Results for

    Show / Hide Table of Contents

    Class FontSourceCache

    Cache that stores loaded font bytes keyed by Mapsui.Styles.FontSource.SourceId. It implements IFetchableSource so that the DataFetcher automatically populates it when the viewport changes, including during RefreshDataAsync(Viewport?). Accessed via FontSourceCache.

    Inheritance
    object
    FontSourceCache
    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 FontSourceCache : 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 all cached font bytes and requests a new fetch cycle.

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

    FetchAllFontDataAsync()

    Fetch all font sources that have been declared but not yet loaded. This variant is currently only used in tests.

    Declaration
    public Task FetchAllFontDataAsync()
    Returns
    Type Description
    Task
    | Edit this page View Source

    Get(FontSource)

    Get cached font bytes for the given FontSource, or null if not yet loaded.

    Declaration
    public byte[]? Get(FontSource fontSource)
    Parameters
    Type Name Description
    FontSource fontSource
    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)

    Fetch and cache the bytes for a single font source. Returns false if it was already registered.

    Declaration
    public Task<bool> TryRegisterAsync(string sourceId, string source)
    Parameters
    Type Name Description
    string sourceId
    string source
    Returns
    Type Description
    Task<bool>
    | 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