zoukankan      html  css  js  c++  java
  • ArcGIS Engine Maplex Label(标注)使用一例(转)

    /// <summary>
            /// MaplexEngine标注
            /// </summary>
            /// <param name="pGeoFeatLyr">标注图层</param>
            /// <param name="pMap">地球人都知</param>
            /// <param name="annoField">标记字段</param>
             public void Annotation(IGeoFeatureLayer pGeoFeatLyr, IMap pMap, string annoField)
            {
                IAnnotateMap pAnnoMap;
                pAnnoMap = new MaplexAnnotateMapClass();
                pMap.AnnotationEngine = pAnnoMap;
                IGeoFeatureLayer pGeoFeatLayer;
                pGeoFeatLayer = pGeoFeatLyr;
                IAnnotateLayerPropertiesCollection pAnnoProps;
                pAnnoProps = pGeoFeatLyr.AnnotationProperties;
                pAnnoProps.Clear();
                ILabelEngineLayerProperties2 pLabelEngine2 = new MaplexLabelEngineLayerPropertiesClass();
                pLabelEngine2.Expression = "[" + annoField + "]";
               
                IMaplexOverposterLayerProperties pMaplexPro = new MaplexOverposterLayerPropertiesClass();
                pMaplexPro.FeatureType = esriBasicOverposterFeatureType.esriOverposterPolygon;
                pMaplexPro.PolygonPlacementMethod = esriMaplexPolygonPlacementMethod.esriMaplexHorizontalInPolygon;
                pMaplexPro.CanPlaceLabelOutsidePolygon = false;
                pMaplexPro.CanRemoveOverlappingLabel = false;
                pMaplexPro.RepeatLabel = false;
                pLabelEngine2.OverposterLayerProperties = pMaplexPro as IOverposterLayerProperties;
                IMapOverposter pMapPos = axMapControl1.Map as IMapOverposter;
                IOverposterProperties pOP = pMapPos.OverposterProperties;
                IMaplexOverposterProperties pMaplexOP = pOP as IMaplexOverposterProperties;
                pMaplexOP.LabelLargestPolygon = false;
                pAnnoProps.Add(pLabelEngine2 as IAnnotateLayerProperties);
                pGeoFeatLyr.DisplayAnnotation = true;
            }

     来自:https://www.cnblogs.com/cannel/archive/2011/03/24/1993383.html


                IAnnotateMap pAnnoMap = new MaplexAnnotateMapClass();
                m_hookHelper.FocusMap.AnnotationEngine = pAnnoMap;

    使用Maplex

  • 相关阅读:
    C#项目打包,并自动安装SQL数据库(转)
    [转]将List对象列表转换成JSON格式的类
    查找算法集:顺序查找、二分查找、插值查找、动态查找(数组实现、链表实现)
    C#编码好习惯
    数据库构思与设计规范
    ASP.NET下母版页和内容页中的事件发生顺序整理
    记录要点
    div挡住select的5种方法
    html源码获取方法
    TransactionScope 分布式事务
  • 原文地址:https://www.cnblogs.com/gisoracle/p/9062758.html
Copyright © 2011-2022 走看看