1 动态更改label的expression
2 用where语句动态更改哪些要素类需要label
3 label中绝对值小于1的小数不显示小数点前的0.
居然需要到操作系统的控制面板中修改
[img]http://dl2.iteye.com/upload/attachment/0105/3125/d7424f2b-1e39-3bc0-96d8-67e96fcddf56.jpg[/img]
IGeoFeatureLayer pGeoFeatureLayer = (IGeoFeatureLayer)axMapControl.get_Layer(1);
IAnnotateLayerPropertiesCollection pAnnoLayerPropsColl = pGeoFeatureLayer.AnnotationProperties;
IElementCollection ec;
IAnnotateLayerProperties pAnnoLayerProps;
pAnnoLayerPropsColl.QueryItem(0, out pAnnoLayerProps, out ec, out ec);
ILabelEngineLayerProperties pLabelEngineLayerProps = (ILabelEngineLayerProperties)pAnnoLayerProps;
pLabelEngineLayerProps.Expression = "bar";
axMapControl.Refresh();
2 用where语句动态更改哪些要素类需要label
IGeoFeatureLayer pGeoFeatureLayer = (IGeoFeatureLayer)axMapControl.get_Layer(1);
IAnnotateLayerPropertiesCollection pAnnoLayerPropsCollection = pGeoFeatureLayer.AnnotationProperties;
IAnnotateLayerProperties predictPointLabelEngineLayerProps;
pAnnoLayerPropsCollection.QueryItem(0, out predictPointLabelEngineLayerProps, out ec, out ec);
predictPointLabelEngineLayerProps.WhereClause = "id > 100";
3 label中绝对值小于1的小数不显示小数点前的0.
居然需要到操作系统的控制面板中修改
[img]http://dl2.iteye.com/upload/attachment/0105/3125/d7424f2b-1e39-3bc0-96d8-67e96fcddf56.jpg[/img]