Google introduced their Mapping Service with an Javascript API that lets you draw your own maps using their system. Coding maps dealing with big chunks of data in pure Javascript is a bit of a pain so a number of libraries came out making this easier.

The most interesting of these libraries that I found is Google Maps EZ a simple bit of Javascript that takes HTML code, parses it and then do the hard work of talking to Google for you. This is great but not ideal yet for large chunks of data. I wrote a PHP library that will parse a config file and a XML data file to output the HTML for Google Maps EZ

http://www.devco.net/pubwiki/GMapsPHP/Overview?action=AttachFile&do=get&target=gmapsphp-1.7.jpg

The basic idea is to have data in a XML file that contains coordinates, text, images and hyperlinks rendered onto a Google Map. 1 point on a map would require only the following XML:

<points>
        <point>
                <lat>-33.9333</lat>
                <long>18.4667</long>
                <type>lived</type>
                <title>Cape Town</title>
                <comment>Lived here 1997 to 2002</comment>
                <country>South Africa</country>
                <href>http://flickr.com/photos/ripienaar/tags/capetown/</href>
                <linkimg>/visited/images/19591136_35a14f6d58_s.jpg</linkimg>
                <linemember>1</linemember>
        </point>
</points>

Using simple data like this you can put any number of pins on a map, in many colors with links to 3rd party data, a screenshot of such a map in action can be seen above. A full working sample of a map driven by this system can be seen on my Map of Places I visited

Since version 1.6 you can also draw lines on your maps by marking a point as belonging to a numbered line, line caractiristics like color, thickness and opacity can be set in the configuration file.

GMapsPHP/Overview (last edited 2006-12-28 10:36:29 by nat)