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¶
ActiveLayerName¶
The layer to request tiles from. The identifier is normalized on the way in.
public string ActiveLayerName { get; set; }
Property Value¶
ActiveStyleName¶
The style to request for WmtsClient.ActiveLayerName.
public string ActiveStyleName { get; set; }
Property Value¶
OutputFormat¶
The image MIME type to request.
public string OutputFormat { get; set; }
Property Value¶
TileMatrixSetName¶
The tile matrix set to request in, naming the grid WmtsClient.TileMatrixSet returns.
public string TileMatrixSetName { get; set; }
Property Value¶
Parameters¶
Extra query-string parameters added to every request.
public Dictionary<string, string> Parameters { get; }
Property Value¶
Dimensions¶
Values for the extra dimensions a server declares, such as time or elevation.
public Dictionary<string, string> Dimensions { get; }
Property Value¶
WebProxy¶
The proxy to reach the server through.
public IWebProxy WebProxy { get; set; }
Property Value¶
Credentials¶
The credentials a service behind HTTP authentication is answered with.
public ICredentials Credentials { get; set; }
Property Value¶
TimeoutInSeconds¶
How long a request may take before it is abandoned. Twenty seconds by default.
public int TimeoutInSeconds { get; set; }
Property Value¶
UserAgent¶
The User-Agent header sent with each request.
public string UserAgent { get; set; }
Property Value¶
WmtsServerEncodingType¶
Whether tiles are requested as key-value pairs or through the RESTful template the server declares.
public WmtsServerEncodingType WmtsServerEncodingType { get; set; }
Property Value¶
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¶
IsOpen¶
Whether WmtsClient.OpenAsync(CancellationToken) has completed.
public bool IsOpen { get; private set; }
Property Value¶
TileMatrixSet¶
The grid of the chosen WmtsClient.TileMatrixSetName. Valid after WmtsClient.OpenAsync(CancellationToken).
public WmtsTileMatrixSet TileMatrixSet { get; }
Property Value¶
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¶
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¶
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¶
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;