For my application I would like a Get Tile Service. The layer available will be a continuously styled raster zoom stack that seamlessly transitions from Strategi based mapping, My current issue is that I am unable to open the WMTS layer. using the wmts.open() method. The code snippet is below.
WmtsLayer wmtsLayer = new WmtsLayer();
wmtsLayer.DrawingExceptionMode = DrawingExceptionMode.DrawException;
wmtsLayer.WmtsSeverEncodingType = WmtsSeverEncodingType.Kvp;
wmtsLayer.ServerUris.Add(new Uri("api.ordnancesurvey.co.uk/mapping_api/service/wmts?apikey=xxxxxxxxxxxxxxxx"));
wmtsLayer.Open();
wmtsLayer.ActiveLayerName = "Zoom Map Auto";
wmtsLayer.ActiveStyleName = "_null";
wmtsLayer.TileMatrixSetName = "EPSG:27700";
wmtsLayer.OutputFormat = "image/jpeg";
mapEngine.CurrentExtent = new RectangleShape(-13684536.8056607, 5216473.54412171, -13665771.5263202, 5204492.04702746);
mapEngine.StaticLayers.Clear();
mapEngine.StaticLayers.Add("WmtsLayer", wmtsLayer);
bitmap = new Bitmap(map.Width, map.Height);
DrawImage();
I have been tried to use the code sampled found on the wiki but i have had no luck. The error I get is "An unhandled exception of type 'System.Net.WebException' occurred in System.dll
Additional information: The remote server returned an error: (401) Unauthorized." However when i put in the link into a web browser it returns the XML
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<
ExceptionReport
xmlns
=
"<a href="opengis.net/ows/1.1">opengis.net/ows/1.1</a>"
xmlns:xsi
=
"<a href="w3.org/2001/XMLSchema-instance">w3.org/2001/XMLSchema-instance</a>"
version
=
"1.1.0"
xsi:schemaLocation
=
"<a href="opengis.net/ows/1.1">opengis.net/ows/1.1</a> <a href="geowebcache.org/schema/ows/1.1.0/owsExceptionReport.xsd">geowebcache.org/schema/ows/1...Report.xsd</a>"
>
<
Exception
exceptionCode
=
"MissingParameterValue"
locator
=
"request"
>
<
ExceptionText
>Missing Request parameter</
ExceptionText
>
</
Exception
>
</
ExceptionReport
>
Any ideas what I am doing wrong?