Get a sneak peek at whats next for Permanent Hazards on our April 7th Office Hours!

Post Reply
Forum rules
The place to ask for help when editing in the UK.

Map Editing Guidelines . Join the UK Discord Server

[Script] WMEOpenData v3.31 (20240203)

Post by
(Split from thread formerly known as OS Open Data mistakes)
Dave2084 wrote: I'm using the OS data more and more, definitely the best resource out there.
I'd there a better viewer than the OS one? I'd like to use more of the screen!
















 
I too was getting a bit frustrated at the small map window offered by the OS site, so I had a quick play around with greasemonkey and came up with the following:

Code: Select all

// ==UserScript==
// @name OS OpenData FullHeight
// @namespace http://greasemonkey.chizzum.com
// @description Increases height of map window on OS OpenData site
// @include http://www.ordnancesurvey.co.uk/oswebsite/opendata/viewer/*
// ==/UserScript==

var elmDeleted = document.getElementById("sitefooter");
elmDeleted.parentNode.removeChild(elmDeleted);
var elmDeleted = document.getElementById("logos");
elmDeleted.parentNode.removeChild(elmDeleted);

var elmModify = document.getElementById("wrapper");
elmModify.style.padding = '4px';
var elmModify = document.getElementById("mapmast");
elmModify.style.height = '16px';
var elmModify = document.getElementById("map");
elmModify.style.height = (window.innerHeight-30)+'px';


The latest version (see thread title) can be dowloaded from https://greasyfork.org/en/scripts/1941-wme-opendata


It's my first GM script, so it's almost certain to contain at least one show-stopping bug that'll prevent it from running on any system other than mine ;) I also haven't bothered seeing if it's possible to capture the window resize event to automatically reset the map view dimensions when the browser window is resized, but a manual refresh of the page does the job almost as well.

What it does do (assuming it's working as expected - see previous disclaimer!), is remove everything outside of the map rectangle other than the boundary layers menu, and then resize everything so that it just fits within the available browser window area without requiring scroll bars. Which is nice. Originally tested using Firefox+Greasemonkey, it also appears to work OK in Chrome using its native support for GM scripts. Even nicer.


Note: this is a manually recreated copy of the original opening post which, thanks to a stupid bug in the forum software which still hasn't been fixed, prevents messages imported from the older forum from being edited if they contain certain character sequences - this inability to edit the opening post at all meant I wasn't previously able to update the version/release date in the thread title, so it looked like I'd abandoned development...
 
 
 
 
 
 
 

POSTER_ID:16778143

1

Send a message
Last edited by Twister-UK on Sat Feb 03, 2024 1:58 am, edited 133 times in total.

Post by atrophicshiner
Loving the dual/alt name, works really well :D
atrophicshiner
Waze Local Champs
Waze Local Champs
Posts: 5989
Answers: 8
Has thanked: 1600 times
Been thanked: 2326 times
Send a message
- Chris - (Catching up with the Ia{i}ns one Chris at a time)

https://cottagepi.uk/proud-wazer.gifhttps://cottagepi.uk/pirate.pnghttps://cottagepi.uk/Beta_app.pnghttps://cottagepi.uk/tolls.pnghttps://cottagepi.uk/Iain.png
UK Local Champ would you believe
AM the Middle bit of England
Usability | Simplicity | Retention

Post by atrophicshiner
As always thanks for the massive effort you put into this script.... you can guess what's coming next...

When working on my laptop with the limited screen size of 1440x900, I have previous had issue when WMEOD lists a large number of name suggestions, but this update kinda makes it happen with only a couple of names.
https://i.ibb.co/JrfDgQH/Screenshot-202 ... -53-27.png

The issue being the WMEOD window gets shoved off the top of my map window and I can no longer minimise it. It appears the the bottom of WMEOD has a hard limit of the bottom of the map screen rather than overrunning it. Would it be possible to change this behaviour so the top bar of WMEOD always stays where you drag it and the bottom overruns off the visible screen :?:

This doesn't seem to happen you select a segment for name lookup, but if you minimise WMEOD and then expand again. Still trying to figure out a repeatable procedure.

EDIT: Now with video to show behaviour - download link [2.8MB MOV]
atrophicshiner
Waze Local Champs
Waze Local Champs
Posts: 5989
Answers: 8
Has thanked: 1600 times
Been thanked: 2326 times
Send a message
- Chris - (Catching up with the Ia{i}ns one Chris at a time)

https://cottagepi.uk/proud-wazer.gifhttps://cottagepi.uk/pirate.pnghttps://cottagepi.uk/Beta_app.pnghttps://cottagepi.uk/tolls.pnghttps://cottagepi.uk/Iain.png
UK Local Champ would you believe
AM the Middle bit of England
Usability | Simplicity | Retention

Post by atrophicshiner
All this has made some interesting behaviour when you take the WMEOD bar off the right of the browser screen :lol: Not a bug, a feature ;)
atrophicshiner
Waze Local Champs
Waze Local Champs
Posts: 5989
Answers: 8
Has thanked: 1600 times
Been thanked: 2326 times
Send a message
- Chris - (Catching up with the Ia{i}ns one Chris at a time)

