MapPoint Forums

MapForums

Community of VE/MapPoint 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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #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


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 01:07 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

Flight Deals
Book a holiday bargain online. Check out the latest fantastic flight deals. Holiday Hypermarket works with the leading Tour Operators to find the best flight deals available.

Turkey Holidays
Find great Turkey Holidays with Travel Counsellors. A personal Travel Counsellor can help you plan the perfect holiday to Turkey.

Cheap Holidays to Turkey
If you’re looking for cheap holidays to Turkey then dealchecker.co.uk is the place for you! Our search helps you see real prices from the UK’s top holiday companies all in one go.

Holidays to St Lucia
Holidays to St Lucia will leave you smiling. The spectacular scenery and the warmth of the locals make holidays to St Lucia unforgettable.

Cheap Balearics Holidays
Cheap Balearics holidays are available if you know when to book and who to book with. The Balearics have many fascinating places to visit all year round. The partying never stops.

Holiday
For the holiday of your life, that is easy to plan, visit Travel.co.uk to see all the options.

Holidays to Goa
Golden beaches, coconut trees. Visit On The Beach for holidays to Goa, and experience India!


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