Class Layer
Create layer with name
Implements
Inherited Members
Namespace: Mapsui.Layers
Assembly: Mapsui.dll
Syntax
public class Layer : BaseLayer, ILayer, IAnimatable, INotifyPropertyChanged, IDisposable, IFetchableSource, ILayerDataSource<IProvider>
Constructors
| Edit this page View SourceLayer()
Create a new layer
Declaration
public Layer()
Layer(string)
Create layer with name
Declaration
public Layer(string layerName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | layerName | Name to use for layer |
Properties
| Edit this page View SourceAnimations
Declaration
public List<Func<bool>> Animations { get; }
Property Value
| Type | Description |
|---|---|
| List<Func<bool>> |
DataSource
Data source for this layer
Declaration
public IProvider? DataSource { get; set; }
Property Value
| Type | Description |
|---|---|
| IProvider |
Extent
Returns the extent of the layer
Declaration
public override MRect? Extent { get; }
Property Value
| Type | Description |
|---|---|
| MRect | Bounding box corresponding to the extent of the features in the layer |
Overrides
Methods
| Edit this page View SourceClearCache()
Clears the cache of this layer. Call this if source data has was invalidated or the layer is removed.
Declaration
public void ClearCache()
FetchAsync(FetchInfo, int)
Declaration
public Task FetchAsync(FetchInfo fetchInfo, int refreshCounter)
Parameters
| Type | Name | Description |
|---|---|---|
| FetchInfo | fetchInfo | |
| int | refreshCounter |
Returns
| Type | Description |
|---|---|
| Task |
GetFeatures(MRect, double)
Get all features in a given MRect for a given resolution
Declaration
public override IEnumerable<IFeature> GetFeatures(MRect extent, double resolution)
Parameters
| Type | Name | Description |
|---|---|---|
| MRect | extent | Bounding box |
| double | resolution | Resolution of viewport |
Returns
| Type | Description |
|---|---|
| IEnumerable<IFeature> |
Overrides
| Edit this page View SourceGetFetchJobs(int, int)
Gets the fetch requests for this layer. The requests are based on the viewport stored within the layer.
Declaration
public FetchJob[] GetFetchJobs(int activeFetches, int availableFetchSlots)
Parameters
| Type | Name | Description |
|---|---|---|
| int | activeFetches | |
| int | availableFetchSlots | Number of available fetch slots in the caller. It is the maximum number of fetch jobs the method should return. |
Returns
| Type | Description |
|---|---|
| FetchJob[] |
OnFetchRequested()
Declaration
protected virtual void OnFetchRequested()
UpdateAnimations()
Declaration
public override bool UpdateAnimations()
Returns
| Type | Description |
|---|---|
| bool | Returns true if animations are running and a graphics update is needed. |
Overrides
| Edit this page View SourceViewportChanged(FetchInfo)
Informs the layer that the viewport has changed and it should update its data accordingly.
Declaration
public void ViewportChanged(FetchInfo fetchInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| FetchInfo | fetchInfo |
Events
| Edit this page View SourceFetchRequested
Indicates to the listener that it should fetch data again. This event is raised when there was a change in source data, so only relevant for dynamic data. The fetches triggered by viewport changes do not depend on it.
Declaration
public event EventHandler<FetchRequestedEventArgs>? FetchRequested
Event Type
| Type | Description |
|---|---|
| EventHandler<FetchRequestedEventArgs> |