Book Reviews
This book review was submitted by a DenverJUG member as part of the Book Review Program.BOOK DETAILS
Google Maps API
Authors: Scott DavisPublisher: The Pragmatic Programmers
Publish Date: May, 2006
Pages: 83
ISBN: friday
Publisher's Book Description
Review Date: May 2006
REVIEW by Greg Ostravich
I enjoyed the book because the code samples made it seem very easy to use Google Maps to enhance existing applications that could benefit from Mapping data. It was an easy recipe book to follow. I'm currently out of town for training and I look forward to trying it out when I get home. Everything you need is available through the Google Maps API book, so you don't have to search for map data or open source tools like you would have to if you were rolling your own GIS application. Although Yahoo! has map features which give you the ability to easily map data, Google Maps gives you a fine-grained control, through JavaScript function calls. Some of these calls require longitude and latitude points. At the end of the book the author describes various GeoCoder services, the secret sauce to finding the longitute/lattitude points based on a city or street address.This book is a part of The Pragmatic Programmer's recently announced new line of books called the Pragmatic Bookshelf! Fridays. The Pragmatic Bookshelf describes these books as "short, focused, PDF-only books, written by experts for developers who need information fast." Scott Davis' new Google Maps API book is the second book in the series. In just 66 pages the book does a good job explaining and demonstrating how to use Google's Mapping API to easily add location to your existing application if you have address data or longitude/latitude points. This book includes links to what you need and code samples.
Knowledge of JavaScript will help since all the Google APIs are implemented in JavaScript. Knowledge of server-side Java is a plus if you're using AJAX with a servlet to proxy a request as the author does.
This book didn't take a lot of time to read and was a great introduction to the topic. I read it cover to cover in about two and a half hours. It would have been a little longer if I had access to a computer so I could play with the code snippets.
I've seen examples of the types of "Google Maps Mash-ups" described in this book. Slashdot mentioned the Chicago crime statistics site before ( http://www.chicagocrime.org ) which uses these JavaScripts to display crime data in Chicago. I had no idea how easy it is to create content like this until I read this book. It's just a matter of calling the right JavaScript function.
The book has five sections: Core Objects, Map Controls, User Data, Events, and Ajax. The author gives you sample code to create your GMap, and any points on the map called a GPoint. Next the book explains various map controls (Large Map, Small Map) that you can easily turn on and off with a function call. You can then add user data that includes markers (push-pins), polylines (line segments you might find on a driving route), and user windows that pop-up when you mouse over a push-pin. The author even shows you how to customize your marker with a different icon than the standard Google marker. The Events section was interesting, but I got a little lost on the code sample when the author was registering an event. I think if I could have played with the code on a computer I might not have had that problem. The author covers AJAX at the end of the book, but it's only covered by a couple of pages. I would have liked to see more examples, but the author refers the reader to the Pragmatic AJAX book instead. Pragmatic AJAX is available in Beta form as a PDF on the Pragmatic Website and I haven't read it yet. A couple of the authors have an blog on Ajax called Ajaxian that I subscribe to.
This book was an easy, fun read and I was amazed at how simple it was to implement all of the same features seen in http://maps.google.com without a large amount of JavaScript knowledge or mapping knowledge. I liked that there were lots of code samples and demonstrations on the author's website. The author also included some JavaScripts for some things that were lacking in the Google Maps API. The explanation and example usage of AJAX is an added benefit. This book is for anyone who has data (addresses, cities, or long/lat points) that they would like to map in their applications. Now anybody can do "Google Maps Mash-Ups".
I need to provide a caveat. I'm friends with Scott Davis; we are both involved with my local Java User's Group and I did the technical editing of Scott and Tom Marr's JBoss at Work.
I would rate this book an 8 out of 10.

