When Location Matters to your Website ... Mapping with Google [www.contextsensitivesolutions.org]
At the risk of revealing my age, there was a time when I had hoped there was a website that could map the world. A site that could tell me where to find what on the globe and show me how to get there.
Obviously a site like that would take an enormous investment and effort to build and I'm glad, thrilled even, to see companies like Google take on that challenge when they released Google Maps to the public in 2005.
What's even more exciting is that Google makes this data available thru an application programming interface (API) to web developers like you and me.
So in what cases can Google Maps or an equivalent service help your website ?
One such project Solutiongrove worked on had a library of case studies with address information. The data was there on the page but there was no way for people to visualize what place a case study was talking about or how close it is to other case studies.
We put a Google Map on each case study page and put markers. One marker shows the location that the case study was referring to, one marker for each of the case studies that are close to it and markers for organizations or contacts that are within the area.
The first challenge was Geocoding. For you to be able to plot markers on a Google map, you need the longitude and latitude for the location. Geocoding is the process of finding the geographic coordinates from an address. Google didn't have a geocoding service at the time so we used Yahoo's Geocoding API. Coordintes don't change, so once we had the longitude and latitude for an address we saved it to the database and associate it with the address so geocoding is part of the process that works in the background when a new case study with a valid address is inserted into the database. Note that the latest version of Google already has Geocoding built-in via the "GClientGEocoder" function.
The Google Maps API is a frontend API. It's not rocket science but you do need to know some javascript to be able to get it to work. You can actually break it down into 4 steps :
For more information about how to use Google Maps in your project visit the Google Maps API website.
You can check out how we used Google Maps visit the Context Sensitive Solutions website and take a look at their case studies.
What is even more interesting is what the future holds. HTML5, the next generation core language of the world wide web, will have a Geolocation API. Imagine one day being able to tell where your users are located. Yes, creepy I know, but this will allow you to serve more relevant information based on their location, instantly making your website much more intuitive and location aware.
HTML5 is already available today with Firefox 3.5
Subscribe to notificaitons