View Single Post

  #5 (permalink)  
Old 08-23-2005
Wilfried Wilfried is offline
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,123
Hi,

Thisi is how to calc a route from an address in Delphi:

Code:
var
   RT: Route;
   Loc: Location;
   Results: FindResults;
   i: OleVariant;
begin
   RT := FMap.ActiveRoute;
   RT.Clear;
   i := 1;

   Results := FMap.FindAddressResults(Street1, Place1, '', '', PostC1, GeoCountryBelgium);
   if Results.ResultsQuality = geoNoResults then
      Exit;
   Loc := Location(Results.Item[i]);
   RT.Waypoints.Add(Loc, '');

   Results := FMap.FindAddressResults(Street2, Place2, '', '', PostC2, GeoCountryBelgium);
   if Results.ResultsQuality = geoNoResults then
      Exit;
   Loc := Location(Results.Item[i]);
   RT.Waypoints.Add(Loc, '');

   RT.Calculate;
Reply With Quote