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

📄 frmmapx.frm

📁 鹰眼功能——VB+mapX,实现漫游
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      PreferCompactLegends=   0   'False
      TitleVisible    =   -1  'True
      MousePointer    =   0
      MouseIcon       =   ""
      MatchThreshold  =   80
      WaitCursorEnabled=   -1  'True
      MousewheelSupport=   1
      MatchNumericFields=   0   'False
      RedrawInterval  =   10
      PanAnimationLayer=   0   'False
      InfotipSupport  =   -1  'True
      InfotipPopupDelay=   500
      DefaultConversionResolution=   12
      ExportSelection =   0   'False
      NumLayers       =   3
      Layer0.path     =   "Asiacaps.TAB"
      Layer0.name     =   "Asia Capitals"
      Layer0.visible  =   -1  'True
      Layer0.selectable=   -1  'True
      Layer0.editable =   0   'False
      Layer0.shownodes=   0   'False
      Layer0.showcentroids=   0   'False
      Layer0.showlinedirection=   0   'False
      Layer0.autolabel=   -1  'True
      Layer0.zoomlayering=   -1  'True
      Layer0.minzoom  =   3000
      Layer0.maxzoom  =   10000
      Layer0.DrawLabelsAfter=   0   'False
      Layer0.styleoverride=   0   'False
      Layer0.labelstyle.TextFontBackColor=   16777215
      Layer0.labelstyle.SymbolChar=   0
      BeginProperty Layer0.labelstyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "System"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Layer0.labelstyle.LineStyle=   1
      Layer0.labelstyle.LineWidth=   1
      Layer0.LabelMax =   100
      Layer0.LabelOverlap=   0   'False
      Layer0.LabelDuplicate=   0   'False
      Layer0.LabelOffset=   2
      Layer0.LabelLineType=   2
      Layer0.LabelZoomMax=   10000
      Layer0.LabelZoomMin=   0
      Layer0.LabelZoom=   0   'False
      Layer0.LabelVisible=   -1  'True
      Layer0.LabelOrientation=   5
      Layer0.LabelParellel=   -1  'True
      Layer0.PartialSegments=   0   'False
      Layer1.path     =   "Asicty79.TAB"
      Layer1.name     =   "Asia Major Cities"
      Layer1.visible  =   -1  'True
      Layer1.selectable=   -1  'True
      Layer1.editable =   0   'False
      Layer1.shownodes=   0   'False
      Layer1.showcentroids=   0   'False
      Layer1.showlinedirection=   0   'False
      Layer1.autolabel=   -1  'True
      Layer1.zoomlayering=   -1  'True
      Layer1.minzoom  =   0
      Layer1.maxzoom  =   3000
      Layer1.DrawLabelsAfter=   0   'False
      Layer1.styleoverride=   0   'False
      Layer1.labelstyle.TextFontBackColor=   16777215
      Layer1.labelstyle.SymbolChar=   0
      BeginProperty Layer1.labelstyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "System"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Layer1.labelstyle.LineStyle=   1
      Layer1.labelstyle.LineWidth=   1
      Layer1.LabelMax =   100
      Layer1.LabelOverlap=   0   'False
      Layer1.LabelDuplicate=   0   'False
      Layer1.LabelOffset=   2
      Layer1.LabelLineType=   2
      Layer1.LabelZoomMax=   10000
      Layer1.LabelZoomMin=   0
      Layer1.LabelZoom=   0   'False
      Layer1.LabelVisible=   -1  'True
      Layer1.LabelOrientation=   5
      Layer1.LabelParellel=   -1  'True
      Layer1.PartialSegments=   0   'False
      Layer2.path     =   "Asia.TAB"
      Layer2.name     =   "Asia"
      Layer2.visible  =   -1  'True
      Layer2.selectable=   -1  'True
      Layer2.editable =   0   'False
      Layer2.shownodes=   0   'False
      Layer2.showcentroids=   0   'False
      Layer2.showlinedirection=   0   'False
      Layer2.autolabel=   -1  'True
      Layer2.zoomlayering=   0   'False
      Layer2.minzoom  =   0
      Layer2.maxzoom  =   0
      Layer2.DrawLabelsAfter=   0   'False
      Layer2.styleoverride=   0   'False
      Layer2.labelstyle.TextFontColor=   128
      Layer2.labelstyle.SymbolChar=   0
      BeginProperty Layer2.labelstyle.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
      Layer2.labelstyle.LineStyle=   1
      Layer2.labelstyle.LineWidth=   1
      Layer2.LabelMax =   100
      Layer2.LabelOverlap=   0   'False
      Layer2.LabelDuplicate=   0   'False
      Layer2.LabelOffset=   2
      Layer2.LabelLineType=   0
      Layer2.LabelZoomMax=   10000
      Layer2.LabelZoomMin=   0
      Layer2.LabelZoom=   0   'False
      Layer2.LabelVisible=   -1  'True
      Layer2.LabelOrientation=   0
      Layer2.LabelParellel=   -1  'True
      Layer2.PartialSegments=   0   'False
      TitleStyle.TextFontBackColor=   16777215
      TitleStyle.TextFontOpaque=   -1  'True
      TitleStyle.SymbolChar=   0
      BeginProperty TitleStyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   35.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty TitleStyle.SymbolFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   27.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      DefaultStyle.TextFontBackColor=   16777215
      DefaultStyle.SupportsBitmapSymbols=   -1  'True
      DefaultStyle.SymbolChar=   55
      DefaultStyle.SymbolFontBackColor=   16777215
      BeginProperty DefaultStyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty DefaultStyle.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
      DefaultStyle.LineStyle=   1
      DefaultStyle.LineWidth=   1
      DefaultStyle.RegionColor=   16777215
      DefaultStyle.LinePattern=   2
      DefaultStyle.RegionBackColor=   16777215
      DefaultStyle.RegionBorderStyle=   1
      DefaultStyle.RegionBorderWidth=   1
      HasProjectionInfo=   -1  'True
      NumericCoordsys =   "FrmMapX.frx":0278
      DisplayCoordsys =   "FrmMapX.frx":03A8
      NumDatasets     =   0
      TitleX          =   5000
      TitleY          =   1000
      TitleVisible    =   -1  'True
      TitleEditable   =   -1  'True
      TitlePostiion   =   0
      TitleBorder     =   -1  'True
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'CmdZoomIn , CmdZoomOut, CmdPan

