Search Results for

    Show / Hide Table of Contents

    Class MyLocationLayer

    A layer to display a symbol for own location

    Inheritance
    object
    BaseLayer
    MyLocationLayer
    Implements
    ILayer
    IAnimatable
    INotifyPropertyChanged
    IModifyFeatureLayer
    IDisposable
    Inherited Members
    BaseLayer.PropertyChanged
    BaseLayer.DataChanged
    BaseLayer.Id
    BaseLayer.Tag
    BaseLayer.MinVisible
    BaseLayer.MaxVisible
    BaseLayer.Enabled
    BaseLayer.Name
    BaseLayer.Opacity
    BaseLayer.Busy
    BaseLayer.Style
    BaseLayer.Extent
    BaseLayer.Attribution
    BaseLayer.Resolutions
    BaseLayer.IsMapInfoLayer
    BaseLayer.DataHasChanged()
    BaseLayer.ToString()
    BaseLayer.OnPropertyChanged(string)
    BaseLayer.OnDataChanged(DataChangedEventArgs)
    BaseLayer.Dispose()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Mapsui.Layers
    Assembly: Mapsui.dll
    Syntax
    public class MyLocationLayer : BaseLayer, ILayer, IAnimatable, INotifyPropertyChanged, IModifyFeatureLayer, IDisposable
    Remarks

    There are two different symbols for own loaction: one is used when there isn't a change in position (still), and one is used, if the position changes (moving).

    Constructors

    | Edit this page View Source

    MyLocationLayer(Map)

    Initializes a new instance of the MyLocationLayer class.

    Declaration
    public MyLocationLayer(Map map)
    Parameters
    Type Name Description
    Map map

    Map, to which this layer belongs

    | Edit this page View Source

    MyLocationLayer(Map, MPoint)

    Initializes a new instance of the MyLocationLayer class with a starting location.

    Declaration
    public MyLocationLayer(Map map, MPoint location)
    Parameters
    Type Name Description
    Map map

    MapView, to which this layer belongs

    MPoint location

    Location, where to start

    Properties

    | Edit this page View Source

    CalloutText

    The text that is displayed in the MyLocation callout (can contain line breaks).

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

    Direction

    Movement direction of device at location

    Declaration
    public double Direction { get; }
    Property Value
    Type Description
    double

    Direction at location

    | Edit this page View Source

    IsCentered

    MyLocation is always in the center of the map

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

    IsMoving

    Should be moving arrow or round circle displayed

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

    MyLocation

    Position of location, that is displayed

    Declaration
    public MPoint MyLocation { get; }
    Property Value
    Type Description
    MPoint

    Position of location

    | Edit this page View Source

    Scale

    Scale of symbol

    Declaration
    public double Scale { get; set; }
    Property Value
    Type Description
    double

    Scale of symbol

    | Edit this page View Source

    ShowCallout

    Show or hide a callout with further infos next to the MyLocation symbol.

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

    ViewingDirection

    Viewing direction of device (in degrees wrt. north direction)

    Declaration
    public double ViewingDirection { get; }
    Property Value
    Type Description
    double

    Direction at location

    Methods

    | Edit this page View Source

    Dispose(bool)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    BaseLayer.Dispose(bool)
    | Edit this page View Source

    GetFeatures(MRect, double)

    Get all features in a given MRect for a given resolution

    Declaration
    public override IEnumerable<IFeature> GetFeatures(MRect box, double resolution)
    Parameters
    Type Name Description
    MRect box
    double resolution

    Resolution of viewport

    Returns
    Type Description
    IEnumerable<IFeature>
    Overrides
    BaseLayer.GetFeatures(MRect, double)
    | Edit this page View Source

    UpdateAnimations()

    Declaration
    public override bool UpdateAnimations()
    Returns
    Type Description
    bool

    Returns true if animations are running and a graphics update is needed.

    Overrides
    BaseLayer.UpdateAnimations()
    | Edit this page View Source

    UpdateMyDirection(double, double, bool)

    Updates my movement direction

    Declaration
    public void UpdateMyDirection(double newDirection, double newViewportRotation, bool animated = false)
    Parameters
    Type Name Description
    double newDirection

    New direction

    double newViewportRotation

    New viewport rotation

    bool animated
    | Edit this page View Source

    UpdateMyLocation(MPoint, bool)

    Updates own location

    Declaration
    public void UpdateMyLocation(MPoint newLocation, bool animated = false)
    Parameters
    Type Name Description
    MPoint newLocation

    New location

    bool animated
    | Edit this page View Source

    UpdateMySpeed(double)

    Updates my speed

    Declaration
    public void UpdateMySpeed(double newSpeed)
    Parameters
    Type Name Description
    double newSpeed

    New speed

    | Edit this page View Source

    UpdateMyViewDirection(double, double, bool)

    Updates my view direction

    Declaration
    public void UpdateMyViewDirection(double newDirection, double newViewportRotation, bool animated = false)
    Parameters
    Type Name Description
    double newDirection

    New direction

    double newViewportRotation

    New viewport rotation

    bool animated

    true if animated

    Events

    | Edit this page View Source

    Clicked

    This event is triggered whenever the MyLocation symbol or label is clicked.

    Declaration
    public event EventHandler<MapInfoEventArgs>? Clicked
    Event Type
    Type Description
    EventHandler<MapInfoEventArgs>

    Implements

    ILayer
    IAnimatable
    INotifyPropertyChanged
    IModifyFeatureLayer
    IDisposable

    Extension Methods

    LayerExtensions.WaitForLoadingAsync(ILayer)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX