以下是一个c#+mapxtreme的创建标注图层并添加标注到当前地图的函数代码。
//创建标注图层
//作者:胡未名GIS工作室
TextStyle ts = new TextStyle();
ts.Font.Size = 11;
ts.Font.ForeColor = Color.Black;
ts.Font.Shadow = true;
LabelSource source = new LabelSource(MapInfo.Engine.Session.Current.Catalog.GetTable("temp_trackpoint"));
source.DefaultLabelProperties.Caption = "GpsDataTime";
source.DefaultLabelProperties.Style = ts;
source.DefaultLabelProperties.Layout.Alignment = MapInfo.Text.Alignment.CenterRight;
source.DefaultLabelProperties.Layout.Offset = 13;
source.DefaultLabelProperties.Visibility.AllowOverlap = true; //允许标注重叠
LabelLayer1 = (LabelLayer)this.MapControl1.Map.Layers["llayer2"];
Session["si"] = LabelLayer1.Sources.Append(source);