⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.frm

📁 MapX示例程序:编辑特征示例
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Map.Layers.Layer4.DrawLabelsAfter=   0   'False
      Map.Layers.Layer4.ZoomLayering=   0   'False
      Map.Layers.Layer4.ZoomMin=   0
      Map.Layers.Layer4.ZoomMax=   0
      Map.Layers.Layer4.DoOverrideStyle=   0   'False
      Map.Layers.Layer4.LabelProperties.LabelMax=   100
      Map.Layers.Layer4.LabelProperties.Overlap=   0   'False
      Map.Layers.Layer4.LabelProperties.Duplicate=   0   'False
      Map.Layers.Layer4.LabelProperties.Offset=   2
      Map.Layers.Layer4.LabelProperties.LineType=   0
      Map.Layers.Layer4.LabelProperties.Zoom=   0   'False
      Map.Layers.Layer4.LabelProperties.ZoomMin=   0
      Map.Layers.Layer4.LabelProperties.ZoomMax=   10000
      Map.Layers.Layer4.LabelProperties.Visible=   -1  'True
      Map.Layers.Layer4.LabelProperties.Position=   0
      Map.Layers.Layer4.LabelProperties.Parallel=   -1  'True
      Map.Layers.Layer4.LabelProperties.LabelAlong=   1
      Map.Layers.Layer4.LabelProperties.PartialSegments=   0   'False
      Map.Layers.Layer4.LabelProperties.Style.TextFontColor=   128
      Map.Layers.Layer4.LabelProperties.Style.TextFontBackColor=   13696976
      Map.Layers.Layer4.LabelProperties.Style.TextFontHalo=   -1  'True
      Map.Layers.Layer4.LabelProperties.Style.SymbolChar=   0
      BeginProperty Map.Layers.Layer4.LabelProperties.Style.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Map.Layers.Layer4.LabelProperties.Style.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Map.Layers.Layer4.LabelProperties.Style.LineStyle=   1
      Map.Layers.Layer4.LabelProperties.Style.LineWidth=   1
      Map.Layers.Layer5.HasFileSpec=   -1  'True
      Map.Layers.Layer5.Skip=   0   'False
      Map.Layers.Layer5.Path=   "asia.tab"
      Map.Layers.Layer5.Name=   "Asia"
      Map.Layers.Layer5.Visible=   -1  'True
      Map.Layers.Layer5.Selectable=   -1  'True
      Map.Layers.Layer5.Editable=   0   'False
      Map.Layers.Layer5.ShowNodes=   0   'False
      Map.Layers.Layer5.ShowCentroids=   0   'False
      Map.Layers.Layer5.ShowLineDirection=   0   'False
      Map.Layers.Layer5.AutoLabel=   0   'False
      Map.Layers.Layer5.DrawLabelsAfter=   0   'False
      Map.Layers.Layer5.ZoomLayering=   0   'False
      Map.Layers.Layer5.ZoomMin=   0
      Map.Layers.Layer5.ZoomMax=   0
      Map.Layers.Layer5.DoOverrideStyle=   -1  'True
      Map.Layers.Layer5.OverrideStyle.TextFontBackColor=   16777215
      Map.Layers.Layer5.OverrideStyle.SymbolType=   2
      Map.Layers.Layer5.OverrideStyle.SupportsBitmapSymbols=   -1  'True
      Map.Layers.Layer5.OverrideStyle.SymbolVectorSize=   8
      BeginProperty Map.Layers.Layer5.OverrideStyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Map.Layers.Layer5.OverrideStyle.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Map Symbols"
         Size            =   14.25
         Charset         =   2
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Map.Layers.Layer5.OverrideStyle.LineStyle=   1
      Map.Layers.Layer5.OverrideStyle.LineWidth=   1
      Map.Layers.Layer5.OverrideStyle.RegionColor=   13684944
      Map.Layers.Layer5.OverrideStyle.LinePattern=   2
      Map.Layers.Layer5.OverrideStyle.RegionBackColor=   16777215
      Map.Layers.Layer5.OverrideStyle.RegionBorderStyle=   1
      Map.Layers.Layer5.OverrideStyle.RegionBorderWidth=   1
      Map.Layers.Layer5.LabelProperties.LabelMax=   100
      Map.Layers.Layer5.LabelProperties.Overlap=   0   'False
      Map.Layers.Layer5.LabelProperties.Duplicate=   -1  'True
      Map.Layers.Layer5.LabelProperties.Offset=   2
      Map.Layers.Layer5.LabelProperties.LineType=   0
      Map.Layers.Layer5.LabelProperties.Zoom=   0   'False
      Map.Layers.Layer5.LabelProperties.ZoomMin=   0
      Map.Layers.Layer5.LabelProperties.ZoomMax=   10000
      Map.Layers.Layer5.LabelProperties.Visible=   -1  'True
      Map.Layers.Layer5.LabelProperties.Position=   0
      Map.Layers.Layer5.LabelProperties.Parallel=   -1  'True
      Map.Layers.Layer5.LabelProperties.LabelAlong=   1
      Map.Layers.Layer5.LabelProperties.PartialSegments=   0   'False
      Map.Layers.Layer5.LabelProperties.Style.TextFontBackColor=   16777215
      Map.Layers.Layer5.LabelProperties.Style.SymbolChar=   0
      BeginProperty Map.Layers.Layer5.LabelProperties.Style.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Map.Layers.Layer5.LabelProperties.Style.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Map.Layers.Layer5.LabelProperties.Style.LineStyle=   1
      Map.Layers.Layer5.LabelProperties.Style.LineWidth=   1
      Map.Layers.Layer6.HasFileSpec=   -1  'True
      Map.Layers.Layer6.Skip=   0   'False
      Map.Layers.Layer6.Path=   "ocean_ll.tab"
      Map.Layers.Layer6.Name=   "Ocean (Lat/ Long)"
      Map.Layers.Layer6.Visible=   -1  'True
      Map.Layers.Layer6.Selectable=   0   'False
      Map.Layers.Layer6.Editable=   0   'False
      Map.Layers.Layer6.ShowNodes=   0   'False
      Map.Layers.Layer6.ShowCentroids=   0   'False
      Map.Layers.Layer6.ShowLineDirection=   0   'False
      Map.Layers.Layer6.AutoLabel=   0   'False
      Map.Layers.Layer6.DrawLabelsAfter=   0   'False
      Map.Layers.Layer6.ZoomLayering=   0   'False
      Map.Layers.Layer6.ZoomMin=   0
      Map.Layers.Layer6.ZoomMax=   0
      Map.Layers.Layer6.DoOverrideStyle=   0   'False
      Map.Layers.Layer6.LabelProperties.LabelMax=   100
      Map.Layers.Layer6.LabelProperties.Overlap=   0   'False
      Map.Layers.Layer6.LabelProperties.Duplicate=   -1  'True
      Map.Layers.Layer6.LabelProperties.Offset=   2
      Map.Layers.Layer6.LabelProperties.LineType=   0
      Map.Layers.Layer6.LabelProperties.Zoom=   0   'False
      Map.Layers.Layer6.LabelProperties.ZoomMin=   0
      Map.Layers.Layer6.LabelProperties.ZoomMax=   10000
      Map.Layers.Layer6.LabelProperties.Visible=   -1  'True
      Map.Layers.Layer6.LabelProperties.Position=   0
      Map.Layers.Layer6.LabelProperties.Parallel=   -1  'True
      Map.Layers.Layer6.LabelProperties.LabelAlong=   1
      Map.Layers.Layer6.LabelProperties.PartialSegments=   0   'False
      Map.Layers.Layer6.LabelProperties.Style.TextFontBackColor=   16777215
      Map.Layers.Layer6.LabelProperties.Style.SymbolChar=   0
      BeginProperty Map.Layers.Layer6.LabelProperties.Style.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Map.Layers.Layer6.LabelProperties.Style.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Map.Layers.Layer6.LabelProperties.Style.LineStyle=   1
      Map.Layers.Layer6.LabelProperties.Style.LineWidth=   1
      Map.NumericCoordSys.ProjectionInfo=   "FrmMain.frx":0000
      Map.DisplayCoordSys.ProjectionInfo=   "FrmMain.frx":0130
      Map.Zoom        =   5513
      Map.CenterX     =   21.0560373532986
      Map.CenterY     =   53.720915495604
      FeatureEditMode =   1
   End
   Begin ComctlLib.ImageList ImageList1 
      Left            =   7680
      Top             =   3120
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   29
      ImageHeight     =   27
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   6
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmMain.frx":0260
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmMain.frx":0A12
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmMain.frx":11C4
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmMain.frx":1976
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmMain.frx":2128
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmMain.frx":286E
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin VB.Menu mnuFile 
      Caption         =   "文件(&F)"
      Begin VB.Menu mnuFileExit 
         Caption         =   "退出(&Q)"
      End
   End
   Begin VB.Menu mnuEdit 
      Caption         =   "编辑(&E)"
      Begin VB.Menu mnuEditStyle 
         Caption         =   "特征属性"
      End
      Begin VB.Menu mnuEditOptions 
         Caption         =   "编辑选项"
      End
      Begin VB.Menu mnuEditLayers 
         Caption         =   "图层控制"
      End
   End
