Class TileLayer
Layer, which displays a map consisting of individual tiles
Inherited Members
Namespace: Mapsui.Layers
Assembly: Mapsui.dll
Syntax
public class TileLayer : BaseLayer, ILayer, INotifyPropertyChanged, IAsyncDataFetcher
Constructors
| Improve this Doc View SourceTileLayer(ITileSource, Int32, Int32, Int32, IFetchStrategy, IRenderGetStrategy, Int32, Int32, Func<TileInfo, Object, Feature>, Func<TileInfo, Object>)
Create tile layer for given tile source
Declaration
public TileLayer(ITileSource source = null, int minTiles = 200, int maxTiles = 300, int maxRetries = 2, IFetchStrategy fetchStrategy = null, IRenderGetStrategy renderGetStrategy = null, int minExtraTiles = -1, int maxExtraTiles = -1, Func<TileInfo, object, Feature> fetchToFeature = null, Func<TileInfo, object> fetchGetTile = null)
Parameters
Type | Name | Description |
---|---|---|
BruTile.ITileSource | source | Tile source to use for this layer |
System.Int32 | minTiles | Minimum number of tiles to cache |
System.Int32 | maxTiles | Maximum number of tiles to cache |
System.Int32 | maxRetries | Unused |
IFetchStrategy | fetchStrategy | Strategy to get list of tiles for given extent |
IRenderGetStrategy | renderGetStrategy | |
System.Int32 | minExtraTiles | Number of minimum extra tiles for memory cache |
System.Int32 | maxExtraTiles | Number of maximum extra tiles for memory cache |
System.Func<BruTile.TileInfo, System.Object, Feature> | fetchToFeature | |
System.Func<BruTile.TileInfo, System.Object> | fetchGetTile |
TileLayer(Func<ITileSource>)
Create tile layer from tile source initializer function
Declaration
public TileLayer(Func<ITileSource> tileSourceInitializer)
Parameters
Type | Name | Description |
---|---|---|
System.Func<BruTile.ITileSource> | tileSourceInitializer | Initializer to create a tile layer source |
Properties
| Improve this Doc View SourceEnvelope
Returns the envelope of all avaiable data in the layer
Declaration
public override BoundingBox Envelope { get; }
Property Value
Type | Description |
---|---|
BoundingBox |
Overrides
| Improve this Doc View SourceResolutions
List of native resolutions
Declaration
public override IReadOnlyList<double> Resolutions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.Double> |
Overrides
| Improve this Doc View SourceTileSource
Tile source for this layer
Declaration
public ITileSource TileSource { get; set; }
Property Value
Type | Description |
---|---|
BruTile.ITileSource |
Methods
| Improve this Doc View SourceAbortFetch()
Aborts the tile fetches that are in progress. If this method is not called the threads will terminate naturally. It will just take a little longer.
Declaration
public void AbortFetch()
ClearCache()
Clear cache of layer
Declaration
public void ClearCache()
GetFeaturesInView(BoundingBox, Double)
Get all features in a given BoundingBox for a given resolution
Declaration
public override IEnumerable<IFeature> GetFeaturesInView(BoundingBox box, double resolution)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box | |
System.Double | resolution | Resolution of viewport |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IFeature> |
Overrides
| Improve this Doc View SourceIsCrsSupported(String)
Queries whether a layer supports projection to a certain CRS.
Declaration
public override bool? IsCrsSupported(string crs)
Parameters
Type | Name | Description |
---|---|---|
System.String | crs | The crs to project to |
Returns
Type | Description |
---|---|
System.Nullable<System.Boolean> | True if is does, false if it does not, null if it is unknown |
Overrides
| Improve this Doc View SourceRefreshData(BoundingBox, Double, Boolean)
Indicates that there has been a change in the view of the map
Declaration
public override void RefreshData(BoundingBox extent, double resolution, bool majorChange)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | extent | The new extent of the visible map |
System.Double | resolution | The new resolution of the visible map |
System.Boolean | majorChange | If true an implementation should always refresh it's data. If false (minorChange) the implementation could ignore it. Example: During dragging a map a WMS layer would not want to fetch data, only on the drag end. |