English 中文(简体)
delphi+openstreetmap
原标题:

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.

问题回答

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

Best Regards, Mo3ez

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.

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.

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.

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)





相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签