Class BaseLayer
Inheritance
Inherited Members
Namespace: Mapsui.Layers
Assembly: Mapsui.dll
Syntax
public abstract class BaseLayer : ILayer, IAnimatable, INotifyPropertyChanged, IDisposable
Constructors
| Edit this page View SourceBaseLayer()
Creates a BaseLayer without a name
Declaration
protected BaseLayer()
BaseLayer(string)
Creates a BaseLayer with a name
Declaration
protected BaseLayer(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name for this layer |
Properties
| Edit this page View SourceAttribution
Attribution for layer
Declaration
public HyperlinkWidget Attribution { get; set; }
Property Value
| Type | Description |
|---|---|
| HyperlinkWidget |
Busy
Flag, if layer is busy
Declaration
public virtual bool Busy { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
CustomLayerRendererName
Name of the custom layer renderer. Set this value if you want to use a custom renderer for this layer.
Declaration
public string? CustomLayerRendererName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Enabled
Specifies whether this layer should be rendered or not
Declaration
public bool Enabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Extent
Returns the envelope of all available data in the layer
Declaration
public virtual MRect? Extent { get; protected set; }
Property Value
| Type | Description |
|---|---|
| MRect |
Id
Numerical Id of layer
Declaration
public int Id { get; }
Property Value
| Type | Description |
|---|---|
| int |
MaxVisible
Minimum visible zoom level
Declaration
public double MaxVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
MinVisible
Minimum visible zoom level
Declaration
public double MinVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Name
Name of layer
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Opacity
Opacity of layer
Declaration
public double Opacity { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Resolutions
List of native resolutions
Declaration
public virtual IReadOnlyList<double> Resolutions { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<double> |
SortFeatures
Function to sort order of features for drawing
Declaration
public virtual Func<IEnumerable<IFeature>, IEnumerable<IFeature>> SortFeatures { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<IEnumerable<IFeature>, IEnumerable<IFeature>> |
Style
Gets or sets rendering style of layer
Declaration
public IStyle? Style { get; set; }
Property Value
| Type | Description |
|---|---|
| IStyle |
Tag
Gets or sets an arbitrary object value that can be used to store custom information about this element
Declaration
public object? Tag { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
Methods
| Edit this page View SourceDataHasChanged()
To indicate the data withing the layer has changed. This triggers a DataChanged event. This is necessary for situations where the layer can not know about changes to it's data as in the case of editing of a geometry.
Declaration
public void DataHasChanged()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public virtual void Dispose()
Dispose(bool)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
GetFeatures(MRect, double)
Get all features in a given MRect for a given resolution
Declaration
public abstract IEnumerable<IFeature> GetFeatures(MRect box, double resolution)
Parameters
| Type | Name | Description |
|---|---|---|
| MRect | box | |
| double | resolution | Resolution of viewport |
Returns
| Type | Description |
|---|---|
| IEnumerable<IFeature> |
NextId()
Declaration
public static int NextId()
Returns
| Type | Description |
|---|---|
| int |
OnDataChanged(DataChangedEventArgs)
Declaration
protected void OnDataChanged(DataChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| DataChangedEventArgs | e |
OnPropertyChanged(string)
Declaration
protected virtual void OnPropertyChanged(string propertyName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyName |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
| Edit this page View SourceUpdateAnimations()
Declaration
public virtual bool UpdateAnimations()
Returns
| Type | Description |
|---|---|
| bool | Returns true if animations are running and a graphics update is needed. |
Events
| Edit this page View SourceDataChanged
Event called when the data within the layer has changed allowing listeners to react to this.
Declaration
public event DataChangedEventHandler? DataChanged
Event Type
| Type | Description |
|---|---|
| DataChangedEventHandler |
PropertyChanged
Called whenever a property changed
Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
| Type | Description |
|---|---|
| PropertyChangedEventHandler |