GMap Control only showing part of map

Topics: Windows Forms
Oct 17, 2011 at 12:56 PM

With the newest build (both the hot build and compling the source and using those dlls) the same thing happens.  When I run my map, only the left half side of the control is filled.

Here is a screenshot of it:  http://www.pronet-systems.us/gmap.jpg

Any idea on how to fix this?

Coordinator
Oct 17, 2011 at 1:03 PM

you probably adding control in onLoad event, i've no idea vhy vb people do this ;} just add it in constructor or use designer

Oct 17, 2011 at 1:17 PM

I am using designer.

Coordinator
Oct 17, 2011 at 1:36 PM

can you show the code?

Oct 17, 2011 at 2:04 PM
  Private Sub Button1_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button1.Click
 
        With myMap
            .MapProvider = GMapProviders.OpenStreetMap
            .MinZoom = 1
            .MaxZoom = 20
            .Zoom = 2
            .Manager.Mode = GMap.NET.AccessMode.ServerAndCache
        End With
 
        myMap.Position = New GMap.NET.PointLatLng(39.605612582602, -83.233154296875)
 
 
        Dim overlayOne As New GMap.NET.WindowsForms.GMapOverlay(myMap, "OverlayOne")
        overlayOne.Markers.Add(New GMap.NET.WindowsForms.Markers.GMapMarkerGoogleGreen(New GMap.NET.PointLatLng(39.605612582602, -83.233154296875)))
 
        myMap.Overlays.Add(overlayOne)
 
    End Sub
Coordinator
Oct 17, 2011 at 2:16 PM

move these to form constructor:

With myMap
.MapProvider = GMapProviders.OpenStreetMap
.MinZoom = 1
.MaxZoom = 20
.Zoom = 2
End With

Oct 17, 2011 at 2:55 PM

Just tried that.. no luck, I get the same results..  Here is the code:

 

Imports System.Data.SQLite
Imports GMap.NET.WindowsForms
Imports GMap.NET.WindowsForms.Markers
Imports GMap.NET.WindowsForms.ToolTips
Imports GMap.NET
Imports GMap.NET.MapProviders
Public Class class1
    Shared x As Integer
 
    Public Sub New()
        With Form2.myMap
            .MapProvider = GMapProviders.OpenStreetMap
            .MinZoom = 1
            .MaxZoom = 20
            .Zoom = 2
        End With
    End Sub
End Class
Private Sub Button1_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button1.Click
 
        Dim objItem As New class1
 
 
        myMap.Position = New GMap.NET.PointLatLng(39.605612582602, -83.233154296875)
 
 
        Dim overlayOne As New GMap.NET.WindowsForms.GMapOverlay(myMap, "OverlayOne")
        overlayOne.Markers.Add(New GMap.NET.WindowsForms.Markers.GMapMarkerGoogleGreen(New GMap.NET.PointLatLng(39.605612582602, -83.233154296875)))
        myMap.Overlays.Add(overlayOne)
 
    End Sub
Coordinator
Oct 17, 2011 at 3:00 PM

class1 ? ;/ ..you are doing it in the wrong place, you need set parameters in the form where is your map control, witch is Form2

Oct 17, 2011 at 3:04 PM

Sorry im new to contructors.. i'll be reading more on it now.

Oct 21, 2011 at 10:40 AM
Edited Oct 21, 2011 at 10:40 AM

You need to add the code ...

With myMap
   .MapProvider = GMapProviders.OpenStreetMap
   .MinZoom = 1
   .MaxZoom = 20
   .Zoom = 2
   .Manager.Mode = GMap.NET.AccessMode.ServerAndCache
End With

...in the myMap_Load(....) handles mymap.load() - event