Community of MapPoint and Virtual Earth Users and Developers
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 ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| add two waypoints and calculate route with Delphi Jim |
| |||
|
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; |
| |||
|
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 |
![]() |
| Tags |
| add, calculate, delphi, route, waypoints |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |
Dalaman Holiday
Enjoy a wonderfully peaceful Dalaman holiday... Book through UlookUbook and save!