zoukankan      html  css  js  c++  java
  • ArcEngine中加载ArcGIS Server地图服务

    代码如下:

    private void addMapServerLayer(object sender, EventArgs e)

     {
                IActiveView pActiveView 
    = m_mapControl.Map as IActiveView;
                IAGSServerObjectName3 pAGSServerObjectName3 
    = GetAGSServerConnectionName();
                IName name 
    = (IName)pAGSServerObjectName3;
                IMapServer  pMapServer 
    = (IMapServer)name.Open();
                IMapServerLayer pMapServerLayer 
    = new MapServerLayerClass();
                pMapServerLayer.ServerConnect(pAGSServerObjectName3, pMapServer.DefaultMapName);
                ILayer pLayer 
    = pMapServerLayer as ILayer;
                m_mapControl.AddLayer(pLayer, 
    0);
                pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography , 
    nullnull);
    }

    private IAGSServerObjectName3 GetAGSServerConnectionName()
    {
                IAGSServerConnectionName2 agsServerConnectionName 
    = new AGSServerConnectionName() as IAGSServerConnectionName2 ;
                IPropertySet props 
    = new PropertySetClass();
                props.SetProperty(
    "machine", machine_name);
                agsServerConnectionName.ConnectionProperties 
    = props;

                IAGSSer verObjectName3 agsServerObjectName 
    = new AGSServerObjectNameClass();
                agsServerObjectName.Name 
    = server_name;
                agsServerObjectName.Type 
    = "MapServer";
                agsServerObjectName.AGSServerConnectionName 
    = agsServerConnectionName;
                
    return agsServerObjectName;
    }
  • 相关阅读:
    MySQL · 引擎特性 · InnoDB 事务锁简介
    锁大全与 GDB调试
    docker(4):coreos+docker+rancher真厉害
    TIDB ---NEW SQL
    Linux的内存回收和交换
    TLS握手优化详解
    北风网JAVA 大数据培训
    MySQL 5.7 深度解析: JSON数据类型使用
    MySQL 5.7 深度解析: 临时表空间
    在Linux最大打开文件数限制下 MySQL 对参数的调整
  • 原文地址:https://www.cnblogs.com/myparamita/p/1528112.html
Copyright © 2011-2022 走看看