I got solution for adding all layers at ones, as well as a particular layer to ArcMap: public static void GetWMTSLayer(string url = "http://IP-Address:Port/Service/rest/services/OSM/MapServer/WMTS") { IProperySet propSet= new PropertySetClass(); propSet.SetProperty("URL",url); IWMTSConnectionFactory wmtsConnFactory=new WMTSConnectionFactoryClass(); IWMTSConnection wmtsConnection=wmtsConnFactory.Open(propSet,0,null); IWMTSServiceDescription wmtsServceDescriotion=wmtsConnection as IWMTSServiceDescription ; for(int i=0;i< wmtsServceDescriotion.LayerDescriptionCount;i++) { IWMTSLayerDescription layerDescription=wmtsServceDescriotion.getLayerDescription(i); IWMTSLayer wmtsLayer=new WMTSLayerClass(); IPropertySet propSet_1=new PropertySetClass(); propSet_1.SetProperty("URL", url); propSet_1.SetProperty("LayerName",layerDescription.Identifier); WMTSConnectionName connectonName= new WMTSConnectionNameClass(); connectionName.ConnectionProperties=propSet_1; wmtsLayer.Connect((IName)connectionName); addData(wmtslayer); } } public static void addData(IWMTSLayer wmtslayer) { IMap pMap=(IMap)((IMxDocument)ArcMap.Application.Document).FocusMap); ILayer pLayer=new FeatureLayer(); pLayer=(ILayer)wmtslayer; pMap.AddLayer(pLayer); }
... View more