求助:基于VB MAPX如何实现通过代码在地图上新建图层
'弹出对话框确定图层保存的路径 CommonDialog1。DefaultExt = "tab" CommonDialog1。DialogTitle = "Pick a location for your layer" CommonDialog1。 Filter = "MapInfo Tables (*。tab)|*。tab" CommonDialog1。ShowSave If Len(CommonDialog1。Filename) = 0 Then Exit Sub End If Dim lyr As Layer Dim friendlyName As String '从文件名中删除。...全部
'弹出对话框确定图层保存的路径 CommonDialog1。DefaultExt = "tab" CommonDialog1。DialogTitle = "Pick a location for your layer" CommonDialog1。
Filter = "MapInfo Tables (*。tab)|*。tab" CommonDialog1。ShowSave If Len(CommonDialog1。Filename) = 0 Then Exit Sub End If Dim lyr As Layer Dim friendlyName As String '从文件名中删除。
tab扩展名 friendlyName = Left$(CommonDialog1。FileTitle, _ Len(CommonDialog1。FileTitle) - 4) On Error GoTo CreateErr '创建新图层 Set lyr = Map1。
Layers。CreateLayer(friendlyName, _ CommonDialog1。Filename) lyr。Editable = True 'UpdateControls True Exit SubCreateErr: MsgBox "无法创建图层: """ & friendlyName & """ 于: """ & _ CommonDialog1。
Filename & """: " & Error 查看原帖>>。收起