MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




add two waypoints and calculate route with Delphi

This is a discussion on add two waypoints and calculate route with Delphi within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I would like some sample code in Delphi to Add two route waypoints and calculate the route. I have seen ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-21-2003
Junior Member
White Belt
 
Join Date: Jun 2003
Posts: 8
add two waypoints and calculate route with Delphi

I would like some sample code in Delphi to Add two route waypoints and calculate the route. I have seen a couple of samples but can't get it to work. Please post the complete procedure including the Var section, I am new to MapPoint.
Jim
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 06-23-2003
Member
Green Belt
 
Join Date: Nov 2002
Posts: 52
Perhaps this helps:

procedure CalculateDistance(dblLonFrom:double; dblLatFrom:double; dblLonTo:double; dblLatTo:double;var KM:double; var ZEIT:double);
var
aFromLocation:Location;
aToLocation:Location;
aRoute: Route;
begin
if (MPApplication=NIL) then
exit;

aFromLocation:=MPApplication.ActiveMap.GetLocation (dblLatFrom, dblLonFrom, 0.0);
aToLocation:=MPApplication.ActiveMap.GetLocation(d blLatTo, dblLonTo, 0.0);

Screen.Cursor := crHourGlass;

aRoute:=MPApplication.ActiveMap.ActiveRoute;
aRoute.Clear;
aRoute.Waypoints.Add(aFromLocation,'S');
aRoute.Waypoints.Add(aToLocation,'E');

aRoute.Calculate;

KM:=aRoute.Distance;
Zeit:=aRoute.DrivingTime;

Screen.Cursor := crDefault;
end;
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 06-23-2003
Junior Member
White Belt
 
Join Date: Jun 2003
Posts: 8
Thanks, sample using street address's?

Thank you for the reply. Using Lat and Long. works perfectly. Do you have an example using street addresses?
Jim
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 06-24-2003
Member
Green Belt
 
Join Date: Nov 2002
Posts: 52
I wrote my own geocoding routines by using FindAddress, because I found the results of FindAddress sometimes very bad. You can download the program for geocoding from MP-magazine.

Then I put the coordinates in my database and make distance calculations this way.

So I didn't have a simple example.

Rainer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 06-24-2003
Junior Member
White Belt
 
Join Date: Jun 2003
Posts: 8
MapPoint Route with Delphi

Rainer: I have the route working. Thanks to your help, I had the information I needed to do the rest of it.
Regards,
Jim
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

Tags
add, calculate, delphi, route, waypoints


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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Generate intermediate waypoints from a route - how? Gizz MapPoint Web Service and Virtual Earth 3 07-09-2007 07:23 AM
Delete Numerator from waypoints when i draw a route Genamo MapPoint 2006/2009 Discussion 0 02-23-2006 03:18 AM
How to hide waypoints in a route? Anonymous MapPoint 2006/2009 Discussion 1 08-06-2004 08:46 AM
How do I calculate a route distance without displaying route spideybud MapPoint 2006/2009 Discussion 4 09-09-2003 10:14 AM
Converting a route to waypoints Anonymous MapPoint 2006/2009 Discussion 3 06-04-2003 12:27 PM


All times are GMT -5. The time now is 02:49 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Dalaman Holiday
Enjoy a wonderfully peaceful Dalaman holiday... Book through UlookUbook and save!



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 52 53 54 55 56 57 58 59