PmTilesVectorTileSource¶
Namespace: ThinkGeo.Core
A local .pmtiles archive of vector tiles - the vector twin of PmTilesRasterTileSource. The archive is the data; how it draws comes from the style layers that reference it.
public sealed class PmTilesVectorTileSource : IVectorTileSource, IRawVectorTileSource, System.IDisposable
Inheritance object → PmTilesVectorTileSource
Implements IVectorTileSource, IRawVectorTileSource, IDisposable
Remarks:
Tiles are placed on the Web Mercator grid, which is what a .pmtiles's z/x/y means. An archive that carries a grid of its own - a .tgtiles, see TgTilesVectorTileSource - is refused at open rather than drawn in the wrong place; that source reads both kinds.
Properties¶
SourceId¶
Gets or sets the id style layers reference this source by (their "source"). Binding a style document to this source sets it to the document's source name.
public string SourceId { get; set; }
Property Value¶
MetadataJson¶
The archive's metadata JSON, read at open.
public string MetadataJson { get; private set; }
Property Value¶
TileMatrixSet¶
public TileMatrixSet TileMatrixSet { get; }
Property Value¶
MinDataZoom¶
public int MinDataZoom { get; }
Property Value¶
MaxDataZoom¶
public int MaxDataZoom { get; }
Property Value¶
IsOpen¶
public bool IsOpen { get; }
Property Value¶
Constructors¶
PmTilesVectorTileSource(string)¶
Initializes a source over the specified .pmtiles file.
public PmTilesVectorTileSource(string filePath)
Parameters¶
filePath string
The path of the archive.
Methods¶
OpenAsync(CancellationToken)¶
public Task OpenAsync(CancellationToken cancellationToken)
Parameters¶
cancellationToken CancellationToken
Returns¶
GetBoundingBox()¶
Returns the archive's declared coverage in Web Mercator, from its header, or the whole world when the header declares none.
public RectangleShape GetBoundingBox()
Returns¶
GetFeaturesFromTileAsync(int, long, long, CancellationToken)¶
public Task<Dictionary<string, Collection<Feature>>> GetFeaturesFromTileAsync(int zoom, long x, long y, CancellationToken cancellationToken)
Parameters¶
zoom int
x long
y long
cancellationToken CancellationToken
Returns¶
Task<Dictionary<string, Collection<Feature>>>
Dispose()¶
Closes the archive.
public void Dispose()