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;
    }
  • 相关阅读:
    ES6解构之复杂数据
    QQ音乐API-借他人之力实现我的音乐盒
    canvas 简易的加载进度条
    File System 之本地文件系统
    File System 定额(配额查询)
    window.btoa 和 window.atob
    Web App、Hybrid App与Native App
    函数节流和函数防抖
    javascript瀑布流
    protobuf的使用(netty传输多种对象类型)
  • 原文地址:https://www.cnblogs.com/myparamita/p/1528112.html
Copyright © 2011-2022 走看看