The WmtsLayer class seems not to work with the EPGS:3812 projection coordinate system from an OGC server. Indeed, after the wmtscapabilities.xml http(s) is parsed no tiles are loaded and the TileMatrixSets/Levels aren't requested. The LoadStatus doesn't report any errors. I suspect a problem in the support of the 3812 coordinate system because the wmtscapabilities.xml file mentions 2 layers working with two different projection systems: "topo" (3812) and "overlay" (3857 / WGS84 Pseudo Mercator). The overlay layer works fine.
Is there a way to trace such issue to potentially being able to determine if the projection is well supported or if the problem is rather on the server side?
Map ngiMap <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Map</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
Basemap ngiBasemap <SPAN class="operator token">=</SPAN> ngiMap<SPAN class="punctuation token">.</SPAN>Basemap<SPAN class="punctuation token">;</SPAN>
LayerCollection layerCollection <SPAN class="operator token">=</SPAN> ngiBasemap<SPAN class="punctuation token">.</SPAN>BaseLayers<SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Define the Uri to the WMTS NGI/IGN service.</SPAN>
Uri wmtsUri <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Uri</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"https://www.ngi.be/cartoweb/1/1.0.0/WMTSCapabilities.xml"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Define a new instance of the WMTS service.</SPAN>
WmtsService wmtsService <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">WmtsService</SPAN><SPAN class="punctuation token">(</SPAN>wmtsUri<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Load the WMTS service.</SPAN>
<SPAN class="keyword token">await</SPAN> wmtsService<SPAN class="punctuation token">.</SPAN><SPAN class="token function">LoadAsync</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Get the service information.</SPAN>
WmtsServiceInfo wmtsServiceInfo <SPAN class="operator token">=</SPAN> wmtsService<SPAN class="punctuation token">.</SPAN>ServiceInfo<SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Obtain the read only list of WMTS layer info objects.</SPAN>
IReadOnlyList<SPAN class="operator token"><</SPAN>WmtsLayerInfo<SPAN class="operator token">></SPAN> wmtsLayerInfos <SPAN class="operator token">=</SPAN> wmtsServiceInfo<SPAN class="punctuation token">.</SPAN>LayerInfos<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>pNgiLayer <SPAN class="operator token">==</SPAN> ngiLayer<SPAN class="punctuation token">.</SPAN>topo<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">//EPGS:3812 projected coordinate system ETRS/Belgian Lambert 2008</SPAN>
WmtsLayer wmtsLayer3812 <SPAN class="operator token">=</SPAN>
<SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">WmtsLayer</SPAN><SPAN class="punctuation token">(</SPAN>wmtsLayerInfos<SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">int</SPAN><SPAN class="punctuation token">)</SPAN>ngiLayer<SPAN class="punctuation token">.</SPAN>topo<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> wmtsLayerInfos<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>TileMatrixSets<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> TileImageFormat<SPAN class="punctuation token">.</SPAN>Png8<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
layerCollection<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN>wmtsLayer3812<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
MyMapView<SPAN class="punctuation token">.</SPAN>Map <SPAN class="operator token">=</SPAN> ngiMap<SPAN class="punctuation token">;</SPAN>
MyMapView<SPAN class="punctuation token">.</SPAN><SPAN class="token function">SetViewpoint</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Viewpoint</SPAN><SPAN class="punctuation token">(</SPAN>centerMapPoint<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">1742380</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">else</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">//EPGS:3857 projected coordinate system (WGS84 pseudo Mercator)</SPAN>
WmtsLayer wmtsLayer3857 <SPAN class="operator token">=</SPAN>
<SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">WmtsLayer</SPAN><SPAN class="punctuation token">(</SPAN>wmtsLayerInfos<SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">int</SPAN><SPAN class="punctuation token">)</SPAN>ngiLayer<SPAN class="punctuation token">.</SPAN>overlay<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> wmtsLayerInfos<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>TileMatrixSets<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>TileImageFormat<SPAN class="punctuation token">.</SPAN>Png8<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
layerCollection<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN>wmtsLayer3857<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
ngiMap<SPAN class="punctuation token">.</SPAN>MinScale <SPAN class="operator token">=</SPAN> <SPAN class="number token">34387</SPAN><SPAN class="punctuation token">;</SPAN>
MyMapView<SPAN class="punctuation token">.</SPAN>Map <SPAN class="operator token">=</SPAN> ngiMap<SPAN class="punctuation token">;</SPAN>
MyMapView<SPAN class="punctuation token">.</SPAN><SPAN class="token function">SetViewpoint</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Viewpoint</SPAN><SPAN class="punctuation token">(</SPAN>centerMapPoint<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">34387</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>