Using the Imperium map layer from the Scheme server for Google maps

I’ve already written elsewhere (http://finds.org.uk/blogs/centralunit/2012/10/05/the-portable-antiquities-scheme-joins-pelagios/ and http://pelagios-project.blogspot.co.uk/2012/10/the-portable-antiquities-scheme-joins.html) about how the Scheme has recently joined the Pelagios project. One of the outcomes of this excellent project was Johan Åhlfeldt’s wonderful slippy map of the Roman Empire, produced from the famous Barrington Atlas. As we serve quite a few map laden pages, it was only fair that our bandwidth took up the strain and so our tilestore is publicly available as well. This post describes how to get the PAS store working and shows how very simple it is to use and how to integrate them with Google Maps API version 3. (There is one limitation that you need to be aware of when using the maps and that is the minimum and maximum zoom levels.)

The Imperium layer

The Imperium map layer in action

Let’s assume you’re using jQuery for your javascript library and have included the appropriate file (packed or unpacked) and you have included the correct Google Maps API javascript library like so:

Once the above scripts are present, you need to add the code that will drive your map to appear on your HTML page (see the end of this post for an entire script).

The Imperium map layer is licenced under a Creative Commons By attribution licence, so to add this to the map, one can add these lines of javascript:

So the final code would look like this:

This can be seen in action here: http://finds.org.uk/imperium/example.html

As this is pretty basic, perhaps you want to add another third party layer – for example the Open Street Map tiles, so if you study the code below, you can see how this has been achieved:

And you can view this example at: http://finds.org.uk/imperium/osmImperium.html

Leave a Reply