当前位置: 代码迷 >> GIS >> 请教怎么让图元信息直接显示图元边上
  详细解决方案

请教怎么让图元信息直接显示图元边上

热度:128   发布时间:2016-05-05 06:33:52.0
请问如何让图元信息直接显示图元边上?
cmd   =   _miConnection.CreateCommand();
                                cmd.Parameters.Add( "name ",MIDbType.String);
                                cmd.Parameters.Add( "geometry ",   MIDbType.FeatureGeometry);
                                cmd.Parameters.Add( "style ",   MIDbType.Style);
                                cmd.CommandText   =   "Insert   Into   point   (name,geometry,MI_Style)   values   (name,geometry,style) ";
                                cmd.Prepare();
                                cmd.Parameters[0].Value   =   Convert.ToString(SQLClass.SqlDR[3]);
                                cmd.Parameters[1].Value   =   g;
                                cmd.Parameters[2].Value   =   cs;
                                nchanged   =   cmd.ExecuteNonQuery();

我想让name里的信息直接显示图元边上,而不是点击才显示

VS2005+mapxtreme2005

------解决方案--------------------
//标签
//FeatureLayer _lyr = mapControl1.Map.Layers["abc"] as FeatureLayer;
//MapInfo.Mapping.LabelLayer lbllayer = new MapInfo.Mapping.LabelLayer("Areaname");
//lbllayer.Sources.Append(new LabelSource(_lyr.Table));
//mapControl1.Map.Layers.Add(lbllayer);
//LabelSource source = lbllayer.Sources[0];
//source.DefaultLabelProperties.Caption = "readerID";
//source.DefaultLabelProperties.Layout.Alignment = MapInfo.Text.Alignment.CenterRight;
//source.DefaultLabelProperties.Layout.UseRelativeOrientation = false;
//source.DefaultLabelProperties.Layout.Offset = 10;
//source.DefaultLabelProperties.Style.CalloutLine.Attributes = MapInfo.Styles.StyleAttributes.LineAttributes.None;
//source.DefaultLabelProperties.Style.Font.Size = 12;
//source.DefaultLabelProperties.Style.Font.TextEffect = MapInfo.Styles.TextEffect.Box;
//source.DefaultLabelProperties.Style.Font.BackColor = System.Drawing.Color.FromArgb(176, 255, 176);
//source.DefaultLabelProperties.CalloutLine.Use = false;
  相关解决方案