Class MapControl
Implements
Inherited Members
Namespace: Mapsui.UI.Eto
Assembly: Mapsui.UI.Eto.dll
Syntax
public class MapControl : SkiaDrawable, IHandlerSource, IBindable, IMouseInputSource, IKeyboardInputSource, ICallbackSource, IBindableWidgetContainer, IMapControl, INotifyPropertyChanged, IDisposable
Constructors
| Edit this page View SourceMapControl()
Declaration
public MapControl()
Properties
| Edit this page View SourceMap
Map holding data for which is shown in this MapControl
Declaration
public Map Map { get; set; }
Property Value
| Type | Description |
|---|---|
| Map |
MoveButton
Declaration
public MouseButtons MoveButton { get; set; }
Property Value
| Type | Description |
|---|---|
| MouseButtons |
MoveCursor
Declaration
public Cursor MoveCursor { get; set; }
Property Value
| Type | Description |
|---|---|
| Cursor |
MoveModifier
Declaration
public Keys MoveModifier { get; set; }
Property Value
| Type | Description |
|---|---|
| Keys |
Performance
Object to save performance information about the drawing of the map
Declaration
public Performance? Performance { get; set; }
Property Value
| Type | Description |
|---|---|
| Performance |
Remarks
If this is null, no performance information is saved.
PixelDensity
The number of pixel per device independent unit
Declaration
public float PixelDensity { get; }
Property Value
| Type | Description |
|---|---|
| float |
ReSnapRotationDegrees
With how many degrees from 0 should map snap to 0 degrees
Declaration
public double ReSnapRotationDegrees { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Renderer
Renderer that is used from this MapControl
Declaration
public IRenderer Renderer { get; set; }
Property Value
| Type | Description |
|---|---|
| IRenderer |
UnSnapRotationDegrees
After how many degrees start rotation to take place
Declaration
public double UnSnapRotationDegrees { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
UpdateInterval
Interval between two redraws of the MapControl in ms
Declaration
public int UpdateInterval { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
ZoomButton
Declaration
public MouseButtons ZoomButton { get; set; }
Property Value
| Type | Description |
|---|---|
| MouseButtons |
ZoomModifier
Declaration
public Keys ZoomModifier { get; set; }
Property Value
| Type | Description |
|---|---|
| Keys |
Methods
| Edit this page View SourceCallHomeIfNeeded()
Declaration
public void CallHomeIfNeeded()
Dispose(bool)
Handles the disposal of this control
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | True if the caller called Eto.Widget.Dispose() manually, false if being called from a finalizer |
Overrides
| Edit this page View SourceForceUpdate()
Force a update of control
Declaration
public void ForceUpdate()
Remarks
When this function is called, the control draws itself once
GetMapInfo(MPoint?, int)
Check, if a feature at a given screen position is hit
Declaration
public MapInfo? GetMapInfo(MPoint? screenPosition, int margin = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| MPoint | screenPosition | Screen position to check for widgets and features |
| int | margin | An optional extra margin around the feature to enlarge the hit area. |
Returns
| Type | Description |
|---|---|
| MapInfo |
GetSnapshot(IEnumerable<ILayer>?)
Create a snapshot form map as PNG image
Declaration
public byte[] GetSnapshot(IEnumerable<ILayer>? layers = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ILayer> | layers | Layers that should be included in snapshot |
Returns
| Type | Description |
|---|---|
| byte[] | Byte array with snapshot in png format. If there are any problems than returns null. |
OnLoadComplete(EventArgs)
Raises the Eto.Forms.Control.LoadComplete event, and recurses to this container's children
Declaration
protected override void OnLoadComplete(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | Event arguments |
Overrides
| Edit this page View SourceOnMouseDown(MouseEventArgs)
Raises the Eto.Forms.Control.MouseDown event.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseEventArgs | e | Event arguments |
Overrides
Remarks
To override default behaviour of the control, set Eto.Forms.MouseEventArgs.Handled property to true.
OnMouseMove(MouseEventArgs)
Raises the Eto.Forms.Control.MouseMove event.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseEventArgs | e | Mouse event args |
Overrides
OnMouseUp(MouseEventArgs)
Raises the Eto.Forms.Control.MouseUp event.
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseEventArgs | e | Event arguments |
Overrides
OnMouseWheel(MouseEventArgs)
Raises the Eto.Forms.Control.MouseWheel event.
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseEventArgs | e | Event arguments |
Overrides
OnPaint(SKPaintEventArgs)
Declaration
protected override void OnPaint(SKPaintEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| SKPaintEventArgs | e |
Overrides
OnPropertyChanged(string)
Declaration
protected void OnPropertyChanged(string propertyName = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyName |
OnSizeChanged(EventArgs)
Raises the Eto.Forms.Control.SizeChanged event.
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | Event arguments |
Overrides
| Edit this page View SourceOpenBrowser(string)
Declaration
public void OpenBrowser(string url)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url |
Refresh(ChangeType)
Declaration
public void Refresh(ChangeType changeType = ChangeType.Discrete)
Parameters
| Type | Name | Description |
|---|---|---|
| ChangeType | changeType |
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 |
RefreshGraphics()
Declaration
public void RefreshGraphics()
ResetWidgetCache()
Reset the widget cache. It may be necessary to call this explicitly after the widgets have changed.
Declaration
protected void ResetWidgetCache()
StartUpdates(bool)
Start updates for control
Declaration
public void StartUpdates(bool refresh = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | refresh |
Remarks
When this function is called, the control is redrawn if needed
StopUpdates()
Stop updates for control
Declaration
public void StopUpdates()
Remarks
When this function is called, the control stops to redraw itself, even if it is needed
ToDeviceIndependentUnits(MPoint)
Converts coordinates in pixels to device independent units (or DIP or DP).
Declaration
public MPoint ToDeviceIndependentUnits(MPoint coordinateInPixels)
Parameters
| Type | Name | Description |
|---|---|---|
| MPoint | coordinateInPixels | Coordinate in pixels |
Returns
| Type | Description |
|---|---|
| MPoint | Coordinate in device independent units (or DIP or DP) |
ToPixels(MPoint)
Converts coordinates in device independent units (or DIP or DP) to pixels.
Declaration
public MPoint ToPixels(MPoint coordinateInDeviceIndependentUnits)
Parameters
| Type | Name | Description |
|---|---|---|
| MPoint | coordinateInDeviceIndependentUnits | Coordinate in device independent units (or DIP or DP) |
Returns
| Type | Description |
|---|---|
| MPoint | Coordinate in pixels |
Unsubscribe()
Unsubscribe from map events
Declaration
public void Unsubscribe()
ZoomToBox(MPoint, MPoint)
Declaration
public void ZoomToBox(MPoint beginPoint, MPoint endPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| MPoint | beginPoint | |
| MPoint | endPoint |
Events
| Edit this page View SourceInfo
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> |
PropertyChanged
Called whenever a property is changed
Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
| Type | Description |
|---|---|
| PropertyChangedEventHandler |