WebGMaps Routing

Hello
How to do your own routing on the WebGMaps component. I have addresses in the database. After loading using the WebGMaps1 method. MapPanTo (WebGMapsGeocoding1.ResultLatitude, WebGMapsGeocoding1.ResultLongitude) does not want to show up the path. WebGMapsGeocoding1 returns the correct result.

The user can not mark the route points himself.


How to solve the problem?

My code: 


procedure Tf_mapy.FormShow(Sender: TObject);
begin
  WebGMaps1.Launch;
end;

procedure Tf_mapy.Button1Click(Sender: TObject);
begin
  WebGMapsGeocoding1.Address := Edit1.Text;   
  // move map if coordinated are determined
  if WebGMapsGeocoding1.LaunchGeocoding = TGeocodingResult.erOk then
  begin
    WebGMaps1.MapPanTo( WebGMapsGeocoding1.ResultLatitude, WebGMapsGeocoding1.ResultLongitude );
  end;
end;

There are basically three approaches for showing routes in WebGMaps


1) Use WebGmaps.GetDirections() with the source & destination address or source & destination geo coordinates to fill the list of possible directions WebGmaps.Directions and then show the resulting path on the map.
This is shown in the WebGMapsDirectionDemo

2) Use WebGMaps.RenderDirections() to directly draw the best route from source to destination

3) Step by step calculating & adding routes. This is shown in the demo WebGMapsRoutingDemo

Thanks,


Can I make a route for 3, 4 or more points? Can I ask for an example in Delphi.

In the WebGMapsDirectionDemo you can see how Waypoints are used for this.

Thanks :)

So, it doesn't work for Delphi2007! Wierd!

Hi,


Unfortunately the directions functionality is only supported in Delphi XE or newer due to technical limitations of the Delphi IDE in earlier versions.

As indicated on the product page:
https://www.tmssoftware.com/site/webgmaps.asp