Enhanced Map Tiles for 50+ Countries (Plus Google Spreadsheets Geocoding!)

Monday, September 17, 2007 at 8:55:00 PM

As announced on the Google LatLong Blog, Google Maps has added map tile coverage for 54 more countries in South America, Asia, and the Middle East. Those tile updates were also rolled out to the API at the same time, so you can begin your international mashing right away.

In the tradition of the Maps API blog, we're taking advantage of Google Spreadsheets to show off the tile updates. For reading the data from our spreadsheet, we not only use the usual GoogleLookup formula, but also the recently announced importXml formula. This formula specifies a URL and an XPath expression to evaluate on the output of the URL, so we can use it with our HTTP Geocoder output to do all of our geocoding queries within the spreadsheet. First, I specified the constants in cells at the bottom of the sheet:

B59: http://maps.google.com/maps/geo?output=xml
B60: /kml/Response/Placemark[1]/Point/coordinates
B61: /kml/Response/Status/code

Then I created the formulas for extracting the status code and coordinates of the geocode, where A2 is the cell containing the country name:

=importXML(B$59 & "&q=" & A2 & "&key=" & B$58, B$61)
=importXML(B$59 & "&q=" & A2 & "&key=" & B$58, B$60)

After pasting those formulas in each row and waiting a few seconds for the spreadsheet to perform the XML extraction, I had a column of coordinates for all of the countries. The end result is this spreadsheet, and the map shown below (based off the Spreadsheets->Map wizard output). Click on links in the sidebar to zoom in to a country, or just click a marker to see more information.