MapX+VB 前一视图功能

2016-07-08

Option Explicit
Dim oZoom As Double
Dim oMapX As Double
Dim oMapY As Double
Dim Zoom As Double
Dim MapX As Double
Dim MapY As Double

Private Sub Form_Load()
cmdPreOrNextView.Caption = "前一视图" 
End Sub

Private Sub cmdPreOrNextView_Click()
Map1.ZoomTo oZoom, oMapX, oMapY
If cmdPreOrNextView.Caption = "前一视图" Then
cmdPreOrNextView.Caption = "后一视图"
Else
cmdPreOrNextView.Caption = "前一视图"
End If
End Sub

Private Sub Map1_MapViewChanged()
oZoom = Zoom
oMapX = MapX
oMapY = MapY

Zoom = Map1.Zoom
MapX = Map1.CenterX
MapY = Map1.CenterY
End Sub