用maplex无法设置标注压盖

设置CanRemoveOverlappingLabel 为false依旧不压盖,部分标注消失
public static void SetPointAnnotation(IFeatureLayer pFeatLyr, IMap pMap, string annoField)
{
IAnnotateMap pAnnoMap = new MaplexAnnotateMapClass();
pMap.AnnotationEngine = pAnnoMap;
IGeoFeatureLayer pGeoFeatLayer = pFeatLyr as IGeoFeatureLayer;
IAnnotateLayerPropertiesCollection pAnnoProps = pGeoFeatLayer.AnnotationProperties;
pAnnoProps.Clear();

ILabelEngineLayerProperties2 pLabelEngine2 = new MaplexLabelEngineLayerPropertiesClass();
ITextSymbol pTextSymbol = new TextSymbolClass();
IRgbColor pRgbColor = new RgbColorClass();

IMaplexOverposterLayerProperties pMaplexPro = new MaplexOverposterLayerPropertiesClass();

pMaplexPro.FeatureType = esriBasicOverposterFeatureType.esriOverposterPoint;
pMaplexPro.PointPlacementMethod = esriMaplexPointPlacementMethod.esriMaplexAroundPoint;

IPointPlacementPriorities pPointPlacementPriorities = new PointPlacementPrioritiesClass();
pPointPlacementPriorities.AboveRight = 1;
pPointPlacementPriorities.AboveCenter = 2;
pPointPlacementPriorities.AboveLeft = 2;
pPointPlacementPriorities.CenterLeft = 3;
pPointPlacementPriorities.CenterRight = 3;
pPointPlacementPriorities.BelowLeft = 3;
pPointPlacementPriorities.BelowCenter = 3;
pPointPlacementPriorities.BelowRight = 2;
pMaplexPro.PointPlacementPriorities = pPointPlacementPriorities;

pMaplexPro.FeatureWeight = 500;
pMaplexPro.LabelPriority = 900;

pMaplexPro.CanShiftPointLabel = true;
pMaplexPro.CanRemoveOverlappingLabel = false;
pMaplexPro.EnablePointPlacementPriorities = true;

pLabelEngine2.ExpressionParser = new AnnotationPythonEngineClass();
pLabelEngine2.Expression = "[" + annoField + "]";

pRgbColor.Red = 0;
pRgbColor.Blue = 0;
pRgbColor.Green = 0;
pTextSymbol.Color = pRgbColor;
pTextSymbol.Size = 100;
pLabelEngine2.Symbol = pTextSymbol;


pLabelEngine2.OverposterLayerProperties = pMaplexPro as IOverposterLayerProperties;
pAnnoProps.Add(pLabelEngine2 as IAnnotateLayerProperties);
pGeoFeatLayer.DisplayAnnotation = true;
}
已邀请:

朱新颖

赞同来自:

IOverposterLayerProperties2.TagUnplaced 设为false试试

要回复问题请先登录注册