Book Review: Map Scripting 101

“Map Scripting 101” by Adam Duvander is comprehensive introduction to web mapping that relies on the Mapstraction open source library. The book covers a number of basic Mapstraction map operations, and then builds up other related operations, including the Haversine formula, related web services, and server-side databases.

The book is recommended for beginners to web mapping who are familiar with HTML and CSS but have limited or no web mapping experience. Although it concentrates on the Mapstraction library, the intermediate and more advanced chapters include useful “how to” information that is applicable to any JavaScript web mapping application.

The text includes a reasonable introductory coverage of JavaScript, and shorter introductions to JQuery, PHP, and MySQL. Serious map developers unfamiliar with these topics will require dedicated texts in order to utilize them fully.

The Mapstraction library attempts to create an abstraction layer between the developer’s code and the various underlying map provider JavaScript libraries. On the positive side, then enables a developer to easily switch map provider without rewriting their code. It also enables a single map application to dynamically change provider according to the domain (eg. one provider might have better satellite imagery, but a different provider might have better road data) or region (eg. different providers supporting different countries). The downside to this approach is that it tends to provide a “lowest common denominator”. In a field where the industry leaders are actively competing and adding new featrures on an almost monthly basis, the choice of provider may be chosen accoridng to the features available.

The book starts off with a simple Mapstraction map that uses Google Maps. This is then modified to support Yahoo Maps, and is then modified to add extra features. Interestingly, when a particular provider is specified, it is usually Google or Yahoo. In the last couple of years, Yahoo has tended to lag a little behind the leaders of Google and Bing.

The middle section of the book is more of a cookbook style, demonstrating how to do specific tasks. Topics include webservice geocoding (JavaScript, HTTP web services, reverse geocoding, post codes); layers (drawing shapes; adding custom controls; image overlays; custom tiles with Tile Drawer running on Amazon EC2); map events; proximity (distances, driving directions, closest markers, local results, point-in-a-shape); user location; data formats (GeoJSON, GeoRSS, KML, GPX); and server operations (MySQL). Most of these topics are not specific to Mapstraction, and could be readily adapted to work with the JavaScript service of your choice. For example, distances are calculated using the Haversine formula and
does not rely on a Mapstraction library call.

The final chapter (“Mashup Projects”) gives a number of complete web mapping projects which utilitze the earlier chapters to plot data from other sources. These are:

  • Weather Map
  • Earthquake Map (USGS GeoRSS feed)
  • Music Events
  • Twitter Geo-Tweets
  • Find a central coffee shop for a meeting

The main text has very short coverage of PHP and MySQL. If they are new to these topics, a reader will probably need additional texts. Appendices include a reasonable good (18 page) brief introduction to JavaScript and JQuery; and a reference guide to the MapStraction library.

In conclusion, this book is recommended for beginners to web mapping who are familiar with HTML and CSS but have limited or no web mapping experience. Although it concentrates on the Mapstraction library, the intermediate and more advanced chapters include useful “how to” information that is applicable to any JavaScript web mapping application.

Leave a Reply