Loginskip to content

Archive for March, 2008

Mapping a Book Tour with Google Maps

Monday, March 3rd, 2008

Recently a mutual friend of Jennifer 8 Lee’s put her in touch with me for help with a Google Maps utility for her new book’s blog. The book, called The Fortune Cookie Chronicles, comes out today, and she wanted help setting up a little map of her book appearances. The map is up now, and seems to be working well!

The code reads in an XML file of appearances, then uses the Google Maps API to put each point on the map. To save the trouble of having to type everything twice, we’re also using it to create the text list of appearances below. After a little thought and testing, I added the ability to group appearances by city, and have a link that opens up the map zoomed in on that location.

Once again, the Google Maps API has proved to be fun to work with. I love having open APIs for such cool services, and Google seems to add to the featureset frequently. The only real problem I had was that the geocoder service seemed to be slow and didn’t always return all of the requested coordinates. I might have just been doing my testing when the service was having problems, but I went ahead and added coordinates for all the locations to improve performance and reliability.

Some day if I have time, I’d love to clean up the javascript and make it more general. I think it might be interesting to make a WordPress plugin for mapping book signing appearances or other kinds of interesting geographical lists.



Categories