Mapstraction tutorial

| | |

It was time to start moving my old Google Maps pages over to version 2 of the API, and I thought I'd consider using another mapping solution (maybe Yahoo Maps or Microsoft). But then fate intervened and I happened to listen to a podcast from the Where 2.0 conference by Steve Coast. He talked about Open Street Map and more importantly to me, Mapstraction.

From their homepage

    Mapstraction is a library which provides a common API for Google, Yahoo! and Microsoft's javascript mapping APIs to enable switching from one to another as smoothly as possible.

This was just what I was looking for, so I thought I'd give it a try and detail the steps I took to get a simple map up and running.

So far I have two parts to this tutorial on-line:

  1. Part 1 - Getting a Google Maps key and a simple Mapstraction 'hello-world' map up and running
  2. Part 2 - A more advanced map with map controls and markers

Of course one of the whole points of Mapstraction was to make it easy to switch map APIs, so I'll add a third part to the tutorial; switching Map APIs.