https://cottagepi.uk/proud-wazer.gifhttps://cottagepi.uk/pirate.pnghttps://cottagepi.uk/Beta_app.pnghttps://cottagepi.uk/tolls.pnghttps://cottagepi.uk/Iain.png
UK Local Champ would you believe
AM the Middle bit of England
Usability | Simplicity | Retention

Post by BtBalways
Thank you so much
Just having the Map back is sufficient for me after the shock of a minute server error message being the previous result of clicking the link.

It is to be hoped that the changes to WME can be seen as a progressive beneficial development in an overall strategy rather than a random "wouldn't it be a good idea if we did...." but whether it can be seen that way from a coders point of view....
BtBalways
Waze Mentor
Waze Mentor
Posts: 954
Answers: 1
Has thanked: 1014 times
Been thanked: 221 times
Send a message

Post by CTCNetwork
Hi,
timbucks wrote:So is it just a case of putting the code in a text file, saving it as .crx (IIRC) and then double-clicking to install as an extension?
These are actually .js files. however the only way I have found to get them to work is to install from a site (such as userscripts).

Works fine in FF 12.0 Nice work... :)

Des. . . ;)
CTCNetwork
Posts: 1610
Has thanked: 49 times
Been thanked: 193 times
Send a message

Post by CTCNetwork
HI,

Still not working for me at all. Or am I just having a blonde moment..

Des. . . ;)
CTCNetwork
Posts: 1610
Has thanked: 49 times
Been thanked: 193 times
Send a message

Post by CTCNetwork
Hi,

I thought something had changed! I added the new url to the existing script which worked perfectly. :)
Only noticed this yesterday..

Des. . . ;)
CTCNetwork
Posts: 1610
Has thanked: 49 times
Been thanked: 193 times
Send a message

Post by CTCNetwork
Hi,

I am starting to doubt the quality, accuracy and validity of ordinance survey/open data to a high degree. And given quite a bit of OpenStreetMap is based on what you get from ordinance survey, that is no better!
I mean, when you look at the map and it defines a town/village as being called "This Village" you don't expect to see on street view a sign just outside the village with "Another Village" on it (and that sign being placed on both entrance and exit to said town/village)!

Or maybe people don't actually know where they live?

Des. . . ;)
CTCNetwork
Posts: 1610
Has thanked: 49 times
Been thanked: 193 times
Send a message

Post by CTCNetwork
Hi,

Yes, there does seem to be a bad case of "blur" but never seen it that badly that one village is given the name of another..!
Or I'm having a bad week/day/whatever. :D

Des. . . ;)
CTCNetwork
Posts: 1610
Has thanked: 49 times
Been thanked: 193 times
Send a message

Post by CTCNetwork
Hi,

N.I.? Naa.. Love to help you but I'd need to drive around a bit to familiarise myself. :)

I have noticed in Derby and Notts in particular there are areas/suburbs that have no meaning or context to those areas, Wiki info on the burbs for Nottingham is pretty clear and straight forward (finding them is another matter!) but the script mentions places that leave me lost and confused!! :D

Des. . . ;)
CTCNetwork
Posts: 1610
Has thanked: 49 times
Been thanked: 193 times
Send a message