End
Attribute VB_Name = "FrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdAddline_Click()
    '线工具
    Map1.CurrentTool = miAddLineTool
End Sub

Private Sub cmdAddPoint_Click()
    '点工具
    Map1.CurrentTool = miAddPointTool
End Sub

Private Sub cmdAddPolygon_Click()
    '多边形工具
    Map1.CurrentTool = miAddRegionTool
End Sub

Private Sub cmdAddPolyline_Click()
    '折线工具
    Map1.CurrentTool = miAddPolylineTool
End Sub

Private Sub cmdArrow_Click()
    '箭头
    Map1.CurrentTool = miArrowTool
End Sub

Private Sub cmdSelect_Click()
    '选择工具
    Map1.CurrentTool = miSelectTool
End Sub

Private Sub Form_Load()
On Error GoTo ErrHandling
    '创建临时层,并且将其设置为插入层
    Dim newLayer As Layer
    Dim LayerInfoObject As New LayerInfo
    Dim fields As New fields

    fields.AddStringField "GeoName", 10

    LayerInfoObject.Type = miLayerInfoTypeTemp
    LayerInfoObject.AddParameter "Name", "Temporary Layer"
    LayerInfoObject.AddParameter "Fields", fields

    Set newLayer = Map1.Layers.Add(LayerInfoObject, 1)

    newLayer.Editable = True
    Set Map1.Layers.InsertionLayer = newLayer
    
    UpdateToolbarButtons
    Exit Sub
