MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




HELP !! Mapping a route between 2 points

This is a discussion on HELP !! Mapping a route between 2 points within the MapPoint Web Service and Virtual Earth 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint Web Service and Virtual Earth

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 12-01-2006
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....


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 12-05-2006
Junior Member
Yellow Belt
 
Join Date: Sep 2002
Posts: 20
Re: HELP !! Mapping a route between 2 points

Have you initialized the RouteService class?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 12-05-2006
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 12-06-2006
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 !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/help-mapping-route-between-2-points-5424.html

Posted By For Type Date
Map Visitors - Powered by Virtual Earth This thread Refback 12-03-2006 09:01 AM
The Magazine for MapPoint - MP2K Magazine This thread Refback 12-01-2006 12:02 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Calculating Lat/Long of Start,Stop,End points of a Route Anonymous MapPoint 2006/2009 Discussion 3 02-07-2005 12:50 PM
HELP: Adding points linkdata to a route jose luis MapPoint 2006/2009 Discussion 0 07-26-2004 01:47 PM
Route Planning (Multiple Point to Points) robertuva MapPoint 2006/2009 Discussion 1 06-15-2004 04:19 PM
Real-time route mapping using MP and GPS mgdavis MapPoint 2006/2009 Discussion 1 05-20-2004 08:19 AM


All times are GMT -5. The time now is 05:42 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Skiing in France
Skiing in France is varies hugely from place to place and is suitable for all skiers. Using a range of leading tour operators, Holiday Hypermarket can help you find cheap holidays.

City Break Europe
Take a city break in Europe. Travel Counsellors can help plan and book your European city break.

Cape Town Flight
Book a Cape Town Flight for great value when you book through dealchecker.co.uk. It doesn't take long to find the latest great deals for you.

Holidays in Dubai
Holidays in Dubai are an eclectic mix of the ancient and the modern. Discover an oasis of luxury amid the Arabian desert. Book here now!

Balearics
Before booking to the Balearics Islands make sure you check out our travel guide online. The Balearics are renowned for their vibrant nightlife but there are also some stunning Gothic cathedrals, Stone Age ruins and fishing villages.

Holiday Packages
Spoil yourself and your loved ones with one of the great Holiday Packages from Travel.co.uk.

Holidays in Florida
Take a break! Enjoy stunning coastline! Info on holidays in Florida available at On The Beach!


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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51