Using the control in VbNet under Vs2005

Jul 31, 2009 at 9:08 AM
Edited Jul 31, 2009 at 9:10 AM


it looks like a great project but i have some problems using it.. i set current position, gmaps finds it ( G_GEO_SUCCESS ) but i don't see any changes to the map in my form..

I made for you a simple example, showing you the problem. It is a windows application with a single form, with a textbox for the address and a button GO.

What can i do to show the map?


Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not GMapControl1.SetCurrentPositionByKeywords(TextBox1.Text) = GMap.NET.GeoCoderStatusCode.G_GEO_SUCCESS Then
            MsgBox("Address not found!")
            Exit Sub
        End If

        GMapControl1.Zoom = 10

    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        With GMap.NET.GMaps.Instance
            .Language = "it"
        End With

        GMapControl1.MapType = GMap.NET.MapType.GoogleHybrid
    End Sub
End Class

Any help is appreciated. Thanks in advance.




Jul 31, 2009 at 9:14 AM

noo need to do GMapControl1.ReloadMap(), but everythink else should work good and it does ;}

maybe try other keywords ;/

Aug 8, 2009 at 3:10 PM
Edited Aug 8, 2009 at 5:33 PM

@Fpandolfini: Did u succeed getting a map displayed on your form? I'm also developing in VS2005 and created a simple project as you did, but only receive the error "We are sorry, but we don't have imagery at this zoom level for this region" when running.

 Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        MainMap.MapType = GMap.NET.MapType.GoogleMap
        MainMap.MinZoom = 2
        MainMap.MaxZoom = 13
        MainMap.Zoom = 5

        MainMap.CurrentPosition = New PointLatLng(54.6961334816182, 25.2985095977783)

    End Sub
EDIT: I made a quite beginner's mistake: didn't copy the SQlite.dll to the bin\debug directory of my project. That's why the map didn't load...(how dumb, afterwards....)
Aug 17, 2009 at 10:30 AM

Ok i found the problem: i didn't set Min and Max Zoom, so the zoom didn't work

Now it works fine.