Class MapControl
Assembly: Mapsui.UI.Android.dll
Syntax
public class MapControl : ViewGroup, Drawable.ICallback, IAccessibilityEventSource, KeyEvent.ICallback, IViewManager, IViewParent, IJavaObject, IJavaPeerable, IMapControl, INotifyPropertyChanged, IDisposable
Constructors
|
Edit this page
View Source
MapControl(Context, IAttributeSet)
Declaration
public MapControl(Context context, IAttributeSet attrs)
Parameters
|
Edit this page
View Source
MapControl(Context, IAttributeSet, int)
Declaration
public MapControl(Context context, IAttributeSet attrs, int defStyle)
Parameters
Properties
|
Edit this page
View Source
Map
Map holding data for which is shown in this MapControl
Declaration
public Map Map { get; set; }
Property Value
|
Edit this page
View Source
MaxTapGestureMovement
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
RenderMode
Declaration
public SkiaRenderMode RenderMode { get; set; }
Property Value
|
Edit this page
View Source
UseFling
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
Methods
|
Edit this page
View Source
Dispose(bool)
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type |
Name |
Description |
| bool |
disposing |
To be added.
|
Overrides
Remarks
|
Edit this page
View Source
ForceUpdate()
Force a update of control
Declaration
public void ForceUpdate()
Remarks
|
Edit this page
View Source
GetMapInfo(ScreenPosition, IEnumerable<ILayer>)
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
GetPixelDensity()
Returns the number of pixels per device independent unit
Declaration
public float? GetPixelDensity()
Returns
|
Edit this page
View Source
GetRemoteMapInfoAsync(ScreenPosition, Viewport, IEnumerable<ILayer>)
Declaration
protected Task<MapInfo> GetRemoteMapInfoAsync(ScreenPosition screenPosition, Viewport viewport, IEnumerable<ILayer> layers)
Parameters
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
InvalidateCanvas()
Declaration
public void InvalidateCanvas()
|
Edit this page
View Source
MapControl_Touch(object?, TouchEventArgs)
Declaration
public void MapControl_Touch(object? sender, View.TouchEventArgs args)
Parameters
|
Edit this page
View Source
OnLayout(bool, int, int, int, int)
Called from layout when this view should
assign a size and position to each of its children.
Declaration
protected override void OnLayout(bool changed, int l, int t, int r, int b)
Parameters
| Type |
Name |
Description |
| bool |
changed |
This is a new size or position for this view
|
| int |
l |
Left position, relative to parent
|
| int |
t |
Top position, relative to parent
|
| int |
r |
Right position, relative to parent
|
| int |
b |
Bottom position, relative to parent
|
Overrides
Remarks
|
Edit this page
View Source
OnMapInfo(MapInfoEventArgs)
Declaration
protected void OnMapInfo(MapInfoEventArgs mapInfoEventArgs)
Parameters
|
Edit this page
View Source
OnMapPointerMoved(ScreenPosition, MPoint, GestureType)
Declaration
protected virtual bool OnMapPointerMoved(ScreenPosition screenPosition, MPoint worldPosition, GestureType gestureType)
Parameters
Returns
|
Edit this page
View Source
OnMapPointerPressed(ScreenPosition, MPoint)
Declaration
protected virtual bool OnMapPointerPressed(ScreenPosition screenPosition, MPoint worldPosition)
Parameters
Returns
|
Edit this page
View Source
OnMapPointerReleased(ScreenPosition, MPoint)
Declaration
protected virtual bool OnMapPointerReleased(ScreenPosition screenPosition, MPoint worldPosition)
Parameters
Returns
|
Edit this page
View Source
OnMapTapped(ScreenPosition, MPoint, GestureType)
Declaration
protected virtual bool OnMapTapped(ScreenPosition screenPosition, MPoint worldPosition, GestureType gestureType)
Parameters
Returns
|
Edit this page
View Source
OnPropertyChanged(string)
Declaration
protected void OnPropertyChanged(string propertyName = "")
Parameters
| Type |
Name |
Description |
| string |
propertyName |
|
|
Edit this page
View Source
OnSizeChanged(int, int, int, int)
This is called during layout when the size of this view has changed.
Declaration
protected override void OnSizeChanged(int width, int height, int oldWidth, int oldHeight)
Parameters
| Type |
Name |
Description |
| int |
width |
|
| int |
height |
|
| int |
oldWidth |
|
| int |
oldHeight |
|
Overrides
Remarks
|
Edit this page
View Source
OpenInBrowser(string)
Declaration
public void OpenInBrowser(string url)
Parameters
| Type |
Name |
Description |
| string |
url |
|
|
Edit this page
View Source
Refresh(ChangeType)
Declaration
public void Refresh(ChangeType changeType = ChangeType.Discrete)
Parameters
|
Edit this page
View Source
RefreshData(ChangeType)
Refresh data of Map, but don't paint it
Declaration
public void RefreshData(ChangeType changeType = ChangeType.Discrete)
Parameters
|
Edit this page
View Source
RefreshGraphics()
Declaration
public void RefreshGraphics()
|
Edit this page
View Source
SetMapRenderer(IMapRenderer)
Declaration
public void SetMapRenderer(IMapRenderer mapRenderer)
Parameters
|
Edit this page
View Source
Unsubscribe()
Unsubscribe from map events
Declaration
public void Unsubscribe()
Events
|
Edit this page
View Source
Info
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
Remarks
|
Edit this page
View Source
MapPointerMoved
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
MapPointerPressed
Event that is triggered when on pointer down.
Declaration
public event EventHandler<MapEventArgs>? MapPointerPressed
Event Type
|
Edit this page
View Source
MapPointerReleased
Event that is triggered when on pointer up.
Declaration
public event EventHandler<MapEventArgs>? MapPointerReleased
Event Type
|
Edit this page
View Source
MapTapped
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
PropertyChanged
Called whenever a property is changed
Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
Implements
Extension Methods