Jump to content

Geocaching Map Enhancements


jri

Recommended Posts

I used to use OS maps in Chrome but then they decided GME was not one of theirs so disabled them...have tried reloading them again yesterday but Chrome wont let them work...Have loaded GME on Firefox with Tampermonkey and still no joy..and only Bing Aeriel shows in menu.....very frustrating as OS maps are so much better for planning a route...now I do a screen capture from Streetmap then put it in Paint and add a red circle of all the caches I want then print it out....

Simply follow the instructions here and it will work on Chrome and Firefox. Still using them on both browsers with no problems.

Link to comment

I have to apologise that it's been a little while since I posted here, but these days it is hard to find the time to work on GME. I am neither a professional programmer, nor your average skript kiddy. I have a young family, full time job and several voluntary commitments competing for my time, and in the last year I've started studying for a part time Masters degree. Occasionally I like to find time for the odd geocache too!

 

That said, I do intend to keep GME alive, and hopefully by now you should have seen the v0.7.3.1 update. If it hasn't automatically updated in your browser, you get install it from openuserjs.org/scripts/JRI/Geocaching_Map_Enhancements

 

The new version is supposed to fix the following:

 

  • GME not working on cache pages.
  • Search by GC-code not working on the main map
  • Sidebar hiding GME icons.

The first two bugs were caused by Groundspeak changing their page structure in a way that stopped GME detecting if a user was logged in. Groundspeak also switched to using secure https connections for cache pages around the same time, but that was actually helpful - it means that you will now see the same selection of custom maps in most areas of the site, without having to enter their configuration twice.

 

I have also been updating some of the documentation for GME. This is still a work in progress, but in particular, I have refreshed the list of custom map sources and overlays at geo.inge.org.uk/gme_maps.htm This now includes the details for getting OS maps from Bing. There are also updated details for various map sources which had broken, including MapQuest aerial photos, the NBN Nature Reserve and National Trust site overlays, Hill Shading, and the US TIGER transportation overlay.

 

In the long term, I want to get free OS maps working, supplied by the Ordnance Survey rather than Bing. However, the OS maps come in a different projection than the other maps used on the site, which means that they can't be directly overlayed. Although the Leaflet mapping engine used by GME can handle different projections, it can't cope with more than one at the same time. To get around this, I need to come up with a way of displaying the OS maps under the other maps; panning, zooming and rotating them so they align; and then keeping everything synchronised. This would also allow GME to show maps from the Swedish Lantmäteriet and other national mapping agencies who use their own projections. At the moment though, I just haven't got the time.

 

If you do think of new features for GME, do let me know - but bear in mind that I'm only likely to implement ones that are either very quick, or very interesting! Similarly, if you find bugs, please tell me about them, but try to give me enough detail to track down the issue. "It doesn't work" doesn't help. You can assume that unless it's something that Groundspeak have just changed, for the vast majority of the time the script will be working for me. I need to know more about what setup you are using, and what you think is going wrong, so I have a chance of figuring out a solution. There are some hints for troubleshooting and reporting bugs are here: geo.inge.org.uk/gme_trouble.htm

 

Behind the scenes, I am also working on making automated tests for GME, to help me figure out what's happening quicker when the script breaks. This work and any other changes that aren't yet ready for release will be in a github development branch.

Link to comment

I'd like to add my thanks to jri for the effort put in to create and maintain this phenomenally useful add-on to GC maps. It is very much appreciated out here and I am totally in awe of people who know how to do this sort of thing.

 

Regarding this ...

If you do think of new features for GME, do let me know - but bear in mind that I'm only likely to implement ones that are either very quick, or very interesting! Similarly, if you find bugs, please tell me about them, but try to give me enough detail to track down the issue.

... I don't know whether the following counts as an (un)interesting feature, a possible enhancement, or something that we just have to live with. Whenever I do a periodic spring clean of Chrome (deleting cache, cookies, history, etc) - often at the behest of some "help desk" trying to get something else to work - I find I lose my custom map sources. GME itself is still there but suddenly I've only got the default GC set of maps, and I have to go through the performance of adding them again. It's not a big deal, and I'd quite understand if it's low down the list of priorities, but if there's some way to protect the map sources from inadvertent deletion that'd be really helpful.

Link to comment

... I don't know whether the following counts as an (un)interesting feature, a possible enhancement, or something that we just have to live with. Whenever I do a periodic spring clean of Chrome (deleting cache, cookies, history, etc) - often at the behest of some "help desk" trying to get something else to work - I find I lose my custom map sources. <snip> ... if there's some way to protect the map sources from inadvertent deletion that'd be really helpful.

 

