ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMWMTSServiceConnection Class / ServerConnection Property
Example

In This Topic
    ServerConnection Property (CIMWMTSServiceConnection)
    In This Topic
    Gets or sets the server connection.
    Syntax
    public CIMInternetServerConnectionBase ServerConnection {get; set;}
    Public Property ServerConnection As CIMInternetServerConnectionBase
    Example
    Add a WMTS service
            // Create a connection to the WMS server
            var serverConnection = new CIMProjectServerConnection
            { 
      URL = "URL of the WMTS service.xml",
                ServerType = ServerType.WMTS,
            };
            var service_connection = new CIMWMTSServiceConnection { 
      ServerConnection = serverConnection,
                LayerName = "AdminBoundaries", // Specify the layer name you want to add
            };
            
            // Add a new layer to the map
            var layerParams = new LayerCreationParams(service_connection);
            layerParams.MapMemberPosition = MapMemberPosition.AddToBottom;
    var map = MapView.Active.Map;
            await QueuedTask.Run(() =>
            {
                var layer = LayerFactory.Instance.CreateLayer<FeatureLayer>(layerParams, map);
            });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also