Experimenting with Google Maps API

12:07 am PHT

I’ve added a beta Map page to my second blog, Tanawing Pinoy, (now named Vista Pinas). Like the original Google Sightseeing, I plan this page to be an interactive embedded map pointing to all or a subset of the featured sights from the blog.

So I’ve signed up for a Google Maps API key and I’ve tested that I can put up a static map. The next step is to tie the map with the blog database. I’m using Dean Allen’s TextPattern for the blog’s CMS (it gives me greater flexibility than WordPress). Fortunately, I’ve added the GMaps URL associated with each post in a custom field for each post.

I still deciding on a nice and clean way to extract that URL information from the database and to convert it to data that can be used by the Map’s JavaScript. I’m looking at two ways. The first possibility is to create a standalone Perl/PHP script that will access the blog’s database and output the data in JSON, or something equivalent, to be read using an XmlHttpRequest call from the Map page.

The second possibility is for me to create a private TextPattern plug-in so that I can cleanly access the database and output the Map page itself directly containing all the data. This avoids the need to have a separate XmlHttpRequest call.

Both options seem to be equally fun to do, though I’m more comfortable doing the old-fashioned scripting route. The problem with creating a plug-in is that I still need to learn a bit of TextPattern’s API. And I’ve already had experience using AJAX so the first option would be the easiest to implement. It’s even easier since I could use Google’s readily available GXmlHttp class.

It’s something that I can hack on during the weekend.  =)

Filed under , , , , , and

Add your comment | 2 comments


[an error occurred while processing this directive]