`
hj270187161
  • 浏览: 21422 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

添加标注 (mapxtreme2008&C#)

    博客分类:
  • GIS
阅读更多
     MapInfo.Data.Table activeMapTable = MapInfo.Engine.Session.Current.Catalog.GetTable("layerName");
                          MapInfo.Mapping.LabelLayer lbLayer = new MapInfo.Mapping.LabelLayer("lbbLayer", "lbbLayer");
                         
                          MapInfo.Mapping.LabelSource lbSource = new MapInfo.Mapping.LabelSource(activeMapTable);
                          //set label\'s style
                          lbSource.DefaultLabelProperties.Style.Font.Name = "宋体";//字体
                          lbSource.DefaultLabelProperties.Style.Font.Size = 9;//大小
                          lbSource.DefaultLabelProperties.Layout.Alignment = MapInfo.Text.Alignment.CenterRight;//标注显示的位置
                          lbSource.DefaultLabelProperties.Layout.Offset = 7;//偏移量
                          lbSource.DefaultLabelProperties.Style.Font.ForeColor = System.Drawing.Color.Black;//标注字颜色 lbSource.DefaultLabelProperties.Style.Font.TextEffect=MapInfo.Styles.TextEffect.Box;//标注背景,Box为方框,Halo为光晕
                          lbSource.DefaultLabelProperties.Style.Font.BackColor = System.Drawing.Color.Yellow;//方框或者光晕的颜色
                          lbSource.DefaultLabelProperties.Style.Font.Shadow = false;//显示阴影
                          lbSource.DefaultLabelProperties.Caption = "xx";//标注字段
                          lbLayer.Sources.Append(lbSource);
                          biaoZhu = lbLayer.Alias;

                          MainMap.Map.Layers.Add(lbLayer);
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics