February 3, 2012

Delphi Mapping REST Clients

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.

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.

GeoCoding

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. 





 

4 Comments

Delphi Mapping REST Clients 

 Very good thank you
Comment by Savério Vertoni [http://saveriovertoni.wordpress.com] on February 4, 01:14

Delphi Mapping REST Clients 

Hi, 

I see that this library still uses version 2 of the 
Google Maps API, which has been deprecated a while 
ago.

I've upgraded the HTML to google maps v3, and changed 
the data exchange format from xml to json..

With Maps API v3, you don't need to sign up as a 
developer, and you don't need any key. That keeps the 
example a lot simpler for anyone who wants to play 
with this.

How do I submit the changes? Can I just commit 
anonymously via svn?
Comment by Wouter van Nifterick on February 4, 13:03

Delphi Mapping REST Clients 

 Thank you very much for that 
Comment by Andre Jansen [http://www.compunet.co.za] on February 4, 13:03

Delphi Mapping REST Clients 

Wouter, thanks a lot. I din't check the API recently... 
they keep changing, of course. I guess it would better 
to spin off a separate project, given the differences 
(it is not just bug fixing).

In terms of posting, I can give you svn permissions 
(anonymous cannot commit) after you create an account on 
the code site. Or you can mail the code and I'll post it 
for you...
Comment by Marco Cantu [http://www.marcocantu.com] on February 4, 14:37


Post Your Comment

Click here for posting your feedback to this blog.

There are currently 0 pending (unapproved) messages.