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();
  • 相关阅读:
    Fast polling using C, memcached, nginx and libevent
    为什么MongoDB可以替代MySQL?
    comet server 的介绍及方案选型
    多任务服务器架构设计
    基于libev面向分布式数据系统的C10K服务器设计
    libev & libevent简介
    memcached、redis、mysql、mongodb结合架构数据库系统
    删除数组中的重复元素
    不用运算符比较两个int数的大小
    JDBC之简介
  • 原文地址:https://www.cnblogs.com/zhangjun1130/p/2093608.html
Copyright © 2011-2022 走看看