Class MyLocationLayer
A layer to display a symbol for own location
Inherited Members
Namespace: Mapsui.UI.Objects
Assembly: Mapsui.UI.Forms.dll
Syntax
public class MyLocationLayer : BaseLayer, ILayer, IAnimatable, INotifyPropertyChanged, IDisposable, IModifyFeatureLayer
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 SourceMyLocationLayer(MapView)
Initializes a new instance of the MyLocationLayer class.
Declaration
public MyLocationLayer(MapView view)
Parameters
Type | Name | Description |
---|---|---|
MapView | view | MapView, to which this layer belongs |
MyLocationLayer(MapView, Position)
Initializes a new instance of the MyLocationLayer class with a starting location.
Declaration
public MyLocationLayer(MapView view, Position position)
Parameters
Type | Name | Description |
---|---|---|
MapView | view | MapView, to which this layer belongs |
Position | position | Position, where to start |
MyLocationLayer(MapView)
Initializes a new instance of the MyLocationLayer class.
Declaration
public MyLocationLayer(MapView view)
Parameters
Type | Name | Description |
---|---|---|
MapView | view | MapView, to which this layer belongs |
MyLocationLayer(MapView, Position)
Initializes a new instance of the MyLocationLayer class with a starting location.
Declaration
public MyLocationLayer(MapView view, Position position)
Parameters
Type | Name | Description |
---|---|---|
MapView | view | MapView, to which this layer belongs |
Position | position | Position, where to start |
Properties
| Edit this page View SourceCalloutText
The text that is displayed in the MyLocation callout (can contain line breaks).
Declaration
public string CalloutText { get; set; }
Property Value
Type | Description |
---|---|
string |
Direction
Movement direction of device at location
Declaration
public double Direction { get; }
Property Value
Type | Description |
---|---|
double | Direction at location |
IsMoving
Should be moving arrow or round circle displayed
Declaration
public bool IsMoving { get; set; }
Property Value
Type | Description |
---|---|
bool |
MyLocation
Position of location, that is displayed
Declaration
public Position MyLocation { get; }
Property Value
Type | Description |
---|---|
Position | Position of location |
Scale
Scale of symbol
Declaration
public double Scale { get; set; }
Property Value
Type | Description |
---|---|
double | Scale of symbol |
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 |
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 SourceDispose(bool)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Overrides
| Edit this page View SourceGetFeatures(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
| Edit this page View SourceUpdateAnimations()
Declaration
public override bool UpdateAnimations()
Returns
Type | Description |
---|---|
bool | Returns true if animations are running and a graphics update is needed. |
Overrides
| Edit this page View SourceUpdateMyDirection(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 |
UpdateMyLocation(Position, bool)
Updates my location
Declaration
public void UpdateMyLocation(Position newLocation, bool animated = false)
Parameters
Type | Name | Description |
---|---|---|
Position | newLocation | New location |
bool | animated |
UpdateMyLocation(Position, bool)
Updates my location
Declaration
public void UpdateMyLocation(Position newLocation, bool animated = false)
Parameters
Type | Name | Description |
---|---|---|
Position | newLocation | New location |
bool | animated |
UpdateMySpeed(double)
Updates my speed
Declaration
public void UpdateMySpeed(double newSpeed)
Parameters
Type | Name | Description |
---|---|---|
double | newSpeed | New speed |
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 SourceClicked
This event is triggered whenever the MyLocation symbol or label is clicked.
Declaration
public event EventHandler<DrawableClickedEventArgs>? Clicked
Event Type
Type | Description |
---|---|
EventHandler<DrawableClickedEventArgs> |