Google Maps API Tutorial

© 2006, 2007 Mike Williams

 

The Book

Beginning Google Maps Applications with PHP and Ajax

If you want to take your Google Maps further. If you want to take them a lot further, then get the book.

Beginning Google Maps Applications with PHP and Ajax by Michael Purvis, Jeffrey Sambells and Cameron Turner goes a long way beyond what I've been able to include in this tutorial.

Don't be confused by the word "beginning" in the title of the book. This is not a book for beginners. If you don't have solid grounding in HTML, Javascript and PHP then this book is going to leave you standing. Familiarity with CSS, mySQL, Ajax and XML will also help. I confess that some of the sections were beyond me.

The book isn't perfect. There are a few typos that you'll spot immediately you try to write pages that use their code [like "map.addControl(GMap2TypeControl());"]. I, personally, think that it's a mistake to assume that all your users will have Javascript enabled, rather than using <noscript> to explain to users without Javascript why they're looking at a blank page. I also think that the section of using the Yahoo Geocoder should have mentioned that it is a violation of the Yahoo Terms to use the Yahoo Geocoder with Google Maps.

Despite a few flaws, I reckon that the book should be an indispensable part of the toolkit of any professional web designers who want to include advanced Google Map techniques in their web sites.

The book is divided into three parts.

Part 1: Your First Google Maps covers things like allowing users to add markers and related information to your map and store it in a mySQL database and fetch it back so that other users can see it.

Part 2: Beyond the basics covers things like handling huge numbers of points using several techniques, including creating a custom tile layer generating the tile graphics dynamically in the server, and caching the images to improve response times.
There's an example at http://googlemapsbook.com/chapter7/ServerCustomTiles with a map that displays over 115,000 data points.

Part 3: Advanced Map Features and Methods covers some advanced topics, like the ability to write your own geocoding service, like this one: http://googlemapsbook.com/chapter11/UKRest/index.php?code=AB10.

There's also lots of ongoing support from the web site associated with the book, http://googlemapsbook.com including copies of all the source code printed in the book and updated information about things like available geocoders and data sets.

Back to Mike's Homepage
Up to the start of this tutorial