I've finally posted on my public Subversion repository devoted to Delphi REST clients two of my geo-coding and mapping demos, and particularly the Google Maps Delphi client.


The first is rather simple Geocoding applications, returning the latitude and longitude of a given city you enter or of all the cities in the classic customers.cds database. Code at http://code.marcocantu.com/p/delphirestclients/source/tree/HEAD/GeoLocation.

Maps in a Windows Application

The second starts with the same data, but lays it out graphically on a map, as you can see below. It embeds the Geocoding code to create a list of cities and positions, but it also creates a fully working Google Map (not a static image) customized with the positions of the various customers in the database table. Since Google Maps is browser based, the Delphi application embeds a TWebBrowser, but rather than connecting to an external web server, it embeds one. The application is a Web client that uses itself as a server, passing a fixed HTML file and a dynamic XML file with the data taken from the DbGrid and its dynamic ClientDataSet.  

Both applications require to sign up on Google, create a developer id, and add it to an INI file named like the program itself in the user's home folder (or "AppData\Roaming"). 

How to get it?

Since I've been showing this application for a long time, I should have posted it before, thanks to a Delphi developer who asked me the code over email the other day. You won't guess how many people keep asking me the source code for this very old blog post of the same program, which has some of the description. Full source code at  http://code.marcocantu.com/p/delphirestclients/source/tree/HEAD/GoogleMappingDemo.

The command for getting all of the REST clients is:

svn co -r HEAD http://code.marcocantu.com/svn/marcocantu/delphirestclients

Want to Contribute?

Finally, this repository is open for contribution: if you have Delphi applications connecting to the web for getting data and that can be considered REST clients, you are more than willing to share the code over my repository, keeping full credit and copyrights (but making the code available for free, of course). Similarly, if you have any suggestion, correction, or improvement, feel free to comment on the code site, here on this blog, or send me an email.