Exemplo n.º 1
0
        public IWMTSLayer GetWMTSServerLyr(string url)
        {
            IPropertySet pPropertyset = new PropertySet();

            pPropertyset.SetProperty("url", url);
            IWMTSConnectionFactory pwmtsconnectionfactory = new WMTSConnectionFactory();
            IWMTSConnection        con = pwmtsconnectionfactory.Open(pPropertyset, 0, null);
            IWMTSLayer             ly  = new WMTSLayer();
            IName n = con.FullName;

            ly.Connect(n);

            return(ly);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取WMTS的地图服务图层
        /// </summary>
        /// <param name="serviceUrl">服务地址</param>
        /// <returns></returns>
        public ILayer GetWMTSLayer(string serviceUrl)
        {
            IPropertySet propertyset = new PropertySetClass();

            propertyset.SetProperty("url", serviceUrl);
            IWMTSConnectionFactory wmtsconnectionfactory = new WMTSConnectionFactory();
            IWMTSConnection        connection            = wmtsconnectionfactory.Open(propertyset, 0, null);
            IWMTSLayer             wmtsLayer             = new WMTSLayer();
            IName iName = connection.FullName;

            wmtsLayer.Connect(iName);
            ILayer layer = wmtsLayer as ILayer;

            layer.Visible = true;
            return(layer);
        }