Results 1 to 3 of 3

Thread: GMAP adding route between two Coordinates

Threaded View

  1. #1

    Thread Starter
    Join Date
    May 2018

    GMAP adding route between two Coordinates

    following on from adding markers in GMAP control on VB form, I'm trying to make a route between two points along road. The route i think comes back as NULL. And i get Exception,
    "Object reference not set to an instance of an object"

    finish = New PointLatLng(mLat, mLong)
    PostCodeToLongLat(msPostCode, "GB", CarLocation)
    start = New PointLatLng(CarLocation.mdLatitude, CarLocation.mdLongitude)

    route = GMap.NET.MapProviders.GoogleMapProvider.Instance.GetRoute(start, finish, False, False, 15)

    Searched and many people have this question, but the closest to an answer is :

    Dim ss As GMapProviders.GoogleMap.GetDirections
    GMapRoute r = New GMapRoute(ss.Route, "My route")

    But Get Directions is unknown, is it missing a reference?

    This also returns same error

    route = GMap.NET.MapProviders.GoogleMapProvider.Instance.GetRoute("broadway, new york city", "15th street, new york city", False, False, 15)


    route = GMap.NET.MapProviders.BingMapProvider.Instance.GetRoute(start, finish, False, False, 15)]

    route = GMap.NET.MapProviders.OpenCycleMapProvider.Instance.GetRoute(start, finish, False, False, 15)


    Unable to cast object of type 'GMap.NET.MapRoute' to type 'GMap.NET.WindowsForms.GMapRoute'.
    Last edited by SamCam15; Aug 23rd, 2018 at 10:35 AM. Reason: wrong bit

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width