Large

Geocaching Map Enhancements

By JRI Last update May 2, 2013 — Installed 35,624 times.

Default Map

in
Subscribe to Default Map 8 posts, 4 voices



Bill Lancashire User
FirefoxX11

When I start maps on the web page the map always starts with the OS map. Is it possible to configure in anyway so that a different map is the default start-up?. Perhaps an edit to the script file?

Thanks.

 
JRI Script's Author
ChromeWindows

The script lists the custom maps first, then the ones pre-set by the website. It defaults to loading the first map in its list that isn't disabled.

To change which map loads as default, you can edit the script to change the order of the custom maps. The relevant code is from line 34 of the script file. You can put the entries in any order you like, but make sure there is a comma at the end of every line except the last one in the list. If you really want one of the standard maps to be the default, you will need to add it as an extra custom map, with a slightly different name in the "alt" field.

You also need to edit the version number at line 25 of the script (not the one right at the top). This is so that the script recognises that the default configuration has changed. The actual number isn't important, but I would suggest adding something on the end, rather than bumping the number up, so it doesn't conflict with the next release.

If you are using Firefox with Greasemonkey, you can edit the script by right clicking on it either in the Greasemonkey menu or the list of userscripts in the Add-ons screen. If you use Tampermonkey with Chrome, you can right-click on the Tampermonkey icon, choose Options, then click on the script name to edit it. If you use Chrome but don't have Tampermonkey or another script manager installed, you will have to save a copy of the script by right-clicking on the Userscripts.org install button, saving it somewhere, editing it with Notepad or your favourite text editor, then opening the new version in Chrome to re-install the script (you can also do this with Firefox).

I will try to figure out a more user-friendly way of setting the default map for future updates, but I hope this helps people in the meantime.

 
JRI Script's Author
ChromeLinux

Ignore the instructions above. As of v0.5.2 you can just select the default map in the built-in configuration screen. NB any map you select as default will automatically show up in the pick-list, even if you hadn't chosen to include it.

 
hp2 User
FirefoxWindows

Well that was an excellent upgrade! Thank you very much for making map control and selection easy and friendly!

Hate to ask for more, but.........is it possible to add a topographic map to the offering? Examples include MyTopo, and USGS Topographic [well, the latter for the US, anyway ;-)]. Thanks again!

 
JRI Script's Author
FirefoxX11

MyTopo should already be included - although it's disabled by default as it doesn't seem to work outside North America. There's also the Google Terrain map. You can pick which maps to show from the GME script's configuration sceen (cog icon).

I'll have a look at other USGS maps for the next update.

 
hp2 User
FirefoxWindows

HAH! Man are you fast! Absolutely do not know how I could have missed that! Thanks again for an excellent script! Really do appreciate your efforts!

 
stretch.kerr User
ChromeMacintosh

Hi, I've been playing around with adding a WMS source to your script and think I may have found a bug. I've successfully added the WMS source as an overlay, but whenever I select it, it gets drawn over top of the geocache icons instead of underneath it like all the other map options. When I'm on a single cache page, instead of the main map page, my WMS source appear correctly, UNDER the cache icon in the mini map.

I also tried pasting the JSON configured WMS string into your script between line 43 and 50 in an attempt to have my WMS source appears as a regular map option. I haven't managed to get that to work at all.

How can I get my WMS source to a) be drawn UNDER the cache icons on the main map page, and b) appear in the predefined list of map options?

I also tried pasting in "Google Hybrid" as a map option but it failed to appear when I refreshed the geocache map page. Here's what I inserted: {alt:"Google Hybrid",tileUrl:"http://mt.google.com/vt?lyrs=y&x={x}&y={y}&z={z}",name:"Google Hybrid",alt:"Google Hybrid",attribution:"Google Hybrid",subdomains:"1234",tileSize:256,minZoom:0,maxZoom:22},

The WMS source I'm using is 1:50k New Zealand Topo Maps , and is available from http://data.linz.govt.nz/#/layer/767-nz-raster-.... Obviously that's not the WMS link itself. What I used was:
{"alt":"NZTopo50", "tileUrl":"http://wms.data.linz.govt.nz/PRIVATE_KEY_SPECIFIC_TO_ME/r/wms", "layers":"x767", "format":"image/png", "transparent": true, "attribution":"LINZ CC BY 3.0", "overlay":true }

If you need access to the WMS source to replicate my results, contact me and I'll give you the "PRIVATE_KEY_SPECIFIC_TO_ME" part, or you might like to freely register at data.linz.nz and create your own.

Great script so far - I haven't even explored all of its features yet.

EDIT: Fixed WMS source appearing over/under cache icons by changing attribute "overlay":true to "overlay":false. Still working on Google Hybrid issue.

 
JRI Script's Author
FirefoxWindows

@stretch.kerr Good work - this is exactly what I hoped people would try with the custom maps.

For the WMS source, I think your issue is a feature of overlays, rather than a bug. Overlays lie over the top of all the other map layers. On the main map page, the base map is one layer of tiles, the geocaches are a layer of (mainly) transparent tiles on top, and overlays are stacked on top of that. Because the LINZ map tiles are opaque, the caches and base map do not show through. The reason it seems to work on the cache pages is that they don't use the geocache map tiles. Instead, the cache and its waypoints are drawn as separate markers, which sit on top of the overlays (this is also why you don't see any other caches when you scroll the map).

I could modify the script to allow opaque overlays to be made semi-transparent, but it would be a complicated mod, and the end result doesn't look very good. Instead, you will get the effect that I think that you want if you just delete the "overlay":true parameter from the end of the JSON string, and use the WMS source as a normal base map. Much simpler!

For adding maps into the predefined list, you are going along the right lines, but the script only uses the predefined list the first time it loads. After that, it uses a copy stored in localStorage in your browser. To make it reload the list, change the version number at around line 30 of the script.