This code and sample application demonstrates how Google maps flash api could be integrated in Borland Delphi application. It reads GPS coordinates from log file and shows the position update in map. Here you can see two side interaction of Delphi with Flex flash.
procedure TForm1.ShockwaveFlash1FSCommand(ASender: TObject; const command,
args: WideString);
var
s:WideString;
begin
if command = 'Click' then
begin
Edit1.Text:=Copy(args,1,pos(';',args)-1);
Edit2.Text:=Copy(args,pos(';',args)+1,length(args)-pos(';',args));
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ShockwaveFlash1.CallFunction('
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
path:=OpenDialog1.FileName;
AssignFile(f,path);
Reset(f);
end;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
if Button5.Caption='Play' then
begin
Button5.Caption:='Stop';
Timer1.Enabled:=true;
end
else
begin
Button5.Caption:='Play';
Timer1.Enabled:=false;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
latlon,s,lat,lon:string;
begin
if (Eof(f)=true) then
Timer1.Enabled:=false
else
begin
readln(f,s);
latlon:=copy(s,2,pos(']',s)-4);
lon:=copy(s,2,pos(',',latlon)-1);
delete(latlon,1,pos(',',latlon));
lat:=latlon;
Edit1.Text:=lat;
Edit2.Text:=lon;
ShockwaveFlash1.CallFunction('
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if (OpenDialog1.FileName<>'') then
CloseFile(f);
end;
procedure TForm1.SpinEdit1Change(Sender: TObject);
begin
ShockwaveFlash1.CallFunction('
end;
gps tracking demo delphi - google flash maps api