'本程序演示MapX的“鹰眼”窗口
'采用MapX的Feature方式实现
Dim m_TempLayer As Layer '导航图上临时图层
Dim m_Fea As MapXLib.Feature '导航图上反映主地图窗口位置的Feature
Dim bDown As Boolean '鼠标在导航图上按下的标志

Private Sub CmdPan_Click()
    Map1.CurrentTool = miPanTool
End Sub

Private Sub CmdZoomIn_Click()
    Map1.CurrentTool = miZoomInTool
End Sub

Private Sub CmdZoomOut_Click()
    Map1.CurrentTool = miZoomOutTool
End Sub

Private Sub Form_Load()
    ''给Map2增加临时图层
    Set m_TempLayer = Map2.Layers.CreateLayer("wewew")
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set m_Fea = Nothing
    Set m_TempLayer = Nothing
End Sub

''根据map1的Bounds在Map2上绘制矩形
Private Sub Map1_MapViewChanged()
    Dim tempFea As MapXLib.Feature
    Dim tempPnts As MapXLib.Points
    Dim tempStyle As MapXLib.Style

    If m_TempLayer.AllFeatures.Count = 0 Then '矩形边框还没有
        '设置矩形边框样式
        Set tempStyle = New MapXLib.Style
        tempStyle.RegionPattern = miPatternNoFill
        tempStyle.RegionBorderColor = 255
        tempStyle.RegionBorderWidth = 2
        '在临时图层添加大小为Map1的边界的Rectangle对象
        Set tempFea = Map2.FeatureFactory.CreateRegion(Map1.Bounds, tempStyle)
        Set m_Fea = m_TempLayer.AddFeature(tempFea)
        Set tempStyle = Nothing
    Else '根据Map1的视野变化改变矩形边框的大小和位置
        With m_Fea.Parts.Item(1)
            .RemoveAll
            .AddXY Map1.Bounds.XMin, Map1.Bounds.YMin
            .AddXY Map1.Bounds.XMax, Map1.Bounds.YMin
            .AddXY Map1.Bounds.XMax, Map1.Bounds.YMax
            .AddXY Map1.Bounds.XMin, Map1.Bounds.YMax
        End With
        m_Fea.Update
    End If
End Sub

'下面代码和"API方式实现"的一样
Private Sub Map2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim MapX As Double
    Dim MapY As Double
    bDown = True
    Map2.ConvertCoord X, Y, MapX, MapY, miScreenToMap
    Map1.CenterX = MapX
    Map1.CenterY = MapY
End Sub

Private Sub Map2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim MapX As Double
    Dim MapY As Double
    If bDown Then
        Map2.ConvertCoord X, Y, MapX, MapY, miScreenToMap
        Map1.CenterX = MapX
        Map1.CenterY = MapY
    End If
End Sub

Private Sub Map2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    bDown = False
End Sub

⌨️ 快捷键说明

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