• Arcengine连接Map service


                IAGSServerConnectionFactory connectionFactory = new AGSServerConnectionFactory();
                IPropertySet propertySet = new PropertySet();
                IAGSServerConnection connection;
                propertySet.SetProperty("url", "http://meng/arcgis/services");
                connection = connectionFactory.Open(propertySet, 0);
                // Get "MapService" MapServer object

                IAGSEnumServerObjectName serverObjectNames;
                IAGSServerObjectName serverObjectName;
                serverObjectNames = connection.ServerObjectNames;
                while ((serverObjectName = serverObjectNames.Next()) != null)
                {

                    if (serverObjectName.Name.Equals("zhyxk") && serverObjectName.Type.Equals("MapServer"))
                        break;

                }

                if (serverObjectName == null)
                    return;
                IName name = serverObjectName as IName;
                IMapServer mapServer = name.Open() as IMapServer;

                // Create MapServerLayer using AGS data source
                ESRI.ArcGIS.Carto.IMapServerLayer layer = new MapServerLayer() as IMapServerLayer;
                layer.ServerConnect(serverObjectName, mapServer.DefaultMapName);

                axMapControl1.AddLayer(layer as ILayer);
                axMapControl1.Refresh();
  • 相关阅读:
    KMeans Algorithm
    [Little Case]Reconstruct Tangent From Point Cloud
    来本有趣的电子书——林产与木材科学导论
    Lafortune Paper In RenderMan
    【AI】人类的记忆是不是差值存储的?
    【AI】关于人工情感的一些随想
    【毕设准备】硬件准备
    《人脑之谜》读书笔记
    【原创】C#生成类属性set get
    【C#入门】第一个C#下windows程序
  • 原文地址:https://www.cnblogs.com/zhangjun1130/p/2093608.html
Copyright © 2020-2023  润新知