Class MapControl
Class, that uses the API of all other Mapsui MapControls
Inheritance
Implements
Inherited Members
Namespace: Mapsui.UI.Forms
Assembly: Mapsui.UI.Forms.dll
Syntax
public class MapControl : SKGLView, IDynamicResourceHandler, IElement, INameScope, INavigationProxy, IAnimatable, IResourcesProvider, IStyleElement, IFlowDirectionController, IPropertyPropagationController, IVisualController, ITabStopElement, IStyleSelectable, IStylable, IGestureController, ISKGLViewController, IViewController, IVisualElementController, IElementController, IMapControl, IDisposable, INotifyPropertyChanged
Constructors
| Improve this Doc View SourceMapControl()
Declaration
public MapControl()
Fields
| Improve this Doc View SourceUseDoubleTap
Declaration
public bool UseDoubleTap
Field Value
Type | Description |
---|---|
System.Boolean |
Properties
| Improve this Doc View SourceMap
Map holding data for which is shown in this MapControl
Declaration
public Map Map { get; set; }
Property Value
Type | Description |
---|---|
Map |
Navigator
Handles all manipulations of the map viewport
Declaration
public INavigator Navigator { get; set; }
Property Value
Type | Description |
---|---|
INavigator |
PixelDensity
Declaration
public float PixelDensity { get; }
Property Value
Type | Description |
---|---|
System.Single |
Renderer
Renderer that is used from this MapControl
Declaration
public IRenderer Renderer { get; set; }
Property Value
Type | Description |
---|---|
IRenderer |
ReSnapRotationDegrees
With how many degrees from 0 should map snap to 0 degrees
Declaration
public double ReSnapRotationDegrees { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
ScreenHeight
Declaration
public float ScreenHeight { get; }
Property Value
Type | Description |
---|---|
System.Single |
ScreenWidth
Declaration
public float ScreenWidth { get; }
Property Value
Type | Description |
---|---|
System.Single |
SymbolCache
Declaration
public ISymbolCache SymbolCache { get; }
Property Value
Type | Description |
---|---|
ISymbolCache |
UnSnapRotationDegrees
After how many degrees start rotation to take place
Declaration
public double UnSnapRotationDegrees { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Viewport
Viewport holding information about visible part of the map. Viewport can never be null.
Declaration
public IReadOnlyViewport Viewport { get; }
Property Value
Type | Description |
---|---|
IReadOnlyViewport |
Methods
| Improve this Doc View SourceCallHomeIfNeeded()
Declaration
public void CallHomeIfNeeded()
Clear()
Clear cache and repaint map
Declaration
public void Clear()
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
GetMapInfo(Point, Int32)
Check, if a feature at a given screen position is hit
Declaration
public MapInfo GetMapInfo(Point screenPosition, int margin = 0)
Parameters
Type | Name | Description |
---|---|---|
Point | screenPosition | Screen position to check for widgets and features |
System.Int32 | 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 |
---|---|---|
System.Collections.Generic.IEnumerable<ILayer> | layers | Layers that should be included in snapshot |
Returns
Type | Description |
---|---|
System.Byte[] | Byte array with snapshot in png format. If there are any problems than returns null. |
Initialize()
Declaration
public void Initialize()
OnPropertyChanged(String)
Declaration
protected override void OnPropertyChanged(string propertyName = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName |
Overrides
OpenBrowser(String)
Public functions
Declaration
public void OpenBrowser(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url |
Refresh()
Refresh data of the map and than repaint it
Declaration
public void Refresh()
RefreshData()
Refresh data of Map, but don't paint it
Declaration
public void RefreshData()
RefreshGraphics()
Declaration
public void RefreshGraphics()
ToDeviceIndependentUnits(Point)
Converts coordinates in pixels to device independent units (or DIP or DP).
Declaration
public Point ToDeviceIndependentUnits(Point coordinateInPixels)
Parameters
Type | Name | Description |
---|---|---|
Point | coordinateInPixels | Coordinate in pixels |
Returns
Type | Description |
---|---|
Point | Coordinate in device independent units (or DIP or DP) |
ToPixels(Point)
Converts coordinates in device independent units (or DIP or DP) to pixels.
Declaration
public Point ToPixels(Point coordinateInDeviceIndependentUnits)
Parameters
Type | Name | Description |
---|---|---|
Point | coordinateInDeviceIndependentUnits | Coordinate in device independent units (or DIP or DP) |
Returns
Type | Description |
---|---|
Point | Coordinate in pixels |
Unsubscribe()
Unsubscribe from map events
Declaration
public void Unsubscribe()
Events
| Improve this Doc View SourceDoubleTap
DoubleTap is called, when user clicks with a mouse button or tap with a finger two or more times on map
Declaration
public event EventHandler<TappedEventArgs> DoubleTap
Event Type
Type | Description |
---|---|
System.EventHandler<TappedEventArgs> |
Fling
Fling is called, when user release mouse button or lift finger while moving with a certain speed, higher than speed of swipe
Declaration
public event EventHandler<SwipedEventArgs> Fling
Event Type
Type | Description |
---|---|
System.EventHandler<SwipedEventArgs> |
Hovered
Hover is called, when user move mouse over map without pressing mouse button
Declaration
public event EventHandler<HoveredEventArgs> Hovered
Event Type
Type | Description |
---|---|
System.EventHandler<HoveredEventArgs> |
Info
Called whenever a feature in one of the layers in InfoLayers is hitten by a click
Declaration
public event EventHandler<MapInfoEventArgs> Info
Event Type
Type | Description |
---|---|
System.EventHandler<MapInfoEventArgs> |
LongTap
LongTap is called, when user clicks with a mouse button or tap with a finger on map for 500 ms
Declaration
public event EventHandler<TappedEventArgs> LongTap
Event Type
Type | Description |
---|---|
System.EventHandler<TappedEventArgs> |
PropertyChanged
Called whenever a property is changed
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |
SingleTap
SingleTap is called, when user clicks with a mouse button or tap with a finger on map
Declaration
public event EventHandler<TappedEventArgs> SingleTap
Event Type
Type | Description |
---|---|
System.EventHandler<TappedEventArgs> |
Swipe
Swipe is called, when user release mouse button or lift finger while moving with a certain speed
Declaration
public event EventHandler<SwipedEventArgs> Swipe
Event Type
Type | Description |
---|---|
System.EventHandler<SwipedEventArgs> |
TouchEnded
TouchEnd is called, when user release a mouse button or doesn't touch display anymore
Declaration
public event EventHandler<TouchedEventArgs> TouchEnded
Event Type
Type | Description |
---|---|
System.EventHandler<TouchedEventArgs> |
TouchEntered
TouchEntered is called, when user moves an active touch onto the view
Declaration
public event EventHandler<TouchedEventArgs> TouchEntered
Event Type
Type | Description |
---|---|
System.EventHandler<TouchedEventArgs> |
TouchExited
TouchExited is called, when user moves an active touch off the view
Declaration
public event EventHandler<TouchedEventArgs> TouchExited
Event Type
Type | Description |
---|---|
System.EventHandler<TouchedEventArgs> |
TouchMove
TouchMove is called, when user move mouse over map (independent from mouse button state) or move finger on display
Declaration
public event EventHandler<TouchedEventArgs> TouchMove
Event Type
Type | Description |
---|---|
System.EventHandler<TouchedEventArgs> |
TouchStarted
Event handlers
Declaration
public event EventHandler<TouchedEventArgs> TouchStarted
Event Type
Type | Description |
---|---|
System.EventHandler<TouchedEventArgs> |
ViewportInitialized
Called when the viewport is initialized
Declaration
public event EventHandler ViewportInitialized
Event Type
Type | Description |
---|---|
System.EventHandler |
Zoomed
Zoom is called, when map should be zoomed
Declaration
public event EventHandler<ZoomedEventArgs> Zoomed
Event Type
Type | Description |
---|---|
System.EventHandler<ZoomedEventArgs> |