Using Google Maps APIv3 and Google Spreadsheets
Over the past few days, I’ve had the opportunity to learn some cool things that one can do with the Google Maps API v3. While working on a newly acquired project, I was faced with a unique (or maybe not so unique) situation demanding the need for a solution that allows users to submit location data, which is then automatically plotted on an embedded Google Map. This situation was unique in the sense that it needed to be purely based on Google features (for simplicity and user friendliness).
The posts to follow (Part I through Part V) focus on providing this solution through resources available on the Internet. It took me three days of research, debugging and hair pulling to get the system to work as intended. I thought I’d save you the trouble. Here is the unique situation:
- User submits a Google Form with address information, which is then stored to a Google Spreadsheet.
- Address information is then geocoded in the Google Spreadsheet automatically upon form submission to provide LatLng pairs for plotting. Note that Google Maps can plot markers based on address alone, however, the process is much slower when compared to simply providing LatLng pairs.
- An embedded Google Map then pulls information from the Google Spreadsheet, processes the rows and columns, then plots the markers and provides information in the infowindows.
- Markers on the map have to be different depending on the type of location (ex. if it’s a church, display a church marker, if it’s a hospital, a hospital marker and so on).
- Lastly, the embedded map has to have links that make the map pan to certain areas (different counties, different states etc).
- Preparation: what you’ll need to get started.
- Focusing on the data: data collection, spreadsheet & form customization.
- Focusing on the map: embedding a Google Map & connecting to your Google Spreadsheet.
- Focusing on the design: making your map look nice & implementing links that pan the map.
- Recap & resources: bringing it all together & a list of resources and sources used in this tutorial.