This book follows the familiar Packt Cookbook pattern of dividing each recipe into sub-sections of Introduction, Getting Ready, How to do it, How it works, There’s more, and See also. This pattern has worked well in the past, and works especially well here. The recipe’s concept is introduced, the code is provided, it is then explained before finishing with potential expansions, caveats, and further reading. In common with most Packt Cookbooks, the first chapters are relatively simple and are used as a basis for later chapters and concepts.
The chapters are:
- Adding Raster Layers – tile base maps, overlays, heat maps, additional Google layers such as traffic and cycling
- Adding Vector Layers – markers, popups, lines, polygons, animation, KML, GeoJSON, WKT
- Working with Controls – Adding, removing, position, custom
- Working with Services – Geocoding, elevations, directions, Street View
Note that many of these recipes do not rely on built-in API functionality. For example, a simple WKT parser is introduced in order to plot WKT data.
There are some quibbles with small parts of the text. Some of these are pretty trivial. For example, no mention is made that Google Maps does not support all of the KML standard. This is a common assumption and is wrong: Google Earth is the only application that supports all of the KML standard. As I say this is fairly trivial.
A more significant omission concerns map projections. Google uses a Mercator projection based on a spherical Earth model. No mention is made of the spherical Earth model although it might pose problems when plotting GPS-derived data (which is typically WGS84). The area-distorting properties of the Mercator projection are mentioned, but no mention is made of why this is bad for many map projections. Basically the distortions make the Mercator projection unsuitable for regional and global geo-statistical maps (including the global earthquake example given in the book). Such applications should use an equal area projection such as the Mollweide or Cylindrical Equal Area projections. The online mapping revolution of the past decade has made it very easy to make high quality maps with services such as Google Maps or Bing Maps. Unfortunately it also makes it easier to make accidental mistakes of this kind.