Another update to
Geocaching Map Enhancements
Since Groundspeak have added a scale bar onto the Geocaching Map, I've removed the scale bar in the script. But there's also a more interesting feature been added: custom maps and overlays.
What this means is that as well as using the standard maps, and the extra ones that the script enables, you can add in extra sources to your heart's content. Click on the cog icon to configure, select "Add more maps", paste in a string of code, and hit "Add mapsource". It's as easy as that.
By default the new mapsources are used as basemaps that get added to the normal pick-list; although you can have lots in the list, you can only use one at a time. e.g. use the code below to add in 1950s New Popular Edition Ordnance Survey maps (only works in Great Britain):
{"alt":"OS NPE","tileUrl":"http://ooc.openstreetmap.org/npe/{z}/{x}/{y}.png", "minZoom":6, "maxZoom": 15, "attribution": "OpenStreetMap NPE" }
But if you have a mapsource with transparent tiles, you can also add it as an overlay. Although it might slow things down, you can switch on several overlays at the same time, displaying different info. Here's an example that shows Northern Ireland's national nature reserves, overlaid over your normal map (only works in NI - try
here!):
{"alt":"National Nature Reserves (NI)","tileUrl":"http://webservices.spatialni.gov.uk/arcgis/services/NIEA/NationalNatureReserves/MapServer/InspireViewService/ENG", "layers":"NationalNatureReserves", "format":"image/png", "transparent":true, "attribution":"data.gov.uk", "overlay":true}
So what other sources can you use? ...erm, well that's the tricky bit. There are instructions and a couple of examples in the script itself, but it would be great if there are some GIS ninjas out there that can suggest codes for interesting data sources. I can imagine it being useful for people in other countries that want to use local maps, or for accessing things like some of the MAGIC environmental datasets, to help find interesting features or avoid sensitive areas. Some sites that give pointers include the
Neongeo wiki for basemaps or
data.gov.uk and the
Environment Agency for potential overlays.
For the techies, the code string uses JSON encoding, with the same parameters as Leaflet map layers. It supports Bing-style quadkey URLs, Google and TMS (inverted-y) x/y/z URLs, and WMS servers. Use {q} in the tileUrl template for quadkeys, and set the overlay parameter to true for overlays.
Enjoy!
This post has been edited by jri: 19 March 2012 - 11:56 AM