Select Page

GMaps PHP version 1.1

The sample data provided with my 1.0 release of GMaps PHP had a mistake in the config file which rendered the sample useless.
I’ve fixed this and also added a <comment> tag to the XML data file that will be shown at the locations. A full valid point in the XML file now looks like this:

<point>
<lat>-34.01715</lat>
<long>23.07238</long>
<type>visit</type>
<title>Knysna</title>
<country>South Africa</country>
<comment>Holiday during school years</comment>
</point>

The new version can be found here, full documentation including these changes can be found here.
Thanks to BJE for pointing this out.

Google, IM and GMail

So everyone knows Google released their IM System today based on Jabber. The client is a bit low on features and the audio isn’t great.
More on this when they start talking with more jabber servers, till then it’s Just Another Jabber Server. I want to run a corporate Jabber server with my own security policy and encrypted links, but people should have the option to speak to Google Talk users etc if they wish.
What’s more interesting is that they’ve recently allowed you to set your own From address on gmail, this is great news and something I would have thought would get more press.
Just click Settings -> Accounts and there should be an option to add more From addresses.
If you then compose a mail you get to choose the From address. It is pretty nifty but does not change the envelope address, just the From header so its not 100% ideal but I can understand why they did it that way.
One step closer to being able to use gmail as a primary mail interface.

Google Maps and PHP

I’ve kept a map of my travels since around 1999, I used to use the now defunct PARC Xerox Map Viewer, when that went away I started just projecting dots onto XPlanet maps to produce a static map.

Ever since Google introduced their Google Maps system a number of mapping tools became available, dedicated blogs have been written like the very good Google Maps Mania and I’ve been thinking of trying to do my map using that instead.

Gary got hold of some code which got me going but it was a bit of a PITA so some searching brought me to Google Maps EZ which is basically a javascript library that takes standard HTML HREF’s and turns them into points etc, very easy to use.

My problem was still that maintaining data in a html file of HREF’s isn’t exactly what I had in mind, I was more partial to a XML file like the sample below:

<points>
<point>
<lat>-33.9333</lat>
<long>18.4667</long>
<type>lived</type>
<title>Cape Town</title>
<country>South Africa</country>
<href>http://flickr.com/photos/ripienaar/tags/capetown/</href>
<linkimg>images/19591136_35a14f6d58_s.jpg</linkimg>
</point>
</points>

This contains a lot of information, the type of visit I made to the location, links to my images taken there, a thumbnail to show for the links etc it wouldn’t be great to automate the parsing of that to output the HTML for GMapsEZ?

So that is exactly what I wrote. My script takes a simple configuration file like the one below:

[map]
data = visited.xml
type = map
extend = "http://maps.google.com/maps?ll=51.964577,-1.241455&spn=3.460112,7.639893&hl=en"
width = 350
height = 200
showcountry = 1
showtype = 0
[controls]
mapctrl = 1
typectrl = 1
scalectrl = 0
size = small
[types]
visit = orange
transit = blue
lived = green
[misc]
gmapez=http://www.devco.net/visited/gmapez.js
apikey="mykey"

By calling the script I wrote and passing the config file as argument it will produce all the HTML GMapsEZ needs to do its magic.

<?
require_once("gmap.inc.php");
print(getGMapEZ("smalldemo.cfg"));
?>

And this is the map it will produce, this is just a screenshot of the final result, see below the image for a link to the full working page.

My full working version of the map can be seen here, it’s the same data as above just a much bigger map, bigger controls and a different extend. The only actual difference are some changes to the config file, same data and same PHP code was used.

I’ve set up a Wiki to maintain documentation for this as it matures over time, I will make announcements of new features on this blog, but the Wiki will be the resource that contains a always up to date reference to features and installation. You can read about obtaining, configuring and using this script there.

Fame and Fortune

Or not, well perhaps a tiny little bit of fame. Recently two of my images were chosen to be used on other websites.
One is a UK based support site for the national schools network, they used my image of a Lancaster Bomber dropping 1 million poppies on a blog entry about the VE and VJ day celebrations in London.
The other is by The Digital Photography Weblog who chose my image of some deck chairs as their Digital Photo of the Day for 17th August 2005
Both were very kind to let me know they were using my image and gave due credit, exactly as required by the Creative Commons license I put my content under.
I have had a number of cases in the past where my images were just blatantly stolen and people claiming they took them, or worse even direct linking to them on my server. A bit of mod_rewrite magic replacing those images for visitors to their sites usually do the trick nicely for getting them removed, but I do wish I don’t have to resort to this kind of thing. Kudos to the above sites for doing things right.