Search Results for

    Show / Hide Table of Contents

    Class MapControl

    Inheritance
    object
    ComponentBase
    MapControl
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IMapControl
    INotifyPropertyChanged
    IDisposable
    Inherited Members
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.StateHasChanged()
    ComponentBase.ShouldRender()
    ComponentBase.OnAfterRender(bool)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.SetParametersAsync(ParameterView)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Mapsui.UI.Blazor
    Assembly: Mapsui.UI.Blazor.dll
    Syntax
    public class MapControl : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMapControl, INotifyPropertyChanged, IDisposable

    Constructors

    | Edit this page View Source

    MapControl()

    Declaration
    public MapControl()

    Fields

    | Edit this page View Source

    _elementId

    Declaration
    protected readonly string _elementId
    Field Value
    Type Description
    string
    | Edit this page View Source

    _viewCpu

    Declaration
    protected SKCanvasView? _viewCpu
    Field Value
    Type Description
    SKCanvasView
    | Edit this page View Source

    _viewGpu

    Declaration
    protected SKGLView? _viewGpu
    Field Value
    Type Description
    SKGLView

    Properties

    | Edit this page View Source

    ContinuousMouseWheelZoomStepSize

    The size of the mouse wheel steps used when UseContinuousMouseWheelZoom = true. The default is 0.1. A step size of 1 would doubling or halving the scale of the map on each event.

    Declaration
    public double ContinuousMouseWheelZoomStepSize { get; set; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    Cursor

    Declaration
    public string? Cursor { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    ElementId

    Declaration
    public string ElementId { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Map

    Map holding data for which is shown in this MapControl

    Declaration
    [Parameter]
    public Map Map { get; set; }
    Property Value
    Type Description
    Map
    | Edit this page View Source

    MaxTapGestureMovement

    The movement allowed between a touch down and touch up in a touch gestures in device independent pixels.

    Declaration
    public int MaxTapGestureMovement { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    MoveButton

    Declaration
    public int MoveButton { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    MoveCursor

    Declaration
    public string MoveCursor { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    MoveModifier

    Declaration
    public int MoveModifier { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    UseContinuousMouseWheelZoom

    This enables an alternative mouse wheel method where the step size on each mouse wheel event can be configured by setting the ContinuousMouseWheelZoomStepSize.

    Declaration
    public bool UseContinuousMouseWheelZoom { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    UseFling

    Use fling gesture to move the map. Default is true. Fling means that the map will continue to move for a short time after the user has lifted the finger.

    Declaration
    public bool UseFling { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    UseGPU

    Declaration
    public static bool UseGPU { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    ZoomButton

    Declaration
    public int ZoomButton { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    ZoomModifier

    Declaration
    public int ZoomModifier { get; set; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

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

    Dispose(bool)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    | Edit this page View Source

    ForceUpdate()

    Force a update of control

    Declaration
    public void ForceUpdate()
    Remarks

    When this function is called, the control draws itself once

    | Edit this page View Source

    GetMapInfo(ScreenPosition, IEnumerable<ILayer>)

    Check, if a feature at a given screen position is hit.

    Declaration
    public MapInfo GetMapInfo(ScreenPosition screenPosition, IEnumerable<ILayer> layers)
    Parameters
    Type Name Description
    ScreenPosition screenPosition

    Screen position to check for widgets and features.

    IEnumerable<ILayer> layers

    The layers to query.

    Returns
    Type Description
    MapInfo
    | Edit this page View Source

    GetPixelDensity()

    Returns the number of pixels per device independent unit

    Declaration
    public float? GetPixelDensity()
    Returns
    Type Description
    float?
    | Edit this page View Source

    GetRemoteMapInfoAsync(ScreenPosition, Viewport, IEnumerable<ILayer>)

    Declaration
    protected Task<MapInfo> GetRemoteMapInfoAsync(ScreenPosition screenPosition, Viewport viewport, IEnumerable<ILayer> layers)
    Parameters
    Type Name Description
    ScreenPosition screenPosition
    Viewport viewport
    IEnumerable<ILayer> layers
    Returns
    Type Description
    Task<MapInfo>
    | Edit this page View Source

    GetSnapshot(IEnumerable<ILayer>?, RenderFormat, int)

    Create a snapshot form map as PNG image

    Declaration
    public byte[] GetSnapshot(IEnumerable<ILayer>? layers = null, RenderFormat renderFormat = RenderFormat.Png, int quality = 100)
    Parameters
    Type Name Description
    IEnumerable<ILayer> layers

    Layers that should be included in snapshot

    RenderFormat renderFormat

    render format

    int quality

    default quality is 90 is applicable for webp and jpg

    Returns
    Type Description
    byte[]

    Byte array with snapshot in png format. If there are any problems than returns null.

    | Edit this page View Source

    InvalidateCanvas()

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

    OnAfterRenderAsync(bool)

    Method invoked after each time the component has been rendered interactively and the UI has finished updating (for example, after elements have been added to the browser DOM). Any ElementReference fields will be populated by the time this runs.

    This method is not invoked during prerendering or server-side rendering, because those processes are not attached to any live browser DOM and are already complete before the DOM is updated.

    Note that the component does not automatically re-render after the completion of any returned Task, because that would cause an infinite render loop.

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    bool firstRender

    Set to true if this is the first time OnAfterRender(bool) has been invoked on this component instance; otherwise false.

    Returns
    Type Description
    Task

    A Task representing any asynchronous operation.

    Overrides
    ComponentBase.OnAfterRenderAsync(bool)
    Remarks

    The OnAfterRender(bool) and OnAfterRenderAsync(bool) lifecycle methods are useful for performing interop, or interacting with values received from @ref. Use the firstRender parameter to ensure that initialization work is only performed once.

    | Edit this page View Source

    OnInitialized()

    Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.

    Declaration
    protected override void OnInitialized()
    Overrides
    ComponentBase.OnInitialized()
    | Edit this page View Source

    OnMapInfo(MapInfoEventArgs)

    Declaration
    protected void OnMapInfo(MapInfoEventArgs mapInfoEventArgs)
    Parameters
    Type Name Description
    MapInfoEventArgs mapInfoEventArgs
    | Edit this page View Source

    OnMapPointerMoved(ScreenPosition, MPoint, GestureType)

    Declaration
    protected virtual bool OnMapPointerMoved(ScreenPosition screenPosition, MPoint worldPosition, GestureType gestureType)
    Parameters
    Type Name Description
    ScreenPosition screenPosition
    MPoint worldPosition
    GestureType gestureType
    Returns
    Type Description
    bool
    | Edit this page View Source

    OnMapPointerPressed(ScreenPosition, MPoint)

    Declaration
    protected virtual bool OnMapPointerPressed(ScreenPosition screenPosition, MPoint worldPosition)
    Parameters
    Type Name Description
    ScreenPosition screenPosition
    MPoint worldPosition
    Returns
    Type Description
    bool
    | Edit this page View Source

    OnMapPointerReleased(ScreenPosition, MPoint)

    Declaration
    protected virtual bool OnMapPointerReleased(ScreenPosition screenPosition, MPoint worldPosition)
    Parameters
    Type Name Description
    ScreenPosition screenPosition
    MPoint worldPosition
    Returns
    Type Description
    bool
    | Edit this page View Source

    OnMapTapped(ScreenPosition, MPoint, GestureType)

    Declaration
    protected virtual bool OnMapTapped(ScreenPosition screenPosition, MPoint worldPosition, GestureType gestureType)
    Parameters
    Type Name Description
    ScreenPosition screenPosition
    MPoint worldPosition
    GestureType gestureType
    Returns
    Type Description
    bool
    | Edit this page View Source

    OnMouseDown(MouseEventArgs)

    Declaration
    protected void OnMouseDown(MouseEventArgs e)
    Parameters
    Type Name Description
    MouseEventArgs e
    | Edit this page View Source

    OnMouseMove(MouseEventArgs)

    Declaration
    protected void OnMouseMove(MouseEventArgs e)
    Parameters
    Type Name Description
    MouseEventArgs e
    | Edit this page View Source

    OnMouseUp(MouseEventArgs)

    Declaration
    protected void OnMouseUp(MouseEventArgs e)
    Parameters
    Type Name Description
    MouseEventArgs e
    | Edit this page View Source

    OnMouseWheel(WheelEventArgs)

    Declaration
    protected void OnMouseWheel(WheelEventArgs e)
    Parameters
    Type Name Description
    WheelEventArgs e
    | Edit this page View Source

    OnPaintSurface(SKCanvas, SKImageInfo)

    Declaration
    protected void OnPaintSurface(SKCanvas canvas, SKImageInfo info)
    Parameters
    Type Name Description
    SKCanvas canvas
    SKImageInfo info
    | Edit this page View Source

    OnPaintSurfaceCPU(SKPaintSurfaceEventArgs)

    Declaration
    protected void OnPaintSurfaceCPU(SKPaintSurfaceEventArgs e)
    Parameters
    Type Name Description
    SKPaintSurfaceEventArgs e
    | Edit this page View Source

    OnPaintSurfaceGPU(SKPaintGLSurfaceEventArgs)

    Declaration
    protected void OnPaintSurfaceGPU(SKPaintGLSurfaceEventArgs e)
    Parameters
    Type Name Description
    SKPaintGLSurfaceEventArgs e
    | Edit this page View Source

    OnPropertyChanged(string)

    Declaration
    protected void OnPropertyChanged(string propertyName = "")
    Parameters
    Type Name Description
    string propertyName
    | Edit this page View Source

    OnTouchEnd(TouchEventArgs)

    Declaration
    public void OnTouchEnd(TouchEventArgs e)
    Parameters
    Type Name Description
    TouchEventArgs e
    | Edit this page View Source

    OnTouchMove(TouchEventArgs)

    Declaration
    public void OnTouchMove(TouchEventArgs e)
    Parameters
    Type Name Description
    TouchEventArgs e
    | Edit this page View Source

    OnTouchStart(TouchEventArgs)

    Declaration
    public void OnTouchStart(TouchEventArgs e)
    Parameters
    Type Name Description
    TouchEventArgs e
    | Edit this page View Source

    OpenInBrowser(string)

    Declaration
    public void OpenInBrowser(string url)
    Parameters
    Type Name Description
    string url
    | Edit this page View Source

    Refresh(ChangeType)

    Declaration
    public void Refresh(ChangeType changeType = ChangeType.Discrete)
    Parameters
    Type Name Description
    ChangeType changeType
    | Edit this page View Source

    RefreshData(ChangeType)

    Refresh data of Map, but don't paint it

    Declaration
    public void RefreshData(ChangeType changeType = ChangeType.Discrete)
    Parameters
    Type Name Description
    ChangeType changeType
    | Edit this page View Source

    RefreshGraphics()

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

    SetMapRenderer(IMapRenderer)

    Declaration
    public void SetMapRenderer(IMapRenderer mapRenderer)
    Parameters
    Type Name Description
    IMapRenderer mapRenderer
    | Edit this page View Source

    Unsubscribe()

    Unsubscribe from map events

    Declaration
    public void Unsubscribe()

    Events

    | Edit this page View Source

    Info

    Called whenever the map is clicked. The MapInfoEventArgs contain the features that were hit in the layers that have IsMapInfoLayer set to true.

    Declaration
    public event EventHandler<MapInfoEventArgs>? Info
    Event Type
    Type Description
    EventHandler<MapInfoEventArgs>
    Remarks

    The Map.Tapped event is preferred over the Info event. This event is kept for backwards compatibility.

    | Edit this page View Source

    MapPointerMoved

    Event that is triggered when on pointer move. Can be a drag or hover.

    Declaration
    public event EventHandler<MapEventArgs>? MapPointerMoved
    Event Type
    Type Description
    EventHandler<MapEventArgs>
    | Edit this page View Source

    MapPointerPressed

    Event that is triggered when on pointer down.

    Declaration
    public event EventHandler<MapEventArgs>? MapPointerPressed
    Event Type
    Type Description
    EventHandler<MapEventArgs>
    | Edit this page View Source

    MapPointerReleased

    Event that is triggered when on pointer up.

    Declaration
    public event EventHandler<MapEventArgs>? MapPointerReleased
    Event Type
    Type Description
    EventHandler<MapEventArgs>
    | Edit this page View Source

    MapTapped

    Event that is triggered when the map is tapped. Can be a single tap, double tap or long press.

    Declaration
    public event EventHandler<MapEventArgs>? MapTapped
    Event Type
    Type Description
    EventHandler<MapEventArgs>
    | Edit this page View Source

    PropertyChanged

    Called whenever a property is changed

    Declaration
    public event PropertyChangedEventHandler? PropertyChanged
    Event Type
    Type Description
    PropertyChangedEventHandler

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IMapControl
    INotifyPropertyChanged
    IDisposable

    Extension Methods

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