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();
  • 相关阅读:
    页断裂(partial write)与doublewrite技术
    mysql大小写敏感与校对规则
    mysql自增列导致主键重复问题分析。。。
    一次进程hang住问题分析。。。
    教你手工mysql拆库
    mysql online ddl
    Yii2的深入学习--入口文件
    构建自己的PHP框架--抽象Controller的基类
    构建自己的PHP框架--抽象框架的内容
    构建自己的PHP框架--搭建基本结构
  • 原文地址:https://www.cnblogs.com/zhangjun1130/p/2093608.html
Copyright © 2011-2022 走看看