AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Projekte Google Maps über COM (Component Object Model)
Thema durchsuchen
Ansicht
Themen-Optionen

Google Maps über COM (Component Object Model)

Ein Thema von Thom · begonnen am 23. Dez 2010 · letzter Beitrag vom 22. Mai 2022
 
Alter Mann

Registriert seit: 15. Nov 2003
Ort: Berlin
948 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#32

AW: Google Maps über COM (Component Object Model)

  Alt 6. Okt 2017, 18:02
Hallo,

mir ist schon klar das Thom seit geraumer Zeit nicht mehr Online ist, aber eventuell kann jemand helfen.
Ich habe eine csv-datei mit ca. 570 Werten, von diesen möchte ich screenshots machen, doch es scheiter schon an:
Code:
https://www.google.de/maps/@51.1758057,10.4541194,6z
Es wird ein Script-Fehler generiert(Siehe Grafik). Da auf einen 'externalen OnApiLoaded' verwiesen wird,
scheint es hier einen Fehler zu geben:
Delphi-Quellcode:
...
procedure TForm1.GeoListViewDblClick(Sender: TObject);
begin
  FCurrentIndex := GeoListView.ItemIndex;
  RunTimer.Enabled := ((GeoListView.Items.Count > 0) and (FScreenShotPath <> EmptyStr));
end;

procedure TForm1.ItsTime(Sender: TObject);
begin
  RunTimer.Enabled := False;
  if Script=nil then
    with TScript.Create(WebBrowser1) do
      LoadAPIAsync(InitMap);
end;

procedure TForm1.InitMap(Sender: TObject);

  function StrToDouble(Value : String) : Double;
  begin
    Result := StrToFloat(StringReplace(Value, '.', ',', [rfReplaceAll, rfIgnoreCase]));
  end;

var
  MyOptions : TMapOptions;
  LI : TListItem;
  Latitude : Double;
  Longitude : Double;
  ZoomF : Integer;
  TypeID : Byte;
  Url : String;
begin
  LI := GeoListView.Items[FCurrentIndex];
  if ((LI.SubItems[3] = EmptyStr) and // Latitude
      (LI.SubItems[4] = EmptyStr) and // Logitude
      (LI.SubItems[5] = EmptyStr)) then // Zoom
  begin
    Url := Copy(LI.SubItems[0], POS('@', LI.SubItems[0]) + 1, Length(LI.SubItems[0]));
    Latitude := StrToDouble(Copy(Url, 1, POS(',', Url) - 1));
    Url := Copy(Url, POS(',', Url) + 1, Length(Url));
    Longitude := StrToDouble(Copy(Url, 1, POS(',', Url) - 1));
    Url := Copy(Url, POS(',', Url) + 1, Length(Url));
    ZoomF := Round(StrToDouble(Copy(Url, 1, POS('z', Url) -1)));
  end
  else
  begin
    Latitude := StrToDouble(LI.SubItems[3]);
    Longitude := StrToDouble(LI.SubItems[4]);
    ZoomF := Round(StrToDouble(Copy(LI.SubItems[5], 1, POS('z', LI.SubItems[5]) -1)));
  end;
  TypeID := Ord(LI.SubItems[6][1]);

  with TScript(Sender) do
  begin
    MyOptions := TMapOptions.Create;
    with MyOptions do
    begin
      Zoom := ZoomF;
      Center := New(Google.Maps.LatLng(Latitude, Longitude));
      case TypeID of
        72 : MapTypeID := Google.Maps.MapTypeID.Hybrid;
        82 : MapTypeID := Google.Maps.MapTypeID.Roadmap;
        83 : MapTypeID := Google.Maps.MapTypeID.Satellite;
        84 : MapTypeID := Google.Maps.MapTypeID.Terrain;
      end;
    end;
    New(Google.Maps.Map(MyOptions));
  end;
end;
Achso, die csv-datei wird in eine ListView(Report) geladen und durch Doppelclick der Timer gestartet,
der FEATURE_BROWSER_EMULATION Eintrag ist vorhanden.

Wie müsste ich es anders machen?
Miniaturansicht angehängter Grafiken
Scripfehler1.png  
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

(?)

LinkBack to this Thread

Erstellt von For Type Datum
DELPHI | (google maps) This thread Refback 11. Nov 2011 09:07
Twebbrowser HTML tag to UniHTMLFrame1 - uniGUI Discussion Forums This thread Refback 4. Nov 2011 06:52
DoraDev1975: google maps This thread Refback 23. Sep 2011 08:18
delphi osm - Google Search Post #0 Refback 19. Sep 2011 09:02
DoraDev1975: ?&#3636;????? 2011 This thread Refback 11. Sep 2011 16:39
DoraDev1975 This thread Refback 30. Aug 2011 10:13
Untitled document This thread Refback 25. Jun 2011 19:57
Interact with Google Maps in a TWebBrowser from Delphi | Ramblings This thread Refback 26. Jan 2011 05:12
google maps mit delphi link - Google Search This thread Refback 24. Jan 2011 14:24
google maps mit delphi - Google Search This thread Refback 24. Jan 2011 14:20
Untitled document This thread Refback 19. Jan 2011 21:49

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:03 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz