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

📄 vb2a9.tmp

📁 介绍VB下MAPX实现的二次搜索查询
💻 TMP
字号:
VERSION 5.00
Object = "{9D6ED199-5910-11D2-98A6-00A0C9742CCA}#4.0#0"; "MAPX40.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   7275
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8550
   LinkTopic       =   "Form1"
   ScaleHeight     =   7275
   ScaleWidth      =   8550
   StartUpPosition =   3  '窗口缺省
   Begin MapXLib.Map Map1 
      Height          =   3495
      Left            =   720
      TabIndex        =   1
      Top             =   600
      Width           =   5415
      _Version        =   400013
      _ExtentX        =   9551
      _ExtentY        =   6165
      _StockProps     =   1
      GeoDictionary   =   "GeoDictionary"
      GeoSet          =   "United States"
      GeoSetUserName  =   "United States"
      CurrentTool     =   1000
      Zoom            =   3500
      MaxSearchTime   =   30
      CenterX         =   -96.0002857506274
      CenteryY        =   39.1210893255858
      Rotation        =   0
      FeatureEditMode =   1
      NodeHandleSize  =   0
      TitleText       =   "United States"
      DataSetGeoField =   ""
      AutoRedraw      =   -1  'True
      PreferCompactLegends=   0   'False
      TitleVisible    =   -1  'True
      MousePointer    =   0
      MouseIcon       =   ""
      MatchThreshold  =   80
      WaitCursorEnabled=   -1  'True
      MousewheelSupport=   1
      MatchNumericFields=   0   'False
      RedrawInterval  =   100
      PanAnimationLayer=   0   'False
      InfotipSupport  =   -1  'True
      InfotipPopupDelay=   500
      DefaultConversionResolution=   12
      ExportSelection =   0   'False
      NumLayers       =   5
      Layer0.path     =   "Uscty_20.tab"
      Layer0.name     =   "US Top 20 Cities"
      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  =   400
      Layer0.maxzoom  =   3500
      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=   2000
      Layer0.LabelZoomMin=   400
      Layer0.LabelZoom=   -1  'True
      Layer0.LabelVisible=   -1  'True
      Layer0.LabelOrientation=   5
      Layer0.LabelParellel=   -1  'True
      Layer0.PartialSegments=   0   'False
      Layer1.path     =   "usa_caps.tab"
      Layer1.name     =   "US Capitals"
      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  =   400
      Layer1.maxzoom  =   1500
      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     =   "uscty_1k.tab"
      Layer2.name     =   "US Major Cities"
      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=   -1  'True
      Layer2.minzoom  =   180
      Layer2.maxzoom  =   400
      Layer2.DrawLabelsAfter=   0   'False
      Layer2.styleoverride=   0   'False
      Layer2.labelstyle.TextFontBackColor=   16777215
      Layer2.labelstyle.SymbolChar=   0
      BeginProperty Layer2.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
      Layer2.labelstyle.LineStyle=   1
      Layer2.labelstyle.LineWidth=   1
      Layer2.LabelMax =   100
      Layer2.LabelOverlap=   0   'False
      Layer2.LabelDuplicate=   0   'False
      Layer2.LabelOffset=   2
      Layer2.LabelLineType=   2
      Layer2.LabelZoomMax=   10000
      Layer2.LabelZoomMin=   0
      Layer2.LabelZoom=   0   'False
      Layer2.LabelVisible=   -1  'True
      Layer2.LabelOrientation=   5
      Layer2.LabelParellel=   -1  'True
      Layer2.PartialSegments=   0   'False
      Layer3.path     =   "uscty_8k.tab"
      Layer3.name     =   "US Minor Cities"
      Layer3.visible  =   -1  'True
      Layer3.selectable=   -1  'True
      Layer3.editable =   0   'False
      Layer3.shownodes=   0   'False
      Layer3.showcentroids=   0   'False
      Layer3.showlinedirection=   0   'False
      Layer3.autolabel=   -1  'True
      Layer3.zoomlayering=   -1  'True
      Layer3.minzoom  =   0
      Layer3.maxzoom  =   180
      Layer3.DrawLabelsAfter=   0   'False
      Layer3.styleoverride=   0   'False
      Layer3.labelstyle.TextFontBackColor=   16777215
      Layer3.labelstyle.SymbolChar=   0
      BeginProperty Layer3.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
      Layer3.labelstyle.LineStyle=   1
      Layer3.labelstyle.LineWidth=   1
      Layer3.LabelMax =   100
      Layer3.LabelOverlap=   0   'False
      Layer3.LabelDuplicate=   0   'False
      Layer3.LabelOffset=   2
      Layer3.LabelLineType=   2
      Layer3.LabelZoomMax=   10000
      Layer3.LabelZoomMin=   0
      Layer3.LabelZoom=   0   'False
      Layer3.LabelVisible=   -1  'True
      Layer3.LabelOrientation=   5
      Layer3.LabelParellel=   -1  'True
      Layer3.PartialSegments=   0   'False
      Layer4.path     =   "usa.tab"
      Layer4.name     =   "USA"
      Layer4.visible  =   -1  'True
      Layer4.selectable=   -1  'True
      Layer4.editable =   0   'False
      Layer4.shownodes=   0   'False
      Layer4.showcentroids=   0   'False
      Layer4.showlinedirection=   0   'False
      Layer4.autolabel=   0   'False
      Layer4.zoomlayering=   0   'False
      Layer4.minzoom  =   0
      Layer4.maxzoom  =   0
      Layer4.DrawLabelsAfter=   0   'False
      Layer4.styleoverride=   0   'False
      Layer4.labelstyle.TextFontColor=   128
      Layer4.labelstyle.SymbolChar=   0
      BeginProperty Layer4.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
      Layer4.labelstyle.LineStyle=   1
      Layer4.labelstyle.LineWidth=   1
      Layer4.LabelMax =   100
      Layer4.LabelOverlap=   0   'False
      Layer4.LabelDuplicate=   0   'False
      Layer4.LabelOffset=   2
      Layer4.LabelLineType=   0
      Layer4.LabelZoomMax=   3500.5
      Layer4.LabelZoomMin=   400
      Layer4.LabelZoom=   -1  'True
      Layer4.LabelVisible=   -1  'True
      Layer4.LabelOrientation=   0
      Layer4.LabelParellel=   -1  'True
      Layer4.PartialSegments=   0   'False
      TitleStyle.TextFontBackColor=   16777215
      TitleStyle.TextFontOpaque=   -1  'True
      TitleStyle.SymbolChar=   0
      BeginProperty TitleStyle.TextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   17.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            =   17.25
         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 =   "Form1.frx":0000
      DisplayCoordsys =   "Form1.frx":0130
      NumDatasets     =   0
      TitleX          =   5000
      TitleY          =   1000
      TitleVisible    =   -1  'True
      TitleEditable   =   -1  'True
      TitlePostiion   =   0
      TitleBorder     =   -1  'True
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   495
      Left            =   360
      TabIndex        =   0
      Top             =   6240
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
 Dim Lay As Layer
 Set Lay = Map1.Layers.Item(1)
 Lay.Editable = True
 Set Map1.Layers.InsertionLayer = Lay
 
End Sub

Private Sub Form_Load()

 Dim lInfo As MapXLib.LayerInfo
 Dim lStr As String
 Dim Lay As MapXLib.Layer
 Map1.MousewheelSupport = miMousewheelNoAutoScroll
 Set lInfo = CreateObject("mapx.layerinfo.4")
 lInfo.Type = 4 ' layer type is RDB
 lInfo.AddParameter "NAME", "单位" ' layer name
 lInfo.AddParameter "TOOLKIT", "ODBC" ' use "ORAINET" for oracle direct access
 lInfo.AddParameter "CONNECTSTRING", "dsn=map;uid=sa;pwd="
 lInfo.AddParameter "QUERY", "SELECT * FROM danwei where 单位编码  like '%X%' "
 lInfo.AddParameter "CACHE", "ON"
 lInfo.AddParameter "MBRSEARCH", "ON"
 Map1.Layers.Add lInfo
 Set Lay = Map1.Layers.Item(1)
 Map1.Layers.Item(1).AutoLabel = True
 Set lInfo = Nothing
End Sub

Private Sub Form_Resize()
 Map1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End Sub

Private Sub Map1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  If Button = 2 Then Map1.PropertyPage
End Sub

⌨️ 快捷键说明

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