Error 1 'Instance' is not a member of 'GMaps'.

Feb 23, 2010 at 2:53 PM

Hi Can Anyone help please i am trying add this code to vb windows.form.application

i keep getting this error message

'Instance' is not a member of 'GMaps'.

can anyone tell me what i am missing to make this work

 

Imports System.Globalization
Imports GMap.NET
Imports GMap.NET.WindowsForms
Imports GMap.NET.WindowsForms.Markers
Imports System.Windows.Forms.PaintEventArgs


Public Class TruckRoutes

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


        '*********************************************************************************************************************

        Dim g1 As GMap.NET.PointLatLng = New PointLatLng(-27.227463, 153.105769)
        mainmap.CurrentPosition = g1
        Dim g2 As GMap.NET.PointLatLng = New PointLatLng(-27.403776, 153.164713)
        Dim route As MapRoute
        Dim r As GMapRoute
        Dim routes As GMapOverlay
        route = GMaps.Instance.GetRouteBetweenPoints(g1, g2, False, mainmap.Zoom)

        r = New GMapRoute(route.Points, route.Name)
        r.Color = Color.Blue
        routes = New GMapOverlay(mainmap, "routes")
        mainmap.Overlays.Add(routes)

End Sub


End Class

Coordinator
Feb 23, 2010 at 5:13 PM

try use mainmap.Manager