zoukankan      html  css  js  c++  java
  • 拷贝地图 CopyAndOverwriteMap()

    private void CopyAndOverwriteMap()
    {
    //Get IObjectCopy interface
    IObjectCopy objectCopy = new ObjectCopyClass();

    //Get IUnknown interface (map to copy)
    object toCopyMap = axPageLayoutControl1.ActiveView.FocusMap;

    //Each Map contained within the PageLayout encapsulated by the
    //PageLayoutControl, resides within a separate MapFrame, and therefore
    //have their IMap::IsFramed property set to True. A Map contained within the
    //MapControl does not reside within a MapFrame. As such before
    //overwriting the MapControl's map, the IMap::IsFramed property must be set
    //to False. Failure to do this will lead to corrupted map documents saved
    //containing the contents of the MapControl.
    IMap map = toCopyMap as IMap;
    map.IsFramed = false;

    //Get IUnknown interface (copied map)
    object copiedMap = objectCopy.Copy(toCopyMap);

    //Get IUnknown interface (map to overwrite)
    object toOverwriteMap = axMapControl1.Map;

    //Overwrite the MapControl's map
    objectCopy.Overwrite(copiedMap, ref toOverwriteMap);

    SetMapExtent();
    }

  • 相关阅读:
    rsync 服务器配置过程
    百度基础技术总结
    利用cobbler无人值守批量安装centos
    安装批量装机工具cobbler过程
    面试题
    JS作用域
    原型链
    ES6优缺点
    PostCSS理解与运用
    置换元素和非置换元素
  • 原文地址:https://www.cnblogs.com/gisoracle/p/4827871.html
Copyright © 2011-2022 走看看