Hello Esri Community,
I'm working on integrating a third-party WMTS service in my .NET MAUI application using ArcGIS Runtime SDK for .NET. However, I encountered an issue where the WmtsLayer.LoadAsync() method fails because the capabilities XML from the WMTS service does not include the ows:Constraint element, which seems to be required by the SDK's parser.
private async Task<WmtsLayer> GetWMTSLayer(WMTS wMTS)
{
try
{
WmtsLayer myWmtsLayer = new WmtsLayer(new Uri(wMTS.url), wMTS.layername, wMTS.id);
await myWmtsLayer.LoadAsync();
return myWmtsLayer;
}
catch (Exception ex)
{
await Application.Current.MainPage.DisplayAlert(AppResources.title_error_message, ex.ToString(), AppResources.ok);
}
return null;
}
WMTS Service Details:
Issue:
When attempting to load the WMTS layer using the provided URL, layer ID, and tile matrix set ID, I receive an error indicating that the parser could not move to ows:Constraints in the capabilities XML.
Additional Information:
According to the OGC WMTS standard, the ows:Constraint element is not mandatory for a valid WMTS capabilities document. However, it appears that the ArcGIS Runtime SDK for .NET expects this element to be present, which causes the loading process to fail when it is missing.
Request for Help:
I am looking for guidance on the following:
- How can I handle the missing ows:Constraint element in the capabilities XML to successfully load the WMTS layer using the ArcGIS Runtime SDK for .NET?
- Is there a way to programmatically add the required ows:Constraint element to the capabilities XML before creating the WmtsLayer?
- Are there any best practices or recommended approaches to resolve this issue without modifying the third-party WMTS service?
Thank you for your assistance!
Best regards