Unfortunately, the only way to really protect settings would be to have them stored on a server somewhere, which would mean you needed a log-in to GME, as well as your log-in to GC.com. My web hosting service doesn't have the facilities for this. Another alternative would be to store settings in a local file, but for security reasons it's not a good idea to let scripts access your files! Instead GME stores its settings in something called "browser localStorage". This is permanent in the sense that it isn't deleted when you close your browser, but it does get deleted if you wipe your browser profile or clear out cookies. I think this is actually desirable - you need some way of cleaning things out if the settings get corrupted, or for privacy.

 

GME does have a feature to export map settings, so that you can back them up or share them. Before deleting cookies, go to the "Manage Maps" tab in GME's configuration screen, and click the "Export custom maps" button. A pop-up window will appear containing the JSON code for all your custom maps. Copy and paste this into Notepad or similar. Once you've finished your profile cleaning, go back to the "Manage Maps" tab, paste all the JSON code into the "Mapsource" field, and click "Add" then "Save". This should add back all the maps at once.

 

If you're proficient with Javascript, you can also use your browser's console to copy GME's settings directly using the variable localStorage.GME_parameters - but don't try this if you don't know what you're doing: it's easy to foul it up if you don't escape the quote marks properly!

Link to comment

As a possible enhancement, I'd like to be able to place a marker pin on the map.

 

E.g. Once I've solved a puzzle, I'd like to be able to type in the co-ords (In various formats) and have a pin appear on the map so I can see where it is.

 

GME does this already! On the main map page, type a "p" in the search box, followed by a space and some lat/lon coordinates. Click the magnifying glass button and it should plot a small marker at that point. Various coordinate formats should work. I must get round to documenting this at some point... dry.gif

 

Also, on the cache page for a puzzle or multi-cache, you'll notice a little pencil symbol next to the coordinates. You can click this to correct the coordinates to match the final location of the puzzle (this is a standard website feature). If you do this, then GME will show the the coordinates on the little map on the cache page, with a green tick mark next to the cache symbol and a blue line going back to the original location. If you click the "View larger map" link, then you should see the same (plus any waypoints) on the main map page.

 

If a cache has corrected coordinates or waypoints, you can also display them on other maps by dragging the cache icon from next to the title of a cache listing page, and dropping it onto a GME-enabled map. You can use this to show the correct locations of several completed puzzles on the same map at the same time.

Link to comment

...Unfortunately, the only way to really protect settings would be to have them stored on a server somewhere, which would mean you needed a log-in to GME, as well as your log-in to GC.com. ... Another alternative would be to store settings in a local file, but for security reasons it's not a good idea to let scripts access your files! Instead GME stores its settings in something called "browser localStorage". ... it does get deleted if you wipe your browser profile or clear out cookies.

OK, I understand, and thanks for the response. Just have to remember to export first before spring cleaning ! Might be worth including something about this in the documentation ?

Link to comment

I have had OS maps working for a few days, testing out my method to see if there were any pitfalls. So far, so good. Follow these steps to see if you can get it working also.

 

1) Go to Bing Maps Key and follow the instructions there to get a personal key. I got a "Basic" key as a "Trial" key only lasts 90 days. I think a Basic key gives you 50000 tiles per day but I can't be sure. If there is a usage limit, best not to share your key with anyone else.

 

2) Insert your key into the following string, replacing the 'xx...xx' bit.

 

{"alt":"Ordnance Survey by Bing","tileUrl":"https://t{s}.ssl.ak.tiles.virtualearth.net/tiles/r{q}.png?g=3440&productSet=mmOS&key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "subdomains": "0123", "minZoom":10, "maxZoom": 17, "attribution":"Ordnance Survey imagery from <a href='https://www.bing.com/maps/'>Bing Maps</a>", "name":"osbing"}

 

3) Add the above (revised) string into GME as a Custom Map source, both http (cache page) and https (big map).

 

4) Select OS maps from the drop down as your preferred map source.

 

I'd like to try the Bing maps key method again, but, on the Bing portal, where I can request a new key, what do I enter as "Application"?

Edited by drwitzon
Link to comment

I'd like to try the Bing maps key method again, but, on the Bing portal, where I can request a new key, what do I enter as "Application"?

 

Just checked mine and it's blank:

 

Key: ################################################################

Application Url:

Key type: Basic / Not-for-profit

Created date: 04/23/2015

Expiration date: None

Key Status: Enabled

Link to comment

I'd like to try the Bing maps key method again, but, on the Bing portal, where I can request a new key, what do I enter as "Application"?

 

