delphi+openstreetmap

发布于 2024-08-19 10:09:41 字数 92 浏览 5 评论 0原文

是否有 vcl 或项目(delphi 中)允许我下载 OSM 切片并将其显示在应用程序上?

我尝试过嵌入浏览器,效果很好,但我需要一种离线显示地图的方法。

is there a vcl or a project (in delphi) that would allow me to download OSM tiles and display them on an app?

I have tried embedding an browser and it worked great but i need a way to display the maps offline.

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

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

发布评论

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

评论(5

浮生未歇 2024-08-26 10:09:42

在我看来,有 3 种方法可以做到这一点:

最好的问候,
莫3ez

As I see it, there is 3 ways to do this :

Best Regards,
Mo3ez

小耗子 2024-08-26 10:09:42

我不太了解 OpenStreetMap 项目,但该项目本身可能有软件来“查看”页面内的地图。

您可以实现您的目标:使用您现在的用户界面相同的基本结构(嵌入式浏览器)离线显示地图。

您更改的是浏览器将连接到的 url,例如 (http://localhost:3458),使您的应用程序自己的 Web 服务器,例如,将 Indy TIdHTTPServer 绑定到端口 3458(仅是示例端口)。

这样,您就可以从应用程序内部为嵌入式浏览器提供内容,以同样的方式Delphi IDE (>= 2005) 本身为嵌入式浏览器提供内容。当您启动它时您会看到>主页(实际上是一个嵌入式网络浏览器)。

对于该浏览器,您提供查看器页面、其所有依赖项和 OSM 文件。这个想法的唯一限制是查看器必须在客户端执行所有操作(例如,可以是 javascript、flash 等)。没有服务器端脚本,除非您愿意“模仿”服务器端行为或将您的应用程序与脚本引擎集成(不太容易)。

另一个机会是使用 THBImage,它提供 OpenStreetMap 与 Delphi 集成 和一个(不工作的)站点演示。

I don't know the OpenStreetMap project very well, but there's a chance that the project itself has the software to "view" the maps inside a page.

You can accomplish your goal: show the maps off-line using the same basic construct you have now for the user interface: a embedded browser.

What you change is the url the browser will connect to to something like (http://localhost:3458), making your application her own web-server, for example, with Indy TIdHTTPServer binded to port 3458 (just an example port).

That way, you can serve the content for the embedded browser from inside your application, in the same way Delphi IDE (>= 2005) itself provides content for the main page you see when you start it (in fact, a embedded web browser).

To that browser, you serve the viewer page, all it's dependencies and the OSM file. The only restriction to this idea is the viewer MUST do all the things on the client side (for example, it could be javascript, flash, etc.). No server side scripts, unless you are willing to "mimic" the server side behavior or to integrate your application with the script engine (not too easy).

Other chance is to use THBImage, who offers OpenStreetMap integration with Delphi and a (not working) site demo.

╰◇生如夏花灿烂 2024-08-26 10:09:42

哎呀!我尝试在消息中提供一些超链接,但作为 StackOverflow 新用户,我只能提供一个。您可以查看“需要显示地图的解决方案”消息线程(2010 年 1 月 25 日):embarcadero.public.delphi.thirdpartytools.general

我正在尝试解决类似的问题。我需要使用 Delphi 显示全县范围或全市范围的地图,然后在地图上放置自定义图标。我不需要路线或非常详细的地图。过去,我使用 TMS“热点”组件作为 TImage 顶部的自定义图标。现在我需要一种方法让客户为静态背景图像选择自己的地图。

一个免费软件 MFC GUI 控件类(带源代码),实现 OpenStreeMap 图块的显示:
www.naughter.com/osmctrl.html
那里的 zip 文件有一个可执行文件,显示了它是如何工作的。

该单元用于计算 OpenStreetMap 项目的 TileServer 的 URL 以及可能需要的其他有用实用程序。如果您想在 pascal 程序中使用 OpenStreetMap,那么这适合您。
http://code.google.com/p/openstreetmap-fpk/

我我还在考虑使用免费的 Tiger/Line 地图。这些在免费的 Linux 程序 (xastir) 中看起来相当不错。

TatukGIS 看起来非常好(而且很贵)。我当然不需要完整的 GIS 解决方案,因此仅仅显示地图似乎有点过分了。但如果我找不到更简单的解决方案,这可能仍然比集成 MS MapPoint 更好。

TGlobe 似乎是我所需要的,但遗憾的是它不再可用。

Oops! I tried to provide a few hyperlinks in my message but as a new StackOverflow user I'm limited to just one. You might checkout the "Need solution to display map" message thread (25-Jan-2010) on: embarcadero.public.delphi.thirdpartytools.general

I'm trying to solve a similar problem. I need to display a county-wide or city-wide map using Delphi and then put custom icons on the map. I do not need routing or a very detailed map. In the past I've used a TMS "hotspot" component for the custom icons on top of a TImage. Now I need a way for the client to select their own map for the static background image.

A freeware MFC GUI control class (with source) which implements display of OpenStreeMap tiles:
www.naughter.com/osmctrl.html
The zip there has an executable that shows how it works.

This unit is to calculate URLs for the OpenStreetMap Project's TileServer, and other useful utilities as may be needed. If you want to use OpenStreetMap in your pascal programs, then this is for you.
http://code.google.com/p/openstreetmap-fpk/

I'm also considering using the free Tiger/Line maps. Those look pretty good in a free Linux program (xastir).

TatukGIS looks very good (and expensive). I certainly don't need a full GIS solution so this seems to be way overkill just to display a map. But if I don't find a simpler solution this still might be better than integrating MS MapPoint.

TGlobe seems like what I need but sadly it is no longer available.

春夜浅 2024-08-26 10:09:42

查看 StelMAP for Delphi with OSM

组件,无需使用浏览器或脚本即可查看项目 OpenStreetMap for Delphi 2010 的地图。

您可以离线查看地图。支持在线工作的代理服务器。多线程加载瓦片地图可加快下载和查看地图的过程。
这组过程和属性允许您添加组件来映射无限数量的图层、形状和图像。

look in StelMAP for Delphi with OSM

Component to view a map of the project OpenStreetMap for Delphi 2010 without using browser or scripts.

You can view maps offline. Support for proxy servers for work online. Multi-threaded loading tile map speeds up the process to download and view maps.
The set of procedures and property allows you to add a component to map an unlimited number of layers, shapes and images.

秋意浓 2024-08-26 10:09:42

不了解 OSM 文件,但如果您可以在浏览器中打开它们,则始终可以在 Delphi 应用程序中嵌入 TWebBrowser 并加载其中的文件。
不是最优雅的,但应该可以...(需要 IE)

Don't know about OSM files, but if you can open them in a browser, you can always embed a TWebBrowser in your Delphi application and load the files within it.
Not the most elegant, but should work...(requires IE)

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