ErrHandling:
    MsgBox Err.Description
End Sub

Private Sub Form_Resize()
    '根据窗口大小调整地图控件大小
    If Me.ScaleWidth > 0 And Me.ScaleHeight > 0 Then
        Map1.Width = Me.ScaleWidth
        Map1.Height = Me.ScaleHeight
    End If
End Sub

Private Sub mnuEditLayers_Click()
    '图层属性设置
    Map1.Layers.LayersDlg
    UpdateToolbarButtons
End Sub

Private Sub mnuEditOptions_Click()
    '设置图层的一些属性
    FrmEditing.Show vbModal, Me
    
    UpdateToolbarButtons
End Sub

Private Sub mnuEditStyle_Click()
    '设置插入层的样式
    FrmStyle.Show vbModal, Me
End Sub

Private Sub mnuFileExit_Click()
    Unload Me
End Sub

Private Sub UpdateToolbarButtons()
    '设置相应按钮状态
    If IsInvalidObject(Map1.Layers.InsertionLayer) Then
        cmdAddPoint.Enabled = False
        cmdAddline.Enabled = False
        cmdAddPolyline.Enabled = False
        cmdAddPolygon.Enabled = False
    Else
        cmdAddPoint.Enabled = True
        cmdAddline.Enabled = True
        cmdAddPolyline.Enabled = True
        cmdAddPolygon.Enabled = True
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -