Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all articles
Browse latest Browse all 2341

New Post: Zooming Using Trackbar

$
0
0
I want zoomin and zoomout map using trackbar, But its keep zooming with random scale.
Can you guys help me with this?
thankyou very much.

I set trackbar value 0 to 10

Here is my code :


Dim newScale As Double = TrackBar1.Value
Dim defz As Integer

If newScale = zoomScale Then
        MainMap.ZoomToMaxExtents()
        defz = MainMap.ZoomPercent
        ' MsgBox(defz)
        ScaleCombobox.Text = "1 : " & SetMapScale() & " Km"
        scaleLabel.Text = "1 : " & SetMapScale() & " Km"
    ElseIf newScale < zoomScale Then
        'MainMap.ZoomOut(TrackBar1.Value * 0.05)
        MainMap.ZoomOut((TrackBar1.Value / 10) * 0.3)
        zoomScale = 5
        ScaleCombobox.Text = "1 : " & SetMapScale() & " Km"
        scaleLabel.Text = "1 : " & SetMapScale() & " Km"
    ElseIf newScale > zoomScale Then
        'MainMap.ZoomIn(TrackBar1.Value * 0.05)
        MainMap.ZoomIn((TrackBar1.Value / 10) * 0.3)
        zoomScale = 5
        ScaleCombobox.Text = "1 : " & SetMapScale() & " Km"
        scaleLabel.Text = "1 : " & SetMapScale() & " Km"
    End If

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>