Search Results for

    Show / Hide Table of Contents

    Class MapControl

    UI component that displays an interactive map

    Inheritance
    object
    BindableObject
    Element
    StyleableElement
    NavigableElement
    VisualElement
    View
    Layout
    TemplatedView
    ContentView
    MapControl
    MapView
    Implements
    IEffectControlProvider
    IToolTipElement
    IContextFlyoutElement
    IAnimatable
    IViewController
    IVisualElementController
    IElementController
    IGestureController
    IGestureRecognizers
    IPropertyMapperView
    IHotReloadableView
    IReplaceableView
    ILayout
    ILayoutController
    IVisualTreeElement
    IContentView
    IView
    IElement
    ITransform
    IPadding
    ICrossPlatformLayout
    IMapControl
    IDisposable
    INotifyPropertyChanged
    Inherited Members
    ContentView.ContentProperty
    ContentView.OnBindingContextChanged()
    ContentView.Content
    TemplatedView.ControlTemplateProperty
    TemplatedView.LayoutChildren(double, double, double, double)
    TemplatedView.OnMeasure(double, double)
    TemplatedView.OnApplyTemplate()
    TemplatedView.OnChildRemoved(Element, int)
    TemplatedView.GetTemplateChild(string)
    TemplatedView.ResolveControlTemplate()
    TemplatedView.MeasureOverride(double, double)
    TemplatedView.ArrangeOverride(Rect)
    TemplatedView.ControlTemplate
    Layout.IsClippedToBoundsProperty
    Layout.CascadeInputTransparentProperty
    Layout.PaddingProperty
    Layout.ForceLayout()
    Layout.Measure(double, double, MeasureFlags)
    Layout.LayoutChildIntoBoundingRegion(VisualElement, Rect)
    Layout.LowerChild(View)
    Layout.RaiseChild(View)
    Layout.InvalidateLayout()
    Layout.OnChildMeasureInvalidated(object, EventArgs)
    Layout.OnChildMeasureInvalidated()
    Layout.OnSizeAllocated(double, double)
    Layout.ShouldInvalidateOnChildAdded(View)
    Layout.ShouldInvalidateOnChildRemoved(View)
    Layout.UpdateChildrenLayout()
    Layout.InvalidateMeasureOverride()
    Layout.CrossPlatformMeasure(double, double)
    Layout.CrossPlatformArrange(Rect)
    Layout.IsClippedToBounds
    Layout.Padding
    Layout.CascadeInputTransparent
    Layout.LayoutChanged
    View.VerticalOptionsProperty
    View.HorizontalOptionsProperty
    View.MarginProperty
    View.propertyMapper
    View.ChangeVisualState()
    View.GetChildElements(Point)
    View.GetRendererOverrides<T>()
    View.GestureController
    View.GestureRecognizers
    View.HorizontalOptions
    View.Margin
    View.VerticalOptions
    VisualElement.NavigationProperty
    VisualElement.StyleProperty
    VisualElement.InputTransparentProperty
    VisualElement.IsEnabledProperty
    VisualElement.XProperty
    VisualElement.YProperty
    VisualElement.AnchorXProperty
    VisualElement.AnchorYProperty
    VisualElement.TranslationXProperty
    VisualElement.TranslationYProperty
    VisualElement.WidthProperty
    VisualElement.HeightProperty
    VisualElement.RotationProperty
    VisualElement.RotationXProperty
    VisualElement.RotationYProperty
    VisualElement.ScaleProperty
    VisualElement.ScaleXProperty
    VisualElement.ScaleYProperty
    VisualElement.ClipProperty
    VisualElement.VisualProperty
    VisualElement.IsVisibleProperty
    VisualElement.OpacityProperty
    VisualElement.BackgroundColorProperty
    VisualElement.BackgroundProperty
    VisualElement.BehaviorsProperty
    VisualElement.TriggersProperty
    VisualElement.WidthRequestProperty
    VisualElement.HeightRequestProperty
    VisualElement.MinimumWidthRequestProperty
    VisualElement.MinimumHeightRequestProperty
    VisualElement.MaximumWidthRequestProperty
    VisualElement.MaximumHeightRequestProperty
    VisualElement.IsFocusedProperty
    VisualElement.FlowDirectionProperty
    VisualElement.WindowProperty
    VisualElement.ShadowProperty
    VisualElement.ZIndexProperty
    VisualElement.BatchBegin()
    VisualElement.BatchCommit()
    VisualElement.Focus()
    VisualElement.Measure(double, double)
    VisualElement.Unfocus()
    VisualElement.InvalidateMeasure()
    VisualElement.OnChildAdded(Element)
    VisualElement.OnChildrenReordered()
    VisualElement.SizeAllocated(double, double)
    VisualElement.RefreshIsEnabledProperty()
    VisualElement.Arrange(Rect)
    VisualElement.Layout(Rect)
    VisualElement.MapBackgroundColor(IViewHandler, IView)
    VisualElement.MapBackgroundImageSource(IViewHandler, IView)
    VisualElement.Visual
    VisualElement.FlowDirection
    VisualElement.Window
    VisualElement.AnchorX
    VisualElement.AnchorY
    VisualElement.BackgroundColor
    VisualElement.Background
    VisualElement.Behaviors
    VisualElement.Bounds
    VisualElement.Height
    VisualElement.HeightRequest
    VisualElement.InputTransparent
    VisualElement.IsEnabled
    VisualElement.IsEnabledCore
    VisualElement.IsFocused
    VisualElement.IsVisible
    VisualElement.MinimumHeightRequest
    VisualElement.MinimumWidthRequest
    VisualElement.MaximumHeightRequest
    VisualElement.MaximumWidthRequest
    VisualElement.Opacity
    VisualElement.Rotation
    VisualElement.RotationX
    VisualElement.RotationY
    VisualElement.Scale
    VisualElement.ScaleX
    VisualElement.ScaleY
    VisualElement.TranslationX
    VisualElement.TranslationY
    VisualElement.Triggers
    VisualElement.Width
    VisualElement.WidthRequest
    VisualElement.X
    VisualElement.Y
    VisualElement.Clip
    VisualElement.Resources
    VisualElement.Frame
    VisualElement.Handler
    VisualElement.Shadow
    VisualElement.ZIndex
    VisualElement.DesiredSize
    VisualElement.IsLoaded
    VisualElement.ChildrenReordered
    VisualElement.Focused
    VisualElement.MeasureInvalidated
    VisualElement.SizeChanged
    VisualElement.Unfocused
    VisualElement.Loaded
    VisualElement.Unloaded
    NavigableElement.OnParentSet()
    NavigableElement.Navigation
    StyleableElement.Style
    StyleableElement.StyleClass
    StyleableElement.class
    Element.AutomationIdProperty
    Element.ClassIdProperty
    Element.InsertLogicalChild(int, Element)
    Element.AddLogicalChild(Element)
    Element.RemoveLogicalChild(Element)
    Element.ClearLogicalChildren()
    Element.FindByName(string)
    Element.RemoveDynamicResource(BindableProperty)
    Element.SetDynamicResource(BindableProperty, string)
    Element.OnParentChanging(ParentChangingEventArgs)
    Element.OnParentChanged()
    Element.OnHandlerChanging(HandlerChangingEventArgs)
    Element.OnHandlerChanged()
    Element.MapAutomationPropertiesIsInAccessibleTree(IElementHandler, Element)
    Element.MapAutomationPropertiesExcludedWithChildren(IElementHandler, Element)
    Element.AutomationId
    Element.ClassId
    Element.Effects
    Element.Id
    Element.StyleId
    Element.Parent
    Element.ChildAdded
    Element.ChildRemoved
    Element.DescendantAdded
    Element.DescendantRemoved
    Element.ParentChanging
    Element.ParentChanged
    Element.HandlerChanging
    Element.HandlerChanged
    BindableObject.BindingContextProperty
    BindableObject.ClearValue(BindableProperty)
    BindableObject.ClearValue(BindablePropertyKey)
    BindableObject.GetValue(BindableProperty)
    BindableObject.IsSet(BindableProperty)
    BindableObject.RemoveBinding(BindableProperty)
    BindableObject.SetBinding(BindableProperty, BindingBase)
    BindableObject.ApplyBindings()
    BindableObject.OnPropertyChanging(string)
    BindableObject.UnapplyBindings()
    BindableObject.SetValue(BindableProperty, object)
    BindableObject.SetValue(BindablePropertyKey, object)
    BindableObject.CoerceValue(BindableProperty)
    BindableObject.CoerceValue(BindablePropertyKey)
    BindableObject.Dispatcher
    BindableObject.BindingContext
    BindableObject.PropertyChanging
    BindableObject.BindingContextChanged
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Mapsui.UI.Maui
    Assembly: Mapsui.UI.Maui.dll
    Syntax
    public class MapControl : ContentView, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IViewController, IVisualElementController, IElementController, IGestureController, IGestureRecognizers, IPropertyMapperView, IHotReloadableView, IReplaceableView, ILayout, ILayoutController, IVisualTreeElement, IContentView, IView, IElement, ITransform, IPadding, ICrossPlatformLayout, IMapControl, IDisposable, INotifyPropertyChanged

    Constructors

    | Edit this page View Source

    MapControl()

    Declaration
    public MapControl()

    Fields

    | Edit this page View Source

    MapProperty

    Declaration
    public static readonly BindableProperty MapProperty
    Field Value
    Type Description
    BindableProperty

    Properties

    | Edit this page View Source

    IsStaleTimeSpan

    If finger position is not updated during the IsStaleTimeSpan period, the touch event is considered stale and is removed. Touch input is not always reliable. This could be because of bugs in SkiaSharp, WinUI, iOS or Android, MAUI, in hardware drivers, or hardware. To work around this we remove the touch events if they did not change after some period. Making this period too short could remove valid events, making it too long would result in a longer period of dangling ghost touches. You might want to tweak this value to your needs.

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

    Map

    Declaration
    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

    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

    Methods

    | Edit this page View Source

    ClearTouchState()

    Clears the Touch State

    Declaration
    public void ClearTouchState()
    | 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

    ~MapControl()

    Declaration
    protected ~MapControl()
    | 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

    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

    OnPropertyChanged(string)

    Method that is called when a bound property is changed.

    Declaration
    protected override void OnPropertyChanged(string propertyName = "")
    Parameters
    Type Name Description
    string propertyName

    The name of the bound property that changed.

    Overrides
    Element.OnPropertyChanged(string)
    | Edit this page View Source

    OpenInBrowser(string)

    Public functions

    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

    RunOnUIThread(Action)

    Declaration
    protected void RunOnUIThread(Action action)
    Parameters
    Type Name Description
    Action action
    | 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

    IEffectControlProvider
    IToolTipElement
    IContextFlyoutElement
    IAnimatable
    IViewController
    IVisualElementController
    IElementController
    IGestureController
    IGestureRecognizers
    IPropertyMapperView
    IHotReloadableView
    IReplaceableView
    ILayout
    ILayoutController
    IVisualTreeElement
    IContentView
    IView
    IElement
    ITransform
    IPadding
    ICrossPlatformLayout
    IMapControl
    IDisposable
    INotifyPropertyChanged

    Extension Methods

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