Sep 28

mapping

Over the last couple months, I have had the opportunity to work with maps. I have used both Google and Yahoo, and even touched on the Live Earth tools from Microsoft.

I have to say that creating maps can be pretty simple and straight-forward. The challenges come when you want to customize components like the little popup balloons when locations are clicked. I also have created maps using MySQL databases. In fact, the image above is my old contacts list that I have used for years. It’s a simple database in MySQL that I created with a PHP interface. Nothing fancy; I can add, modify, and delete contacts or view them in a nicely categorized list. But now, I can apply them to a map.

To do this, I simply added three new fields to my contacts table: latitude, longitude, and altitude. When I call the map, a query fires off and grabs all the personal information along with the locations fields. Based on these, I can place a marker on the map. Of course, the first time I did this, I had no latitudes or longitudes in the database. I wrote a function that checks for this information, and if it does not find it (it is empty), I use the Google Geocoder to fetch me the parameters. For US addresses, I pass the city and state, and for other countries, I usually just pass the city and country. So, within a few minutes, I had all the people I know on the map. Click on a little marker, and up comes all the information I need for that person: phone, email, address, etc.

I have to say that while I prefer the look of Yahoo maps, I find the Google offering more robust and better supported (and when I say better supported I also mean that there is more first-hand experience written about it). However, Yahoo’s official documentation is far better.

This is amazing stuff and is only going to become more popular and more useful (think mashups of all kinds). In fact, my favorite use of this is on Flickr; you can geocode your photos (using a little map) and then view photos from around the world by clicking on the map. Very slick.

written by Christopher Murray \\ tags: