No map appearing, just white control

Topics: Help
Oct 2, 2011 at 12:14 PM

Trying to implement a new map control but just getting white background, although the map scroll crosshair does appear on right clicking the map, plus on mousewheel the cursor goes to the center so looks like it's loaded just not showing the map/tiles.

MainMap.MapType it does'nt seem to recognise so commented out.

Here's my code:

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Globalization
Imports System.IO
Imports System.Net
Imports System.Net.NetworkInformation
Imports System.Threading
Imports System.Windows.Forms
Imports System.Xml
Imports GMap.NET
Imports GMap.NET.WindowsForms
Imports GMap.NET.WindowsForms.Markers
Imports GMap.NET.WindowsForms.ToolTips

Public Class GMaps

    Public Sub New()
        MyBase.New()
        Dim latitude As Double
        Dim longitude As Double
        InitializeComponent()
        SuspendLayout()

        Dim MainMap As New GMapControl()

        'MainMap.MapType = MapType.OpenStreetMap
        MainMap.Position = New PointLatLng(53.74767, -2.48364)
        MainMap.MinZoom = 1
        MainMap.MaxZoom = 17
        MainMap.Zoom = 14
        MainMap.Dock = DockStyle.Fill

        Controls.Add(MainMap)
        ResumeLayout(False)

        Dim overlayOne As New GMapOverlay(MainMap, "OverlayOne")
        overlayOne.Markers.Add(New Global.GMap.NET.WindowsForms.Markers.GMapMarkerGoogleGreen(New PointLatLng(53.74767, -2.48364)))
        MainMap.Overlays.Add(overlayOne)

        'Or for looping thru dataset use...
        'For Each customer In Customers
        'overlayOne.Markers.Add(New GMap.NET.WindowsForms.Markers.GMapMarkerGoogleGreen(New PointLatLng(customer.Lat, customer.Long)))
        'Next

    End Sub

    Private Sub InitializeComponent()
        Throw New NotImplementedException
    End Sub

    Private Sub SuspendLayout()
        Throw New NotImplementedException
    End Sub

    Private Sub ResumeLayout(ByVal p1 As Boolean)
        Throw New NotImplementedException
    End Sub

    Private Function Controls() As Object
        Throw New NotImplementedException
    End Function

End Class

Coordinator
Oct 2, 2011 at 1:51 PM

add MainMap.MapProvider = GMapProviders.GoogleMap;

Oct 2, 2011 at 3:05 PM

That did it, plus set the app to x86 ( i'm on windows 7 ).

 

Only issue is it takes a good 10-15 seconds to load the map up, but I saw this discussion about that: http://greatmaps.codeplex.com/discussions/269467

 

So I'll try the fix stated on there.

Coordinator
Oct 2, 2011 at 3:17 PM

p.s. no need to set target to x86, all modes are supported automaticaly