发表用户:James.Liu
收集整理:James.Liu
相关讨论:http://www.mygis.com.cn/forum/dispbbs.asp?boardID=23&ID=4641
信息原始来源:James.Liu/MyGIS工作室

文章标题:MapXtreme2004的图层中添加点

Dim oLayer As MapInfo.Mapping.FeatureLayer
        Dim otable As MapInfo.Data.Table
        Dim oftr As MapInfo.Data.Feature
        Dim ostyle1 As New MapInfo.Styles.SimpleVectorPointStyle
        Dim ostyle2 As New MapInfo.Styles.SimpleLineStyle
        Dim ostyle3 As New MapInfo.Styles.AreaStyle
        Dim ostyle4 As New MapInfo.Styles.TextStyle
        Dim ostyle As New MapInfo.Styles.FontPointStyle
        'Dim ostyle As New MapInfo.Styles.SimpleVectorPointStyle
        Dim opoint As MapInfo.Geometry.Point
        Dim k As MapInfo.Data.Key


        oLayer = mapcontrol.Map.Layers("TempLayer")
        otable = oLayer.Table


        opoint = New MapInfo.Geometry.Point(mapcontrol.Map.GetDisplayCoordSys, mapcontrol.Map.Bounds.Center.x, mapcontrol.Map.Bounds.Center.y)
        ''ostyle1 = New MapInfo.Styles.CompositeStyle(ostyle3, ostyle2, ostyle4, ostyle1,)
        ostyle.Font.Name = "宋体"
        ostyle.PointSize = 30
        ostyle.Color = System.Drawing.Color.Red

        oftr = New MapInfo.Data.Feature(opoint, ostyle)
        k = otable.InsertFeature(oftr)