Patrick O'Brian Mapping Project in Google Maps V3

July 2, 2010, 5:17 pm

I spent the workshop at todays DevFest porting the ancient version two javascript in the Patrick O'Brian Mapping Project over to version three:

The old implementation was accessing raw XML file via the old GXMLHttp object. This is an AJAX wrapper object that was in v2 because, at the time, there wasn't an alternative. In the modern world of javascript libraries, there are lots of good implementations of an AJAX request object, so v3 didn't need to include GXMLHttp anymore. The new implementation uses a Mootoos request object and grabs JSON from the database rather than raw XML files. This is something I have meant to fix for a long time.

The old Google Maps v2 GPoint object has an x and y property (longitude then latitude), so when I moved over to v3's LatLng object, all my coordinates were backwards, leading to amusing results:

Once I had the map working in v3, I was able to take advantage of the styled maps features in v3 and give it a slightly more old world feel:

Not quite ready to make the port live, the links between info windows aren't hooked up yet, but it is almost there.

Permalink - Tags: Google,Patrick O'Brian,Development