Class MapControl
Assembly: Mapsui.UI.WindowsForms.dll
public class MapControl : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IContainerControl, IMapControl, IDisposable, INotifyPropertyChanged
Constructors
|
Edit this page
View Source
Declaration
Properties
|
Edit this page
View Source
Map holding data for which is shown in this MapControl
Declaration
[Browsable(false)]
public Map Map { get; set; }
Property Value
|
Edit this page
View Source
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
|
Edit this page
View Source
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
|
Edit this page
View Source
Declaration
public static bool UseGPU { get; set; }
Property Value
Methods
|
Edit this page
View Source
Releases the unmanaged resources used by the Control and its child controls and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type |
Name |
Description |
| bool |
disposing |
true to release both managed and unmanaged resources; false to release only unmanaged resources.
|
Overrides
|
Edit this page
View Source
Force a update of control
Declaration
public void ForceUpdate()
|
Edit this page
View Source
Check, if a feature at a given screen position is hit.
Declaration
public MapInfo GetMapInfo(ScreenPosition screenPosition, IEnumerable<ILayer> layers)
Parameters
Returns
|
Edit this page
View Source
Returns the number of pixels per device independent unit
Declaration
public float? GetPixelDensity()
Returns
|
Edit this page
View Source
Declaration
protected Task<MapInfo> GetRemoteMapInfoAsync(ScreenPosition screenPosition, Viewport viewport, IEnumerable<ILayer> layers)
Parameters
Returns
|
Edit this page
View Source
Declaration
public ScreenPosition GetScreenPosition(Point position)
Parameters
| Type |
Name |
Description |
| Point |
position |
|
Returns
|
Edit this page
View Source
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
Declaration
public void InvalidateCanvas()
|
Edit this page
View Source
Declaration
protected void OnMapInfo(MapInfoEventArgs mapInfoEventArgs)
Parameters
|
Edit this page
View Source
Declaration
protected virtual bool OnMapPointerMoved(ScreenPosition screenPosition, MPoint worldPosition, GestureType gestureType)
Parameters
Returns
|
Edit this page
View Source
Declaration
protected virtual bool OnMapPointerPressed(ScreenPosition screenPosition, MPoint worldPosition)
Parameters
Returns
|
Edit this page
View Source
Declaration
protected virtual bool OnMapPointerReleased(ScreenPosition screenPosition, MPoint worldPosition)
Parameters
Returns
|
Edit this page
View Source
Declaration
protected virtual bool OnMapTapped(ScreenPosition screenPosition, MPoint worldPosition, GestureType gestureType)
Parameters
Returns
|
Edit this page
View Source
Declaration
protected void OnPropertyChanged(string propertyName = "")
Parameters
| Type |
Name |
Description |
| string |
propertyName |
|
|
Edit this page
View Source
Declaration
public void OpenInBrowser(string url)
Parameters
| Type |
Name |
Description |
| string |
url |
|
|
Edit this page
View Source
Declaration
public void Refresh(ChangeType changeType = ChangeType.Discrete)
Parameters
|
Edit this page
View Source
Refresh data of Map, but don't paint it
Declaration
public void RefreshData(ChangeType changeType = ChangeType.Discrete)
Parameters
|
Edit this page
View Source
Declaration
public void RefreshGraphics()
|
Edit this page
View Source
Declaration
public void SetMapRenderer(IMapRenderer mapRenderer)
Parameters
|
Edit this page
View Source
Unsubscribe from map events
Declaration
public void Unsubscribe()
Events
|
Edit this page
View Source
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
|
Edit this page
View Source
Event that is triggered when on pointer move. Can be a drag or hover.
Declaration
public event EventHandler<MapEventArgs>? MapPointerMoved
Event Type
|
Edit this page
View Source
Event that is triggered when on pointer down.
Declaration
public event EventHandler<MapEventArgs>? MapPointerPressed
Event Type
|
Edit this page
View Source
Event that is triggered when on pointer up.
Declaration
public event EventHandler<MapEventArgs>? MapPointerReleased
Event Type
|
Edit this page
View Source
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
|
Edit this page
View Source
Called whenever a property is changed
Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
Implements
Extension Methods