While recently developing a fairly involved Google Maps application, I quickly discovered that JavaScript libraries, such as jQuery, can only get you so far. None of them offered the level of specific mapping functionality I needed, and all the mapping plug-ins I looked at relied on the recently deprecated version 2 of the Google maps API. The only way to extend them was to rewrite large swathes of their code so they would work with the new API, which sort of defeats the purpose of using a plug-in for rapid development. I figured out what I needed via tutorials on Google’s website and several other sites, including “In usability we trust” maintained by Gabriel Svennerberg.
He’s written a series of tutorials on using the new Google Maps API, which he’s expanded into the recently published book: Beginning Google Maps API 3. All of the code demonstrated in the book is available for free download. I wish I’d had this book when I’d started the project – it would have saved a great deal of trial and error on my part. The author says that even those without much web development experience should be able to get a Google Map up and running. While I don’t disagree with this, the author introduces some advanced JavaScript fairly early in the book. Library staff members can follow the tried and true, copy and paste method, but some of the concepts, like anonymous and self-executing functions, might leave them scratching their heads a bit.
The author begins with a brief history of the Google Maps API and then takes a detour into upgrading from Version 2 of the API to Version 3, which the author recommends skipping if you don’t have any legacy applications to upgrade. However, I found it a useful general overview of the concepts discussed later in the book.
The rest of the book starts with the development of a very simple map. Then each chapter builds on the previous chapter in terms of map features and complexity; including such common mapping tasks as creating clickable markers that open information bubbles and creating polylines and polygons, used to create such things as driving directions, or to highlight specific geographical areas. The author follows the pattern of introducing a chapter’s main concepts and then working through them bit by bit, ending each chapter with the completed code for that chapter. I found this practice quite helpful as I didn’t have to flip back and forth as I have in other technical books to figure out the totality of what was going on.
The author also discusses several other often used features such as using Google’s
Geocoding service to find a user’s location as well as how to create custom markers. One particularly useful feature the author discusses deals with maps with large number of markers, anything above 1000, at which point a map’s performance starts to seriously degrade, particularly in Internet Explorer. This was something I ran up against very early in the development process. The author discusses the pro and cons of the various methods to deal with this problem, enabling a developer to easily choose the one that’s right for his or her particular application without having to code up each option and see what happens.
The book concludes with a very helpful overview of the API features discussed in the book, going over exactly how to use each class and method.
One concept I wish had been discussed in the book was dynamic sidebars, where a user can click a sidebar link to open the info window for a particular point. I found this one of the trickiest parts of developing our application.
All in all, I’d highly recommend Beginning Google Maps API 3 to those looking to develop Google Maps applications with the new API. It’s clearly written with lots of examples and pictures of exactly what the code’s output looks like. If you’re merely looking to embed the location of your library/institution in a Google Map this book is definitely overkill. However, if you plan on working on anything beyond the very basics this book is a definite plus. It will be particularly helpful to those with some previous JavaScript experience.