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();
  • 相关阅读:
    hdu 4015找规律
    hdu4473
    hdu 4016搜索
    hdu4465精度控制
    hdu 2965组合数学题
    hdu 4022map和list等数据结构的应用
    hdu4464超级大水题
    在ASP.NET中实现Url Rewriting
    DotText源码阅读(1)调试
    DotText源码阅读(2)数据库表结构
  • 原文地址:https://www.cnblogs.com/zhangjun1130/p/2093608.html
Copyright © 2011-2022 走看看