Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 4 of 4

HELP !! Mapping a route between 2 points

This is a discussion on HELP !! Mapping a route between 2 points within the Bing Maps and MapPoint Web Service forums, part of the Map Forums category; i hope somebody can help as im tearing my hair out..... ive got the following code ( which i copied ...

  1. #1
    pbaughman is offline Junior Member White Belt
    Join Date
    Dec 2006
    Posts
    2

    HELP !! Mapping a route between 2 points

    i hope somebody can help as im tearing my hair out.....

    ive got the following code ( which i copied out of msdn MapSpecification.Pushpins Property example ) :

    'Route between two locations
    Dim latLongs(1) As net.mappoint.renderv3.LatLong
    latLongs(0) =
    New net.mappoint.renderv3.LatLong()
    latLongs(1) =
    New net.mappoint.renderv3.LatLong()
    latLongs(0).Latitude = 40
    latLongs(0).Longitude = -120
    latLongs(1).Latitude = 41
    latLongs(1).Longitude = -121
    Dim myRoute As net.mappoint.renderv3.Route
    myRoute = routeService.CalculateSimpleRoute(latLongs,
    "MapPoint.NA", net.mappoint.routev3.SegmentPreference.Quickest)
    'Get a map of the route and add pushpins to the start and end
    Dim myRouteViews(0) As net.mappoint.renderv3.ViewByHeightWidth
    myRouteViews(0) = myRoute.Itinerary.View.ByHeightWidth
    Dim myPushpins(1) As net.mappoint.renderv3.Pushpin
    myPushpins(0) =
    New net.mappoint.renderv3.Pushpin()
    myPushpins(0).IconDataSource =
    "MapPoint.Icons"
    myPushpins(0).IconName = "31"
    myPushpins(0).Label = "Start"
    myPushpins(0).LatLong = latLongs(0)
    myPushpins(1) =
    New net.mappoint.renderv3.Pushpin()
    myPushpins(1).IconDataSource =
    "MapPoint.Icons"
    myPushpins(1).IconName = "29"
    myPushpins(1).Label = "End"
    myPushpins(1).LatLong = latLongs(1)

    mapSpec.DataSourceName = "MapPoint.NA"
    mapSpec.Route = myRoute
    mapSpec.Pushpins = myPushpins
    mapSpec.Views = myRouteViews
    Dim myMaps() As net.mappoint.renderv3.MapImage
    myMaps = renderService.GetMap(mapSpec)

    *******************************************

    my main problem is with the following line :

    Dim myRoute As net.mappoint.renderv3.Route
    myRoute = routeService.CalculateSimpleRoute(latLongs,
    "MapPoint.NA", net.mappoint.routev3.SegmentPreference.Quickest)

    it doesnt seem to like the "latlongs" argument. it says its supposed to be a ROUTE instead of being a RENDER variable. however, ive already tried this and if i change it. then the latlong entry in the myPushPin says it doesnt like it as its now a ROUTE variable and not a RENDER....

    PLEASE PLEASE PLEASE, CAN ANYBODY HELP ? im very new to mappoint web services....



  2. #2
    shaistasohail is offline Junior Member Yellow Belt
    Join Date
    Sep 2002
    Posts
    20

    Re: HELP !! Mapping a route between 2 points

    Have you initialized the RouteService class?

  3. #3
    shaistasohail is offline Junior Member Yellow Belt
    Join Date
    Sep 2002
    Posts
    20

    Re: HELP !! Mapping a route between 2 points

    Ooops! Hit submit too soon!

    Have you initialized the route service class? Also can you post the error message that your are getting.

  4. #4
    pbaughman is offline Junior Member White Belt
    Join Date
    Dec 2006
    Posts
    2

    Smile Re: HELP !! Mapping a route between 2 points

    thanks for your reply to my problem. it looks like that the problem was that i had not connected to the web service properly. thanks anyway, its much appreciated !

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calculating Lat/Long of Start,Stop,End points of a Route
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 02-07-2005, 01:50 PM
  2. HELP: Adding points linkdata to a route
    By jose luis in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 07-26-2004, 02:47 PM
  3. Route Planning (Multiple Point to Points)
    By robertuva in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-15-2004, 05:19 PM
  4. Real-time route mapping using MP and GPS
    By mgdavis in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-20-2004, 09:19 AM

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
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36