source: trunk/npemap.org.uk/static/distantPostcodes.html @ 206

Last change on this file since 206 was 206, checked in by Nick Burch, 13 years ago

Include source in display

File size: 1.6 KB
Line 
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="distant">
12</div>
13
14<script type="text/javascript">
15var distant = document.getElementById("distant");
16
17function addProblem(id,postcode,matchpart,easting,northing,avg_e,avg_n,source_id,source_name) {
18        var disp_source = "NPE Submission";
19        if(source_id == 1) {
20                disp_source = "FreeThePostcode";
21        }
22
23        var div = document.createElement("div");
24        div.appendChild(document.createTextNode(postcode + " (" + id + " - " + disp_source + "), matched from " + matchpart + ", was at "));
25
26        var pl = document.createElement("a");
27        pl.appendChild(document.createTextNode(easting + " " + northing));
28        pl.href = "tiles/map.html#" + Math.round(easting/1000) + "," + Math.round(northing/1000) + ",1";
29        div.appendChild(pl);
30
31        div.appendChild(document.createTextNode(", instead of at "));
32
33        var al = document.createElement("a");
34        al.appendChild(document.createTextNode(avg_e + " " + avg_e));
35        al.href = "tiles/map.html#" + Math.round(avg_e/1000) + "," + Math.round(avg_n/1000) + ",1";
36        div.appendChild(al);
37
38        var e_km = Math.abs(Math.round((easting-avg_e)/1000));
39        var n_km = Math.abs(Math.round((northing-avg_n)/1000));
40        div.appendChild(document.createTextNode(", out by " + e_km + "km and " + n_km + "km"));
41
42        distant.appendChild(div);
43}
44</script>
45
46<!-- Can also do get-distant-postcodes.fcgi?outer1=yes -->
47<script type="text/javascript" src="/cgi/get-distant-postcodes.fcgi"></script>
48
49</body>
50</html>
Note: See TracBrowser for help on using the repository browser.