将自动完成的 googleMaps 数据放入 Delphi 组合框中

发布于 2024-11-25 23:21:32 字数 185 浏览 1 评论 0 原文

我正在做一个与 GoogleMaps APi 交互的 Delphi 交通应用程序,当我输入方向的起始地址时,我想建议来自自动完成 Google 地图 API 的所有“附近”名称。

当 OnChange 属性发生更改时,所有这些都将显示在 TCombobox 中。

这可能吗???听说过吗???

多谢 格韦纳尔

I am doing a Delphi transport application interacting with GoogleMaps APi and i would like to propose all "near by" names coming from the autocomplete Google Maps API when i enter the starting adress of the direction.

All of this will be displayed in a TCombobox when would be changed on the OnChange propertie.

Is that possible ??? ever heard of it ???

Thanks a lot
Gwenael

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

禾厶谷欠 2024-12-02 23:21:32

There is a part of the Google Maps API called The Google Places Autocomplete API. You can send requests (in the examples part of the reference page there is also the example with bounds for your purpose) as you will type in your combo box (ideally after some short delay for typos corrections). As the result you can receive either JSON or XML format file. After you parse it, you will get the list of appropriate suggestions.

I'm not sure with the Google Maps API Key; if it's possible to use it in standalone application (and about the limitations) because I haven't implemented static part of the Google Maps yet.

怼怹恏 2024-12-02 23:21:32

我的第一个想法(假设一种基于远程控制 Web 界面的方法)是:这可以使用 TWebBrowser 和朋友 (IWebBrowser2、IHTMLElement 等)。请参阅我的答案 bsalsa 的嵌入式 Web 浏览器轻松访问所有 Internet Explorer 功能。

我的第二个想法是:官方 API 中可能有这方面的一部分。但这我不知道。如果没有,那么上述方法可能是一种(工作密集型)解决方法。

My first thought (assuming an approach which is based on remote controlling the web interface) was: this can be solved using TWebBrowser and friends (IWebBrowser2, IHTMLElement etc.). See my answer on this question to get a feeling for this. You could use Embedded Web Browser from bsalsa for easy access to all the Internet Explorer functionality.

My second thought was: there might be a part in the official API for this. But this I don't know. If there is none then the above approach could be a (work-intensive) workaround.

居里长安 2024-12-02 23:21:32

是的,这是可能的。

我编写了一个免费开源组件,用于实现 Google 地点自动完成和 Google 地点详细信息 API:

https:// Carbonsoft.co.za/components/

https://github.com/RynoCoetzee/TRCGPlaceAutoCompleteCombo

Yes, it's possible.

I have written a free and open source component that implements the Google Place Autocomplete and Google Place Details API's:

https://carbonsoft.co.za/components/

or

https://github.com/RynoCoetzee/TRCGPlaceAutoCompleteCombo

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文