gpt4 book ai didi

delphi - Delphi 2009 应用程序中的谷歌地图

转载 作者:行者123 更新时间:2023-12-01 16:05:02 27 4
gpt4 key购买 nike

在这个项目中,我的目标是在 Delphi 2009 中通过 GoogleMaps 创建一个软件,它会像 this one但以不同的方式。在这个项目中,用户可以在 map 上添加一个点,在图标旁边的每个点上,我都会添加一些信息,这些信息应该与图标相关,所以如果用户想点击其中一个,信息将自动打开.我的问题是我可以创建信息,但是当我关闭它时,我无法再次打开它。我该如何管理这个问题,我的代码如下,非常感谢。

  procedure TfrmMain.btnAddMarkerClick(Sender: TObject);
var
Doc2: IHTMLDocument2;
Win2: IHTMLWindow2;
latlng: String;
information: String;
begin
Doc2 := WebBrowser1.Document as IHTMLDocument2;
Win2 := Doc2.parentWindow;
information:='its a example';
latlng := '"' + leLat.Text + '", "' + leLng.Text + '"';

Win2.execScript('map.addOverlay(new GMarker(new GLatLng(' + latlng + ')) );', 'JavaScript');
Win2.execScript('map.openInfoWindow(new GLatLng(' + latlng + '),document.createTextNode("'+information +'"));','JavaScript');

end;

设计如下:
alt text http://img829.imageshack.us/img829/8474/adszdi.png

最佳答案

@asilloo,Google map API 不保存您的标记,此信息仅在浏览器的当前 session 中有效,如果您需要保留(存储)标记,您必须自己手动完成,您可以使用数据库或xml 文件。我建议你使用 KML 此任务的格式。

关于delphi - Delphi 2009 应用程序中的谷歌地图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3302088/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com