Class Map
Map class
Inherited Members
Namespace: Mapsui
Assembly: Mapsui.dll
Syntax
public class Map : INotifyPropertyChanged, IDisposable
Remarks
Map holds all map related infos like the target CRS, layers, widgets and so on.
Constructors
| Edit this page View SourceMap()
Initializes a new map
Declaration
public Map()
Properties
| Edit this page View SourceBackColor
Map background color (defaults to transparent)
Declaration
public Color BackColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
CRS
Coordinate reference system (projection type of map). Default: "EPSG:3857" (SphericalMercator).
Declaration
public string? CRS { get; set; }
Property Value
Type | Description |
---|---|
string |
Extent
Gets the extent of the map based on the extent of all the layers in the layers collection
Declaration
public MRect? Extent { get; }
Property Value
Type | Description |
---|---|
MRect | Full map extent |
Home
Declaration
public Action<Navigator> Home { get; set; }
Property Value
Type | Description |
---|---|
Action<Navigator> |
HomeIsCalledOnce
To register if the initial Home call has been done.
Declaration
public bool HomeIsCalledOnce { get; set; }
Property Value
Type | Description |
---|---|
bool |
Layers
A collection of layers. The first layer in the list is drawn first, the last one on top.
Declaration
public LayerCollection Layers { get; }
Property Value
Type | Description |
---|---|
LayerCollection |
Navigator
Handles all manipulations of the map viewport
Declaration
public Navigator Navigator { get; }
Property Value
Type | Description |
---|---|
Navigator |
Widgets
List of Widgets belonging to map
Declaration
public ConcurrentQueue<IWidget> Widgets { get; }
Property Value
Type | Description |
---|---|
ConcurrentQueue<IWidget> |
Methods
| Edit this page View SourceAbortFetch()
Abort fetching of all layers
Declaration
public void AbortFetch()
ClearCache()
Clear cache of all layers
Declaration
public void ClearCache()
Dispose()
Declaration
public virtual void Dispose()
GetWidgetsOfMapAndLayers()
Declaration
public IEnumerable<IWidget> GetWidgetsOfMapAndLayers()
Returns
Type | Description |
---|---|
IEnumerable<IWidget> |
OnInfo(MapInfoEventArgs?)
This method is to invoke the Info event from the Map. This method is called by the MapControl/MapView and should usually not be called from user code.
Declaration
public void OnInfo(MapInfoEventArgs? mapInfoEventArgs)
Parameters
Type | Name | Description |
---|---|---|
MapInfoEventArgs | mapInfoEventArgs |
OnViewportSizeInitialized()
Declaration
public void OnViewportSizeInitialized()
Refresh(ChangeType)
Refresh data of the map and than repaint it
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 |
RefreshData(FetchInfo)
Declaration
public void RefreshData(FetchInfo fetchInfo)
Parameters
Type | Name | Description |
---|---|---|
FetchInfo | fetchInfo |
RefreshGraphics()
Declaration
public void RefreshGraphics()
UpdateAnimations()
Declaration
public bool UpdateAnimations()
Returns
Type | Description |
---|---|
bool |
Events
| Edit this page View SourceDataChanged
DataChanged should be triggered by any data changes of any of the child layers
Declaration
public event DataChangedEventHandler? DataChanged
Event Type
Type | Description |
---|---|
DataChangedEventHandler |
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
Type | Description |
---|---|
EventHandler<MapInfoEventArgs> |
PropertyChanged
Called whenever a property changed
Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
Type | Description |
---|---|
PropertyChangedEventHandler |
RefreshGraphicsRequest
Declaration
public event EventHandler? RefreshGraphicsRequest
Event Type
Type | Description |
---|---|
EventHandler |
ViewportInitialized
Called when the viewport is initialized
Declaration
public event EventHandler? ViewportInitialized
Event Type
Type | Description |
---|---|
EventHandler |