Skip to content

ThinkGeoVectorTileSource

Namespace: ThinkGeo.Core

The ThinkGeo Cloud v3 vector tiles, authorized by apiKey. The published tile URL carries a {key} placeholder (the key is deliberately not baked into the public style documents); this source fills it in on every request - the C# equivalent of the web viewer's transformRequest.

public class ThinkGeoVectorTileSource : VectorTileSource, IVectorTileSource, IRawVectorTileSource, System.IDisposable

Inheritance object → VectorTileSource → ThinkGeoVectorTileSource
Implements IVectorTileSource, IRawVectorTileSource, IDisposable

Remarks:

The data is one dataset however it is dressed: pair this source with either of the published styles through MapStyle.AddStyle(ThinkGeoVectorStyles.Light, source), and switch between them with SetStyleAsync - the tiles never re-download, because the source is the same either way.

Properties

ApiKey

The apiKey the tiles are asked for with. A map that has the browser fetch the tiles rather than this source - the Blazor map - reads it from here and fills the placeholder there.

public string ApiKey { get; }

Property Value

string

VectorTileCache

Gets or sets the disk cache for downloaded tiles. Null means every tile is fetched from its source on demand.

public FileTileCache VectorTileCache { get; set; }

Property Value

FileTileCache

UserAgent

Gets or sets the User-Agent header sent with tile requests. Some public tile servers refuse requests without one.

public string UserAgent { get; set; }

Property Value

string

WebProxy

Gets or sets the proxy tile requests go through, or null for none.

public IWebProxy WebProxy { get; set; }

Property Value

IWebProxy

TimeoutInSeconds

Gets or sets the per-request timeout in seconds.

public int TimeoutInSeconds { get; set; }

Property Value

int

TileMatrixSet

public TileMatrixSet TileMatrixSet { get; }

Property Value

TileMatrixSet

MinDataZoom

public int MinDataZoom { get; }

Property Value

int

Remarks:

Zero: this source serves whatever its style document declares and reports no floor of its own, so nothing is skipped on its behalf.

MaxDataZoom

public int MaxDataZoom { get; }

Property Value

int

Remarks:

Starts at 14 (the hosted scheme's depth) and rises to the deepest maxzoom any of the document's sources publishes, so deeper tiles are fetched rather than overzoomed away.

IsOpen

public bool IsOpen { get; }

Property Value

bool

Constructors

ThinkGeoVectorTileSource(string)

Initializes the source over the published WorldStreets tiles.

public ThinkGeoVectorTileSource(string apiKey)

Parameters

apiKey string
Your ThinkGeo apiKey; every tile request carries it.

ThinkGeoVectorTileSource(string, string)

The same, reading the tile declarations from a specific style document - for a customized style published with the same {key} convention. The document only supplies the source declarations here; what the MAP draws is whatever style it was given.

public ThinkGeoVectorTileSource(string apiKey, string styleJsonUri)

Parameters

apiKey string
Your ThinkGeo apiKey.

styleJsonUri string
The style document declaring the tile sources.

Events

SendingHttpRequest

Raised before each tile request is sent. Rewrite the request to inject an API key, a signed URL or authentication headers; set Cancel to skip the request. This is how keyed providers plug in without a dedicated class.

public event EventHandler<SendingHttpRequestMessageEventArgs> SendingHttpRequest;

ReceivedHttpResponse

Raised when a tile response has arrived, before its status is read: a look at the headers, the status and the timing of every request.

public event EventHandler<ReceivedHttpResponseMessageEventArgs> ReceivedHttpResponse;