Just checked mine and it's blank:

 

Key: ################################################################

Application Url:

Key type: Basic / Not-for-profit

Created date: 04/23/2015

Expiration date: None

Key Status: Enabled

 

It doesn't let me leave the field "Application name" blank. It's a required field.

Link to comment

@JRI

Re: V7.3.1

 

line 2663, col ~600

grDiv.innerHTML = '<h5>Ordnance Survey Grid Reference :</h5> ... name="gme_coords" id="gme_coords" placeholder="N 51° 10.683' W 001° 49.604'"/>

 

degrees signs and single quotes should be removed!

 

Cheers

stebu

Link to comment

grDiv.innerHTML = '<h5>Ordnance Survey Grid Reference :</h5> ... name="gme_coords" id="gme_coords" placeholder="N 51° 10.683' W 001° 49.604'"/>

 

degrees signs and single quotes should be removed!

 

Those aren't single quotes - they're arc minute signs (or at least they are in the source code)!

 

Seriously, are they causing any particular problem? The idea of including them in the example was to show that the Freeform Coordinates box will let you cut'n'paste in coordinates copied from other places without having to worry too much about odd punctuation. You can use most relatively sane formats too: decimal degrees or degrees, minutes and decimal seconds (with or without punctuation) should work too.

Link to comment

grDiv.innerHTML = '<h5>Ordnance Survey Grid Reference :</h5> ... name="gme_coords" id="gme_coords" placeholder="N 51° 10.683' W 001° 49.604'"/>

 

degrees signs and single quotes should be removed!

 

Those aren't single quotes - they're arc minute signs (or at least they are in the source code)!

 

Seriously, are they causing any particular problem? The idea of including them in the example was to show that the Freeform Coordinates box will let you cut'n'paste in coordinates copied from other places without having to worry too much about odd punctuation. You can use most relatively sane formats too: decimal degrees or degrees, minutes and decimal seconds (with or without punctuation) should work too.

Yes, single quotes were causing a problem. But it might be that the culprit is my text-editor that turned minutes into quotes!

Sorry for a false alarm, keep up the good work :rolleyes:

Link to comment

I now, this thread isn't right place for my wish, but script Geocache Height is from Your workroom B)

This very small script worked fine for me, but after GS layout changes is dead.

It is possible refresh him?

Many thanks!

 

I hadn't been maintaining that script, as I built a height tool into GME, but I've now re-witten it and put it on OpenUserJS.org, at https://openuserjs.o...Geocache_Height

 

screenshot.png

 

It now has an icon, and behind the scenes I've put together a test suite so I can fix it again quicker next time it breaks. Let me know how it works for you!

Link to comment

I now, this thread isn't right place for my wish, but script Geocache Height is from Your workroom B)

This very small script worked fine for me, but after GS layout changes is dead.

It is possible refresh him?

Many thanks!

 

I hadn't been maintaining that script, as I built a height tool into GME, but I've now re-witten it and put it on OpenUserJS.org, at https://openuserjs.o...Geocache_Height

 

screenshot.png

 

It now has an icon, and behind the scenes I've put together a test suite so I can fix it again quicker next time it breaks. Let me know how it works for you!

didn't know about his script but I can see it being very useful. just one question. I am old school and still prefer to use Feet rather than meters. is there an easy way to change the script to show Feet rather than meters?

Thank you

Link to comment

didn't know about his script but I can see it being very useful. just one question. I am old school and still prefer to use Feet rather than meters. is there an easy way to change the script to show Feet rather than meters?

 

Rather than spend time making the script configurable, I've created a second version that displays the height in feet instead. You can get either script from https://openuserjs.org/users/JRI . You can even install both, and see the cache height in both metres and feet at the same time!

Link to comment

Don't know whats gone wrong for me but when I select Bing OS the browser only shows the geocaches not the map just a grey screen with no details?

I'm on v 46 of Firefox Also tried a slightly different script still no joy.

I have tried this on chrome and it works ok so that suggests something in FF stopping it working?

Edited by UrbanFox2
Link to comment

I just got an Email titled "Bing Maps AJAX Control v7 and SOAP Web Services Deprecation"

Seems version 6.3 will reach end-of-life on November 30, 2016.

 

Any effect on GME, or what?

 

I can copy the entire mail if you need, but I suspect all users will get one soon.

 

Alan T.

Link to comment

I just got an Email titled "Bing Maps AJAX Control v7 and SOAP Web Services Deprecation"

Seems version 6.3 will reach end-of-life on November 30, 2016.

 

Any effect on GME, or what?

 

