码迷,mamicode.com
首页 > 其他好文 > 详细

ArcGIS Engine Maplex Label(标注)使用一例(转)

时间:2018-05-20 11:44:21      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:help   ima   overlap   .com   col   ide   relay   exe   void   

/// <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

ArcGIS Engine Maplex Label(标注)使用一例(转)

标签:help   ima   overlap   .com   col   ide   relay   exe   void   

原文地址:https://www.cnblogs.com/gisoracle/p/9062758.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!