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

📄 form1.frm

📁 这是一个VC++、mapX的应用实例
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      Map.Layers.Layer7.OverrideStyle.SupportsBitmapSymbols=   -1  'True
      Map.Layers.Layer7.OverrideStyle.SymbolVectorSize=   8
      BeginProperty Map.Layers.Layer7.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.Layer7.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.Layer7.OverrideStyle.LineStyle=   1
      Map.Layers.Layer7.OverrideStyle.LineWidth=   1
      Map.Layers.Layer7.OverrideStyle.RegionColor=   16777215
      Map.Layers.Layer7.OverrideStyle.RegionBackColor=   16777215
      Map.Layers.Layer7.OverrideStyle.RegionBorderColor=   8421504
      Map.Layers.Layer7.OverrideStyle.RegionBorderStyle=   1
      Map.Layers.Layer7.OverrideStyle.RegionBorderWidth=   1
      Map.Layers.Layer7.LabelProperties.LabelMax=   100
      Map.Layers.Layer7.LabelProperties.Overlap=   0   'False
      Map.Layers.Layer7.LabelProperties.Duplicate=   -1  'True
      Map.Layers.Layer7.LabelProperties.Offset=   2
      Map.Layers.Layer7.LabelProperties.LineType=   0
      Map.Layers.Layer7.LabelProperties.Zoom=   -1  'True
      Map.Layers.Layer7.LabelProperties.ZoomMin=   0
      Map.Layers.Layer7.LabelProperties.ZoomMax=   150
      Map.Layers.Layer7.LabelProperties.Visible=   -1  'True
      Map.Layers.Layer7.LabelProperties.Position=   0
      Map.Layers.Layer7.LabelProperties.Parallel=   -1  'True
      Map.Layers.Layer7.LabelProperties.LabelAlong=   1
      Map.Layers.Layer7.LabelProperties.PartialSegments=   0   'False
      Map.Layers.Layer7.LabelProperties.Style.TextFontColor=   8421504
      Map.Layers.Layer7.LabelProperties.Style.TextFontBackColor=   13696976
      Map.Layers.Layer7.LabelProperties.Style.TextFontHalo=   -1  'True
      Map.Layers.Layer7.LabelProperties.Style.TextFontAllCaps=   -1  'True
      Map.Layers.Layer7.LabelProperties.Style.SymbolChar=   0
      BeginProperty Map.Layers.Layer7.LabelProperties.Style.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Map.Layers.Layer7.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.Layer7.LabelProperties.Style.LineStyle=   1
      Map.Layers.Layer7.LabelProperties.Style.LineWidth=   1
      Map.Layers.Layer8.HasFileSpec=   -1  'True
      Map.Layers.Layer8.Skip=   0   'False
      Map.Layers.Layer8.Path=   "usa.tab"
      Map.Layers.Layer8.Name=   "USA"
      Map.Layers.Layer8.Visible=   -1  'True
      Map.Layers.Layer8.Selectable=   -1  'True
      Map.Layers.Layer8.Editable=   0   'False
      Map.Layers.Layer8.ShowNodes=   0   'False
      Map.Layers.Layer8.ShowCentroids=   0   'False
      Map.Layers.Layer8.ShowLineDirection=   0   'False
      Map.Layers.Layer8.AutoLabel=   -1  'True
      Map.Layers.Layer8.DrawLabelsAfter=   0   'False
      Map.Layers.Layer8.ZoomLayering=   0   'False
      Map.Layers.Layer8.ZoomMin=   0
      Map.Layers.Layer8.ZoomMax=   0
      Map.Layers.Layer8.DoOverrideStyle=   0   'False
      Map.Layers.Layer8.LabelProperties.LabelMax=   100
      Map.Layers.Layer8.LabelProperties.Overlap=   0   'False
      Map.Layers.Layer8.LabelProperties.Duplicate=   0   'False
      Map.Layers.Layer8.LabelProperties.Offset=   2
      Map.Layers.Layer8.LabelProperties.LineType=   0
      Map.Layers.Layer8.LabelProperties.Zoom=   -1  'True
      Map.Layers.Layer8.LabelProperties.ZoomMin=   400
      Map.Layers.Layer8.LabelProperties.ZoomMax=   3500.5
      Map.Layers.Layer8.LabelProperties.Visible=   -1  'True
      Map.Layers.Layer8.LabelProperties.Position=   0
      Map.Layers.Layer8.LabelProperties.Parallel=   -1  'True
      Map.Layers.Layer8.LabelProperties.LabelAlong=   1
      Map.Layers.Layer8.LabelProperties.PartialSegments=   0   'False
      Map.Layers.Layer8.LabelProperties.Style.TextFontColor=   128
      Map.Layers.Layer8.LabelProperties.Style.TextFontBackColor=   13696976
      Map.Layers.Layer8.LabelProperties.Style.TextFontHalo=   -1  'True
      Map.Layers.Layer8.LabelProperties.Style.SymbolChar=   0
      BeginProperty Map.Layers.Layer8.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.Layer8.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.Layer8.LabelProperties.Style.LineStyle=   1
      Map.Layers.Layer8.LabelProperties.Style.LineWidth=   1
      Map.Layers.Layer9.HasFileSpec=   -1  'True
      Map.Layers.Layer9.Skip=   0   'False
      Map.Layers.Layer9.Path=   "ocean_ll.tab"
      Map.Layers.Layer9.Name=   "Ocean (Lat/ Long)"
      Map.Layers.Layer9.Visible=   -1  'True
      Map.Layers.Layer9.Selectable=   0   'False
      Map.Layers.Layer9.Editable=   0   'False
      Map.Layers.Layer9.ShowNodes=   0   'False
      Map.Layers.Layer9.ShowCentroids=   0   'False
      Map.Layers.Layer9.ShowLineDirection=   0   'False
      Map.Layers.Layer9.AutoLabel=   0   'False
      Map.Layers.Layer9.DrawLabelsAfter=   0   'False
      Map.Layers.Layer9.ZoomLayering=   0   'False
      Map.Layers.Layer9.ZoomMin=   0
      Map.Layers.Layer9.ZoomMax=   0
      Map.Layers.Layer9.DoOverrideStyle=   0   'False
      Map.Layers.Layer9.LabelProperties.LabelMax=   100
      Map.Layers.Layer9.LabelProperties.Overlap=   0   'False
      Map.Layers.Layer9.LabelProperties.Duplicate=   -1  'True
      Map.Layers.Layer9.LabelProperties.Offset=   2
      Map.Layers.Layer9.LabelProperties.LineType=   0
      Map.Layers.Layer9.LabelProperties.Zoom=   0   'False
      Map.Layers.Layer9.LabelProperties.ZoomMin=   0
      Map.Layers.Layer9.LabelProperties.ZoomMax=   10000
      Map.Layers.Layer9.LabelProperties.Visible=   -1  'True
      Map.Layers.Layer9.LabelProperties.Position=   0
      Map.Layers.Layer9.LabelProperties.Parallel=   -1  'True
      Map.Layers.Layer9.LabelProperties.LabelAlong=   1
      Map.Layers.Layer9.LabelProperties.PartialSegments=   0   'False
      Map.Layers.Layer9.LabelProperties.Style.TextFontBackColor=   16777215
      Map.Layers.Layer9.LabelProperties.Style.SymbolChar=   0
      BeginProperty Map.Layers.Layer9.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.Layer9.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.Layer9.LabelProperties.Style.LineStyle=   1
      Map.Layers.Layer9.LabelProperties.Style.LineWidth=   1
      Map.NumericCoordSys.ProjectionInfo=   "Form1.frx":0000
      Map.DisplayCoordSys.ProjectionInfo=   "Form1.frx":0130
      Map.Zoom        =   3500.00000000001
      Map.CenterX     =   -95.6166318454741
      Map.CenterY     =   38.2558563554565
      FeatureEditMode =   1
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public ftr As MapXLib.Feature
Public lyr As MapXLib.Layer
Public kk As Boolean




