Handler for OnMapZoomChanged

Topics: General
Oct 4, 2011 at 11:02 AM


I'm trying to catch the mousewheel or OnMapZoomChanged event for when zooming, and get it to update a control, bit like your demo but struggling to get it to work in vb.net.

I have the control declared as:

Dim GMapcontrol1 As New GMapControl

But in order to handle an event I've tried:

Friend WithEvents GMapcontrol1 As GMapControl and
Protected WithEvents GMapcontrol1 As GMapControl

But they throw errors when it hits the InitializeComponent.

Any ideas?

Many thanks for a truely brilliant project!

Oct 4, 2011 at 12:23 PM

..well, i'm not vb expert, can't help much

Oct 4, 2011 at 12:29 PM

No neither am I, customer wants the project in vb though :(


I just used the mousewheel handler on the panel that contains the map then checked if it had focus.

Private Sub Networkview_panel_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Networkview_panel.MouseWheel
        If GMapcontrol1.Focus = True Then
            TrackBar1.Value = GMapcontrol1.Zoom
        End If
    End Sub


Oct 4, 2011 at 2:31 PM

Radioman - on another subject, I'm trying to add markers, but nothing gets displayed when I add from a private sub().

Have they got to be called from a seperate class with onRender ?  I can add them in the InitializeComponent New() as it is a renderer.


Oct 4, 2011 at 2:34 PM

did you checked demo source? you add map, create overlay, add it to the map, add markers to your overlay, doesn't matter from where