ArcGIS Server开发——标注

ArcGIS Server开发——标注

ArcGIS Server开发——标注

[C#写法]
private void LabelField(IFeatureLayer pFeatureLayer,IServerContext pServerContext)
  { 
   IGeoFeatureLayer pGeoFeatureLayer = pFeatureLayer as IGeoFeatureLayer;
   pGeoFeatureLayer.AnnotationProperties.Clear();
   IAnnotateLayerPropertiesCollection pAnnoLayerPropsColl = pGeoFeatureLayer.AnnotationProperties;
   ILabelEngineLayerProperties pLabelEngine;
   
   pLabelEngine = pServerContext.CreateObject("esriCarto.LabelEngineLayerProperties") as     ILabelEngineLayerProperties;
   pLabelEngine.Expression = "[Field]";
   IAnnotateLayerProperties pAnnoLayerProps = pLabelEngine as IAnnotateLayerProperties;
   pAnnoLayerPropsColl.Add(pAnnoLayerProps);
   pGeoFeatureLayer.DisplayAnnotation = true;  
  

你可能感兴趣的:(ArcGIS Server开发——标注)