在Mapxtreme中修改单个图元的标注

在Mapxtreme中修改单个图元的标注  来自Rainny

 

public void EditLabel(Table miTable, LabelSource source)

{

   

    source.DefaultLabelProperties.Visibility.Enabled = false;   

 

    MapInfo.Data.SearchInfo info = MapInfo.Data.SearchInfoFactory.SearchWhere("ID='01'");

    info.QueryDefinition.AppendColumns("ID");

    Feature feature = Session.Current.Catalog.SearchForFeature(miTable, info);

   

    //要修改的标注

    LabelProperties properties = new LabelProperties();

    properties.Attributes = LabelAttribute.VisibilityEnabled | LabelAttribute.Caption | LabelAttribute.PriorityMinor;

    properties.Visibility.Enabled = true;

    properties.Caption = "ID";

 

  

    SelectionLabelModifier modifier = new SelectionLabelModifier();

    modifier.Properties.Add(feature.Key, properties);

    source.Modifiers.Append(modifier);

}

posted @ 2010-12-03 16:13  googlegis  阅读(213)  评论(0编辑  收藏  举报

坐标合肥,非典型GIS开发人员 GitHub