dcsimg
Results 1 to 3 of 3

Thread: GMAP adding route between two Coordinates

  1. #1

    Thread Starter
    Member
    Join Date
    May 2018
    Posts
    36

    GMAP adding route between two Coordinates

    Hello,
    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)

    OR

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


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

    produces:

    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

  2. #2
    New Member
    Join Date
    Dec 2018
    Posts
    2

    Re: GMAP adding route between two Coordinates

    Hi,
    I have the same problem. Did you solve the problem?

  3. #3
    New Member
    Join Date
    Dec 2018
    Posts
    2

    Re: GMAP adding route between two Coordinates

    Hi,
    I have the same problem . Did you solve the problem?

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
  •  



Featured


Click Here to Expand Forum to Full Width