I can copy the entire mail if you need, but I suspect all users will get one soon.

 

This won't affect the GME script itself (for non-Bing maps), as it doesn't use Bing's software. However, if retiring their old version means map tiles are no longer served up in the way GME uses, that could cause a problem. If you PM me the message, I'll look at the details (I'm not actually using the Bing service myself at the moment).

Link to comment
If you PM me the message, I'll look at the details (I'm not actually using the Bing service myself at the moment).

PM'd you with the full text

 

Looks like we're probably OK, but I'll try to check in more detail when I've got my current uni assignment out of the way. I'm hoping to get time over the summer to do some major work on GME that may mean it can get OS maps without going through Bing, but either way, I should be able to make sure there aren't any problems come November.

Link to comment

Hi jriHope you don't mind this post but I have lost my OS maps. I have greasemonkey and also the geo map enhancements but no OS showing. What have I done!! :unsure:

Just a thought, but have you recently cleaned out your browser by deleting cookies, temporary internet files, etc ? If so, that's where your custom mapsource data is held. Been there, done that. You just need to add the OS Maps source back in using the same method you did originally. Earlier posts in this thread #705, #706, #708, & #711 discuss this.

Link to comment

Hi jriHope you don't mind this post but I have lost my OS maps. I have greasemonkey and also the geo map enhancements but no OS showing. What have I done!! :unsure:

Just a thought, but have you recently cleaned out your browser by deleting cookies, temporary internet files, etc ? If so, that's where your custom mapsource data is held. Been there, done that. You just need to add the OS Maps source back in using the same method you did originally. Earlier posts in this thread #705, #706, #708, & #711 discuss this.

 

If that doesn't solve the problem for you, I'll need more details about what's happening (or not) before I can help. Have you tried the tips on the troubleshooting page? http://geo.inge.org.uk/gme_trouble.htm

Link to comment

This is the problem: test googlemaps api:

if (document.querySelector("script[src*='//maps.googleapis.com/']")){
 console.warn("Geocaching Map Enhancements requires Leaflet Maps to be enabled.");
 return;
}

It can be change to

if (document.querySelector("script[src*='//anymap.googleapis.com/']")){
 console.warn("Geocaching Map Enhancements requires Leaflet Maps to be enabled.");
 return;
}

or

if (document.querySelector("script[src*='//maps.googleapis.com/']")){
 console.warn("Geocaching Map Enhancements requires Leaflet Maps to be enabled.");
 //return;
}

but it is not system solution.

Link to comment

Quick fix - comment out line 2683 with //

 

//	return;

 

Where can I find/open this script to make this change (Firefox)? I have a reasonably good understanding of what I'm doing, just can't find the core script to edit. Adding a link to a correct script for an easy click and use would also be awesome.

Link to comment

This is the problem: test googlemaps api:

if (document.querySelector("script[src*='//maps.googleapis.com/']")){
 console.warn("Geocaching Map Enhancements requires Leaflet Maps to be enabled.");
 return;
}

It can be change to

if (document.querySelector("script[src*='//anymap.googleapis.com/']")){
 console.warn("Geocaching Map Enhancements requires Leaflet Maps to be enabled.");
 return;
}

or

if (document.querySelector("script[src*='//maps.googleapis.com/']")){
 console.warn("Geocaching Map Enhancements requires Leaflet Maps to be enabled.");
 //return;
}

but it is not system solution.

 

I'll have a go at fixing this properly tonight after I'm back from work - screaming children and wife permitting! I'll post here once it's done - not everyone seems to get automatic updates.

Link to comment

Quick fix - comment out line 2683 with //

 

//	return;

 

Where can I find/open this script to make this change (Firefox)? I have a reasonably good understanding of what I'm doing, just can't find the core script to edit. Adding a link to a correct script for an easy click and use would also be awesome.

 

In Firefox Go to Menu -> Addons

--User scripts

--Click on 'Options' in GME

--click on "Edit this user script"

Link to comment

Quick fix - comment out line 2683 with //

 

//	return;

 

Thanks JimJinks for such a speedy resolution to the problem, which means that GME is now working for me again.

 

Thanks also to jri for keeping up with Groundpspeak changes. This is still by far, my most helpful browser extension and being without the Ordnance Survey maps leaves me bereft! :(

Link to comment

Quick fix - comment out line 2683 with //

 

//	return;

 

Thanks JimJinks for such a speedy resolution to the problem, which means that GME is now working for me again.

 

Thanks also to jri for keeping up with Groundpspeak changes. This is still by far, my most helpful browser extension and being without the Ordnance Survey maps leaves me bereft! :(

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...