gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15945
  • QQ554730525
  • 铜币25337枚
  • 威望15352点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
阅读:2475回复:1

请问用MAPX+VB如何通过程序加一个“线”图层

楼主#
更多 发布于:2003-07-28 11:15
创建表函数
Public Function CreateTableFile(ByVal TableFileName As String, ByVal TableFilePath As String)
  
  
'    Dim MapRect As New MapXLib.Rectangle
'    'MapRect.Set -1, -1, 10000000, 10000000
'    MapRect.Set -1, -1, 100000000, 100000000
    MapWindowForm.MapX.NumericCoordSys.Set 0, , 7, , , , , , , , , , MapRect
  
  
    If FSO.FileExists(TableFilePath) = True Then Exit Function
    
    Dim LayerInfoObject As New LayerInfo
    Dim TableFieids As New MapXLib.Fields
    Set LayerInfoObject = Nothing
    Set TableFieids = Nothing
    Dim TempStr As String
    
    TableFieids.AddStringField "数据代码", 4
    TableFieids.AddStringField "名称", 40
    TableFieids.AddIntegerField "等级"
    TableFieids.AddFloatField "功能分"
    TableFieids.AddFloatField "服务半径"
    LayerInfoObject.Type = miLayerInfoTypeNewTable
    LayerInfoObject.AddParameter "FileSpec", TableFilePath
    LayerInfoObject.AddParameter "Name", TableFileName
    LayerInfoObject.AddParameter "Fields", TableFieids
    LayerInfoObject.AddParameter "AutoCreateDataset", 1
    LayerInfoObject.AddParameter "DatasetName", TableFileName
    TempStr = Mid(TableFilePath, 1, Len(TableFilePath) - 4)
    If Dir(TableFilePath, vbNormal) <> "" Then
      Kill TempStr + ".*"
    End If
    MapWindowForm.MapX.Layers.Add LayerInfoObject
End Function
喜欢0 评分0
hsxljwht
路人甲
路人甲
  • 注册日期2004-10-06
  • 发帖数59
  • QQ
  • 铜币253枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2004-10-10 06:30
<img src="images/post/smile/dvbbs/em02.gif" />
举报 回复(0) 喜欢(0)     评分
游客

返回顶部