Einzelnen Beitrag anzeigen

champagner

Registriert seit: 29. Apr 2008
46 Beiträge
 
Delphi XE6 Professional
 
#1

Google Maps einbinden

  Alt 8. Jun 2014, 11:12
Hallo,

ich möchte eine sehr einfache App schreiben:

1. Auf Button1.Click soll sich Google Maps laden und meine aktuelle Position anzeigen.
2. GLEICHZEITIG soll genau diese Google Maps Karte 3 von mir definierte Marker anzeigen (also interessante Orte, die in der Nähe meiner aktuellen Position liegen).
3. Ich kann nur Delphi, nicht Java, würde aber selbstredend versuchen, mich in ein Skriptbeispiel einzuarbeiten.

Mein Code bisher (anzeigen der aktuellen Position), Code aus Tutorial:

Code:
procedure TForm2.LocationSensor1LocationChanged(Sender: TObject;
  const OldLocation, NewLocation: TLocationCoord2D);
  var
    URLString: String;
    URLLoadFile : TStringList;
begin
Label3.Text:= Format('%2.6f', [NewLocation.Latitude]);
Label4.Text:= Format('%2.6f', [NewLocation.Longitude]);

URLLoadFile := TStringList.Create;
URLLoadFile.Add('<iframe');
URLLoadFile.Add(' width="' + WebBrowser1.Width.ToString + '"');
URLLoadFile.Add(' height="' + WebBrowser1.Height.ToString + '"');
URLLoadFile.Add(' frameborder="0" style="border:0"' );

//URLLoadFile.Add('src=' + Format('https://maps.google.com/maps?q=%s,%s&output=embed',[Format('%2.6f', [NewLocation.Latitude]), Format('%2.6f', [NewLocation.Longitude])]) + '>');
URLLoadFile.Add('src=' + 'https://maps.google.com/maps?q=48.903875,9.205123&output=embed' + '>');


URLLoadFile.Add('</iframe>');
URLLoadFile.SaveToFile( 'sdcard/URLLoadFile.html');
// Show Map using Google Maps
URLString := 'file://sdcard/URLLoadFile.html';
Label5.Text := Format('https://maps.google.com/maps?q=%s,%s&output=embed',[Format('%2.6f', [NewLocation.Latitude]), Format('%2.6f', [NewLocation.Longitude])]);


WebBrowser1.Navigate(URLString);
//WebBrowser1.Navigate('https://maps.google.com/maps?q=48.903875,9.205123&output=embed');


URLLoadFile.Free;

end;

Wie bekomme ich jetzt die Marker in die Maps?


Herzlichen Dank!
  Mit Zitat antworten Zitat