内容发布更新时间 : 2025/1/8 6:20:00星期一 下面是文章的全部内容请认真阅读。
[已解决] AE动态标注的
问题
本帖最后由 gislzc 于 2009-5-12 11:03 编辑
请问一下我在AE中动态标注时,为什么当标注内容一样时,只会标注一个要素呢?例如,我动态标注某村下的所有宗地(标注宗地所有者的名称(户主姓名)),发现同一户下的所有宗地,只有一块标注了,这是什么原因呢 我标注宗地的户主名字(其值不是唯一,同一户主会拥有很多块宗地),则会只标注一块宗地. 如果我标注宗地的编号
字段,这个字段的值是唯一的,则会标注所有的宗
地.
收藏 分享 评分 GIS之路征文活动火热进行中
回复 引用
订阅 TOP
2
发表于 2009-5-7 11:03 | 只看该作者
本帖最后由 gislzc 于 2009-5-7 13:23 编辑
#
gislzc
代码如下:
string expression = \
\
\
\
parcelLayerAnnotate.SetLayerAnnotaion(layer, expression, \
初级会员
帖子
128 精华
0
rgbColor, false, 1, 1300);
public void SetLayerAnnotaion(ILayer layer, string expression, string fontName, int fontSize, IRgbColor fontColor, bool isBold, double
showMaxScale, double showMinScale)
{ try {
IFeatureLayer featureLayer = (IFeatureLayer)layer;
IFeatureClass featureClass =
featureLayer.FeatureClass;
if (featureClass == null) return;
IGeoFeatureLayer geoFeatureLayer =
(IGeoFeatureLayer)featureLayer;
if (geoFeatureLayer == null) return; geoFeatureLayer.DisplayAnnotation = true;
IAnnotateLayerPropertiesCollection
annotateLayerPropsColl = new
AnnotateLayerPropertiesCollectionClass(); annotateLayerPropsColl = geoFeatureLayer.AnnotationProperties; annotateLayerPropsColl.Clear();
IBasicOverposterLayerProperties
basicOverposterLayerProperties =
CreateBasicOverposterLayerPropertiesFromFeatureClass(featureClass);
ITextSymbol textSymbol = new TextSymbolClass(); stdole.IFontDisp fontDisp = new stdole.StdFontClass()
as stdole.IFontDisp;
fontDisp.Name = fontName; fontDisp.Size = fontSize;
fontDisp.Bold = isBold;
textSymbol.Font = fontDisp; textSymbol.Color = (IColor)fontColor;
textSymbol.Angle = 0; textSymbol.RightToLeft = false; textSymbol.VerticalAlignment = esriTextVerticalAlignment.esriTVABaseline; textSymbol.HorizontalAlignment =
esriTextHorizontalAlignment.esriTHAFull;
ILabelEngineLayerProperties
layerEngineLayerProperties = new LabelEngineLayerPropertiesClass();
IAnnotateLayerProperties annotatelayerProperties =