阅读:2689回复:1
请问用MAPX+VB如何通过程序加一个“线”图层
创建表函数
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 |
|
|
1楼#
发布于:2004-10-10 06:30
<img src="images/post/smile/dvbbs/em02.gif" />
|
|