zoukankan      html  css  js  c++  java
  • 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();
  • 相关阅读:
    轻松理解https,So easy!
    都 9102 年了,一起来攻克 Linux 吧!
    8种常见SQL错误用法,你中招了吗?
    如何写出让同事无法维护的代码?
    Spring Boot 2.1.6 发布了!
    推荐一款 MyBatis 开发神器,为简化而生!
    vs2015制作一个超级简单的MVC项目
    解析ASP.NET WebForm和Mvc开发的区别
    asp.net 的 web form 过时了吗
    Asp.net的WebForm的落后技术
  • 原文地址:https://www.cnblogs.com/zhangjun1130/p/2093608.html
Copyright © 2011-2022 走看看