Private Sub Command1_Click()
'Dim lyr As MapXLib.Layer
Dim ds As MapXLib.Dataset
Dim ss As Boolean

Dim ftrs As MapXLib.Features
'Dim ftr As MapXLib.Feature

Map1.Bounds = Map1.Layers.Bounds
Set lyr = Map1.Layers(List1.Text)
Set ds = Map1.DataSets.Add(miDataSetLayer, lyr)

Set ftrs = lyr.Search("名称 like " + Chr(34) + "%" + List2.Text + "%" + Chr(34))
 'Set ftrs = lyr.Search("名称 like" & "%Text1.Text %")
If ftrs.Count > 0 Then
  Set ftr = ftrs(1)
    Timer1.Enabled = True
   'lyr.Selection.Replace ftr
   'ss = lyr.Selection.Item(1).Style.SymbolFontShadow
   'ss = True

  Map1.ZoomTo (Map1.Zoom) * 0.2, ftr.CenterX, ftr.CenterY
  
  Map1.Refresh
End If

End Sub

Private Sub Command2_Click()
Dim ss As String
List1.Clear
List2.Clear
ss = App.Path & "\data\gz_map.gst"
Map1.GeoSet = ss
 List1.AddItem "医院"
 List1.AddItem "邮局"
 List1.AddItem "车站"
  List1.AddItem "乡镇"
 List1.AddItem "银行"
 List1.AddItem "政府部门"
 List1.AddItem "旅游景点"
 List1.AddItem "旅饭店"
End Sub

Private Sub Form_Load()
Dim ss As String
List1.Clear
ss = App.Path & "\data\gz_map.gst"
Map1.GeoSet = ss
 List1.AddItem "医院"
 List1.AddItem "邮局"
 List1.AddItem "车站"
  List1.AddItem "乡镇"
 List1.AddItem "银行"
 List1.AddItem "政府部门"
 List1.AddItem "旅游景点"
 List1.AddItem "旅饭店"
End Sub

Private Sub List1_Click()

Dim objfeature As New Feature
List2.Clear
For Each objfeature In Map1.Layers(List1.Text).AllFeatures
List2.AddItem objfeature.KeyValue
Next
Set objfeature = Nothing
End Sub

Private Sub Timer1_Timer()
 Static flag As Integer

 If flag < 80 Then
 If kk = False Then
 lyr.Selection.Replace ftr
 kk = True
 Else
 lyr.Selection.ClearSelection
 kk = False
 End If
 flag = flag + 1
 Else
 Timer1.Enabled = False
 flag = 1
 End If
End Sub

⌨️ 快捷键说明

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