1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
---|
2 | |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <title>Distant Postcodes | New Popular Edition Maps</title> |
---|
6 | </head> |
---|
7 | |
---|
8 | <body> |
---|
9 | <h1>Distant Postcodes</h1> |
---|
10 | |
---|
11 | <div id="actions"> |
---|
12 | </div> |
---|
13 | |
---|
14 | <br /> |
---|
15 | |
---|
16 | <div id="distant"> |
---|
17 | </div> |
---|
18 | |
---|
19 | <script type="text/javascript"> |
---|
20 | var actions = document.getElementById("actions"); |
---|
21 | var distant = document.getElementById("distant"); |
---|
22 | |
---|
23 | function addProblem(id,postcode,matchpart,easting,northing,avg_e,avg_n,source_id,source_name) { |
---|
24 | var disp_source = "NPE Submission"; |
---|
25 | if(source_id == 1) { |
---|
26 | disp_source = "FreeThePostcode"; |
---|
27 | } |
---|
28 | |
---|
29 | var div = document.createElement("div"); |
---|
30 | div.appendChild(document.createTextNode(postcode + " (" + id + " - " + disp_source + "), matched from " + matchpart + ", was at ")); |
---|
31 | |
---|
32 | var pl = document.createElement("a"); |
---|
33 | pl.appendChild(document.createTextNode(easting + " " + northing)); |
---|
34 | pl.href = "tiles/map.html#" + Math.round(easting/1000) + "," + Math.round(northing/1000) + ",1"; |
---|
35 | div.appendChild(pl); |
---|
36 | |
---|
37 | div.appendChild(document.createTextNode(", instead of at ")); |
---|
38 | |
---|
39 | var al = document.createElement("a"); |
---|
40 | al.appendChild(document.createTextNode(avg_e + " " + avg_e)); |
---|
41 | al.href = "tiles/map.html#" + Math.round(avg_e/1000) + "," + Math.round(avg_n/1000) + ",1"; |
---|
42 | div.appendChild(al); |
---|
43 | |
---|
44 | var e_km = Math.abs(Math.round((easting-avg_e)/1000)); |
---|
45 | var n_km = Math.abs(Math.round((northing-avg_n)/1000)); |
---|
46 | div.appendChild(document.createTextNode(", out by " + e_km + "km and " + n_km + "km")); |
---|
47 | |
---|
48 | distant.appendChild(div); |
---|
49 | } |
---|
50 | |
---|
51 | // How should we call the script? |
---|
52 | var cgi = "/cgi/get-distant-postcodes.fcgi"; |
---|
53 | var oLink = document.createElement("a"); |
---|
54 | if(location.href.indexOf("?outer1") > 0) { |
---|
55 | cgi = cgi + "?outer1=yes"; |
---|
56 | oLink.href = "?"; |
---|
57 | oLink.appendChild(document.createTextNode("Match only by outer parts")); |
---|
58 | } else { |
---|
59 | oLink.href = "?outer1=yes"; |
---|
60 | oLink.appendChild(document.createTextNode("Match by outer in 1st inner")); |
---|
61 | } |
---|
62 | actions.appendChild(oLink); |
---|
63 | |
---|
64 | // Include the script |
---|
65 | var sc = document.createElement("script"); |
---|
66 | sc.type = "text/javascript"; |
---|
67 | sc.src = cgi; |
---|
68 | actions.appendChild(sc); |
---|
69 | </script> |
---|
70 | |
---|
71 | </body> |
---|
72 | </html> |
---|