コード例 #1
0
        /// <summary>
        /// Add ArcIMS layer to map
        /// </summary>
        /// <param name="ipMxDoc"></param>
        /// <param name="strServer"></param>
        /// <param name="strLayerName"></param>
        /// <param name="strSecretName"></param>
        /// <returns></returns>
        private bool addLayerArcIMS(IMxDocument ipMxDoc, string strServer, string strLayerName, string strSecretName)
        {
            // Connect to service and create new IMS layer
            IIMSServiceDescription pIMSServiceDescription = new IMSServiceName();

            pIMSServiceDescription.URL         = strServer;
            pIMSServiceDescription.Name        = strLayerName;
            pIMSServiceDescription.ServiceType = acServiceType.acMapService;


            IIMSMapLayer pIMSLayer = new IMSMapLayer();

            pIMSLayer.ConnectToService(pIMSServiceDescription);
            pIMSLayer.Visible = false;

            //make them all non-visible
            if (pIMSLayer is ICompositeLayer)
            {
                ICompositeLayer ipCompLayer;
                int             idx;

                ipCompLayer = (ICompositeLayer)pIMSLayer;
                for (idx = 0; idx < ipCompLayer.Count; idx++)
                {
                    ipCompLayer.get_Layer(idx).Visible = false;
                }
            }

            //add it
            ipMxDoc.AddLayer(pIMSLayer);

            // add to the service list
            string strItem = EncodeServiceList(strServer, strLayerName, strSecretName);

            logger.writeLog(StringResources.AddingServiceList + strItem);
            colServiceList.Add(strItem);

            logger.writeLog("strServer = " + strServer + "strServer & strLayerName = " + strServer + strLayerName);
            return(true);
        }
コード例 #2
0
ファイル: OpenWMC.cs プロジェクト: k4th/geoportal-server
        /// <summary>
        /// Add ArcIMS layer to map
        /// </summary>
        /// <param name="ipMxDoc"></param>
        /// <param name="strServer"></param>
        /// <param name="strLayerName"></param>
        /// <param name="strSecretName"></param>
        /// <returns></returns>
        private bool addLayerArcIMS(IMxDocument ipMxDoc, string strServer, string strLayerName, string strSecretName)
        {
            // Connect to service and create new IMS layer
            IIMSServiceDescription pIMSServiceDescription = new IMSServiceName();
            pIMSServiceDescription.URL = strServer;
            pIMSServiceDescription.Name = strLayerName;
            pIMSServiceDescription.ServiceType = acServiceType.acMapService;

            IIMSMapLayer pIMSLayer = new IMSMapLayer();
            pIMSLayer.ConnectToService(pIMSServiceDescription);
            pIMSLayer.Visible = false;

            //make them all non-visible
            if (pIMSLayer is ICompositeLayer)
            {
                ICompositeLayer ipCompLayer;
                int idx;

                ipCompLayer = (ICompositeLayer)pIMSLayer;
                for (idx = 0; idx < ipCompLayer.Count; idx++)
                    ipCompLayer.get_Layer(idx).Visible = false;
            }

            //add it
            ipMxDoc.AddLayer(pIMSLayer);

            // add to the service list
            string strItem = EncodeServiceList(strServer, strLayerName, strSecretName);
            logger.writeLog(StringResources.AddingServiceList + strItem);
            colServiceList.Add(strItem);

            logger.writeLog("strServer = " + strServer + "strServer & strLayerName = " + strServer + strLayerName);
            return true;
        }