We are unable to add OGC API layers to Arcgis Pro using the 3.x API
Our code adds WMS, WFS and WMTS layers using their specific CIMServiceConnection objects, following examples given in the documentation and the pro snippets, when trying similar solutions for CIMOGCAPIServiceConnection creating the layer using LayerFactory throws "System.ArgumentException: 'A user-supplied component or subscriber raised an exception (0x80040208)'"
The code we're trying is:
ArcGIS.Core.CIM.CIMInternetServerConnection server = new ArcGIS.Core.CIM.CIMInternetServerConnection();
server.URL = url;
ArcGIS.Core.CIM.CIMOGCAPIServiceConnection connection = connection = new ArcGIS.Core.CIM.CIMOGCAPIServiceConnection();
connection.ServerConnection = server;
ILayerContainerEdit layerContainer = Map;
LayerCreationParams layerCreationParams = new LayerCreationParams(connection);
layerCreationParams.MapMemberPosition = 0;
if (title != null)
layerCreationParams.Name = title;
layer = LayerFactory.Instance.CreateLayer<Layer>(layerCreationParams, layerContainer);