• Engine加载ArcGIS Online和ArcGIS Server发布的地图服务


    两种方式:
    1. 可以通过遍历的方式,根据地图服务的名称进行判断,然后加载。

    IAGSServerObjectName pSOName = null; 
    IAGSServerObjectName psoname = null; 
    IAGSServerConnection con = new AGSServerConnection(); 
    IAGSServerConnectionFactory2 confactory = new AGSServerConnectionFactory() as IAGSServerConnectionFactory2; 
    IPropertySet propertyset = new PropertySet(); 
    IMapServerLayer mapserverlayer = new MapServerLayerClass(); 
    
    propertyset.SetProperty(URL, http://192.168.220.116:6080/arcgis/rest/services); 
    
    con = confactory.Open(propertyset, 0); 
    
    IAGSEnumServerObjectName enumSOName = con.ServerObjectNames; 
    
    pSOName = enumSOName.Next(); 
    while (pSOName != null) 
    { 
    if (pSOName.Name == MyMapService1) 
    { 
    psoname = pSOName; 
    break; 
    } 
    pSOName = enumSOName.Next(); 
    } 
    IName pName = psoname as IName; 
    IMapServer mapserver = pName.Open() as IMapServer; 
    
    mapserverlayer.ServerConnect(pSOName, mapserver.DefaultMapName); 
    axMapControl1.AddLayer(mapserverlayer as ILayer); 
    axMapControl1.Refresh();

    2. Engine 10.1及之后版本的话可以使用IMapServerRESTLayer加载,测试代码:

    IMapServerRESTLayer mapServerRESTLayer = new MapServerRESTLayerClass();
                mapServerRESTLayer.Connect(http://cache1.arcgisonline.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer);
    
                axMapControl1.AddLayer(mapServerRESTLayer as ILayer);
                axMapControl1.Refresh();

     地图服务类型:

    1.地形图:http://server.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer?f=jsapi

    2.影像:http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer

    3.彩色地图:http://cache1.arcgisonline.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer

    4.灰色:http://cache1.arcgisonline.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer

    5.暖色:http://cache1.arcgisonline.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer

    6.午夜蓝:http://cache1.arcgisonline.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer

  • 相关阅读:
    BigTale
    GFS Google File System(中文翻译)
    MapReduce
    Google MapReduce/GFS/BigTable三大技术的论文中译版
    Linux常用命令大全
    linux常用命令
    Oracle复杂查询
    jquery on事件jquery on实现绑定多个事件
    Java 多线程(六) synchronized关键字详解
    什么才算是真正的编程能力?
  • 原文地址:https://www.cnblogs.com/huangyanjia/p/9144077.html
Copyright © 2020-2023  润新知