I forgot to show the code currently in use for my map:

var dirn = new GDirections(map);
function onGDirectionsLoad()
{  if (dirn.getNumRoutes() > 0)
  {
    external.NewDirections();
    /* set option preserveViewport because it does not zoom correctly
in the TWebBrowser */
    map.setCenter(dirn.getRoute(0).getStep(0).getLatLng());
  }

  var route = "";
  var geocode = "";
  for (var i=0; i < dirn.getNumRoutes(); ++i)
  {
    route = dirn.getRoute(i);
    geocode = route.getStartGeocode();
    var point = route.getStep(0).getLatLng();

    external.AddWaypoint(point.toUrlValue(6), geocode.address,
route.getDistance().html, route.getDuration().html);

    for (var j=0; j < route.getNumSteps(); ++j)
    {
      var step = route.getStep(j);

      var latlng = "";
      var descr  = "";
      var dist   = "";

      if (step.getLatLng())
        latlng = step.getLatLng().toUrlValue(6);
      if (step.getDescriptionHtml())
        descr  = step.getDescriptionHtml();
      if (step.getDistance())
        dist   = step.getDistance().html;

      external.AddStep(latlng, descr, dist);
    }
  }

  geocode = route.getEndGeocode();
  external.AddWaypoint(route.getEndLatLng().toUrlValue(6),
geocode.address, "", "");

  external.CopyRight(dirn.getCopyrightsHtml());
}
GEvent.addListener(dirn, "load", onGDirectionsLoad);
dirn.load("%directions", {getSteps:true,preserveViewport:false});


On Mar 23, 7:55 am, d98rolb <[email protected]> wrote:
> I have done a Delphi application that call Google maps API. The
> javascript code is below. Now I want to add the same behaviour 
> ashttp://maps.google.com. How can I add code so the user can add
> waypoints, grab a point on the route with mouse and add a place where
> the route must pass.
>
> Regards Roland
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to