Has anyone had any success getting StreetView to display in a TWebBrowser control?
I want to build a Url programmatically and have it display in a simple Delphi form.
Here's what I have so far for that form:
unit frmSView;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw, StdCtrls;
type
TfrmStreetView = class(TForm)
browserStreetView: TWebBrowser;
txtAddress: TEdit;
procedure txtAddressExit(Sender: TObject);
procedure ShowSV(Lat: string; Lon: string);
private
// private declarations
public
// public declarations
end;
var
frmStreetView: TfrmStreetView;
implementation
{$R *.dfm}
procedure TfrmStreetView.ShowSV(Lat: string; Lon: string);
var
Addr: string;
Flags: OleVariant;
begin
Addr := 'http://maps.google.com/maps?q=&&layer=c&&cbll=' + Lat + ',' + Lon + '&&cbp=12,0,0,0,0&&output=svembed';
browserStreetView.Navigate(Addr, Flags, Flags, Flags, Flags);
txtAddress.Text := Addr;
ShowModal;
end;
procedure TfrmStreetView.txtAddressExit(Sender: TObject);
var
Flags: OleVariant;
begin
browserStreetView.Navigate(txtAddress.Text, Flags, Flags, Flags, Flags);
end;
end.
When the form shows:
- if there is no street view information at that location, I get a regular map view.
- If there is street view information (verified in another browser window), it just displays a grey screen.
I'm guessing that the Flash player is not loading.
Do you guys have any ideas?
Regards,
Simon