I use TGMDirection to show routes between two markers I click on. It is the same idea like here, but in Delphi using GMLib 1.8: http://www.geocodezip.com/inventoresdegaragem_com_dbteste_indexB.html
First Direction It shows without any error. When I click again on another marker it pop up and Script error: Line: 539 Characters: 9 Error: Can not retrieve the value of the property close: object is null or undefined Code: 0 URL: about: blank
Do you have any Idea ? The code I use is:
procedure TForm1.GMMarker1DblClick(Sender: TObject; LatLng: TLatLng;
Index: Integer; LinkedComponent: TLinkedComponent);
begin
if legcount = 0 then
begin
marker1index :=Index;
legcount:=legcount+1;
end
else if legcount = 1 then
begin
legcount:=0;
marker2index :=Index;
GMDirection1.DirectionsRequest.Origin.LatLng := GMMarker1.Items[marker1index].Position;
GMDirection1.DirectionsRequest.Destination.LatLng := GMMarker1.Items[marker2index].Position;
GMDirection1.Execute;
if GMDirection1.DirectionsResult[routenr].Status = dsOK then
begin
GMDirection1.Free;
end;
routenr:=routenr+1;
end;
end;