Class MyLocationLayer
A layer to display a symbol for own location
Inherited Members
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 SourceMyLocationLayer(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 |
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 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 |
IsCentered
MyLocation is always in the center of the map
Declaration
public bool IsCentered { get; set; }
Property Value
Type | Description |
---|---|
bool |
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 MPoint MyLocation { get; }
Property Value
Type | Description |
---|---|
MPoint | 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(MPoint, bool)
Updates own location
Declaration
public void UpdateMyLocation(MPoint newLocation, bool animated = false)
Parameters
Type | Name | Description |
---|---|---|
MPoint | 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<MapInfoEventArgs>? Clicked
Event Type
Type | Description |
---|---|
EventHandler<MapInfoEventArgs> |