Skip to content

WmtsClient

Namespace: ThinkGeo.Core

A complete WMTS request client and nothing else: capabilities, tile grids and GetTile URL construction, with no Layer, no cache and no drawing. The tile source for the GPU renderer stands on this; WmtsAsyncLayer is a Layer that adds disk caching and classic drawing around the same protocol pieces.

public sealed class WmtsClient

Inheritance object → WmtsClient

Properties

ServerUri

The service endpoint.

public Uri ServerUri { get; set; }

Property Value

Uri

ActiveLayerName

The layer to request tiles from. The identifier is normalized on the way in.

public string ActiveLayerName { get; set; }

Property Value

string

ActiveStyleName

The style to request for WmtsClient.ActiveLayerName.

public string ActiveStyleName { get; set; }

Property Value

string

OutputFormat

The image MIME type to request.

public string OutputFormat { get; set; }

Property Value

string

TileMatrixSetName

The tile matrix set to request in, naming the grid WmtsClient.TileMatrixSet returns.

public string TileMatrixSetName { get; set; }

Property Value

string

Parameters

Extra query-string parameters added to every request.

public Dictionary<string, string> Parameters { get; }

Property Value

Dictionary<string, string>

Dimensions

Values for the extra dimensions a server declares, such as time or elevation.

public Dictionary<string, string> Dimensions { get; }

Property Value

Dictionary<string, string>

WebProxy

The proxy to reach the server through.

public IWebProxy WebProxy { get; set; }

Property Value

IWebProxy

Credentials

The credentials a service behind HTTP authentication is answered with.

public ICredentials Credentials { get; set; }

Property Value

ICredentials

TimeoutInSeconds

How long a request may take before it is abandoned. Twenty seconds by default.

public int TimeoutInSeconds { get; set; }

Property Value

int

UserAgent

The User-Agent header sent with each request.

public string UserAgent { get; set; }

Property Value

string

WmtsServerEncodingType

Whether tiles are requested as key-value pairs or through the RESTful template the server declares.

public WmtsServerEncodingType WmtsServerEncodingType { get; set; }

Property Value

WmtsServerEncodingType

AxisOrder

How the tile row and column are ordered in a request. Setting it overrides what the capabilities imply.

public WmtsAxisOrder AxisOrder { get; set; }

Property Value

WmtsAxisOrder

IsOpen

Whether WmtsClient.OpenAsync(CancellationToken) has completed.

public bool IsOpen { get; private set; }

Property Value

bool

TileMatrixSet

The grid of the chosen WmtsClient.TileMatrixSetName. Valid after WmtsClient.OpenAsync(CancellationToken).

public WmtsTileMatrixSet TileMatrixSet { get; }

Property Value

WmtsTileMatrixSet

Constructors

WmtsClient(Uri)

Creates a client for a WMTS endpoint.

public WmtsClient(Uri serverUri)

Parameters

serverUri Uri
The service endpoint.

Methods

OpenAsync(CancellationToken)

Fetches and parses the server's capabilities: the KVP address first, the RESTful document address as the fallback, exactly as the layer negotiates.

public Task OpenAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

GetRequestUri(long, long, int)

The GetTile address for one tile, or null when the layer's advertised range says the tile does not exist.

public string GetRequestUri(long x, long y, int zoomLevel)

Parameters

x long

y long

zoomLevel int

Returns

string

GetBoundingBox()

The extent the active layer covers, in the coordinates of the chosen tile matrix set - the same resolution order the layer uses: the layer's own BoundingBox, its WGS84 one, then the matrix set's.

public RectangleShape GetBoundingBox()

Returns

RectangleShape

Events

SendingHttpRequest

Raised before the capabilities request this client makes when it opens. Rewrite the request to add an API key, a signed URL or authentication headers; set Cancel to skip it. The GPU tile sources forward their own SendingHttpRequest here, so one subscription on a source covers its capabilities request and its tiles. https://community.thinkgeo.com/t/wmsrastertilesource-wmtsrastertilesource-and-authentication/12470

public event EventHandler<SendingHttpRequestMessageEventArgs> SendingHttpRequest;