source: trunk/npemap.org.uk/static/index.html @ 351

Last change on this file since 351 was 351, checked in by Dominic Hargreaves, 14 years ago

Link stats page in

File size: 4.5 KB
Line 
1<!--#set var="title" value="New Popular Edition Maps" -->
2<!--#set var="link" value="/" -->
3<!--#include virtual="inc/header.shtml" -->
4<script src="tiles/yahoo.js" type="text/javascript"></script> 
5<script src="tiles/dom.js" type="text/javascript"></script> 
6<script src="tiles/event.js" type="text/javascript"></script> 
7<script src="tiles/jsr_class.js" type="text/javascript"></script> 
8<script src="tiles/jscoord-1.1.1.js" type="text/javascript"></script> 
9
10<div id="body">
11
12<div class="left-col"> 
13<ul>
14<li>Want to keep updated? <a href="news/">News</a> <a href="news/index.rss" class="feed">RSS</a></li>
15<li>Questions? <a href="FAQ.html">FAQ</a></li>
16<li>Problems? <a href="reportBug.html">Tell us</a></li>
17<li>Scotland? Northern Ireland? <a href="scotlandAndNI.html">Be informed</a></li>
18<li>Worried about your data? <a href="privacy.html">Privacy policy</a></li>
19<li>Interested in our maps? <a href="tileLicence.html">Licence</a></li>
20</ul>
21
22<ul>
23<li><a href="data/">Download postcode data</a></li>
24<li><a href="postcodeine/">Show postcodes on map</a></li>
25<li><a href="http://technology.guardian.co.uk/weekly/story/0,,1936557,00.html">Read about us in the Guardian!</a></li>
26</ul>
27
28<h3>Postcode statisticts (<a href="stats/">more</a>)</h3>
29
30<!--#include virtual="stats/summary.html" -->
31
32</div>
33<div class="mid-col"> 
34
35<p> Have a look round what the country looked like in the 1940s. Click on the
36map to the right to start, you can then scroll around and zoom in.  </p>
37
38<div id="postcodeinfobox">
39<p> Whilst looking around, you can tell us about the postcode of where you are
40looking. We want to collect information about where postcodes are now by
41finding them on old maps.</p>
42<p>All you need to do is click on the the point in the map and fill in the
43postcode. Why not add your house, your place of work, and those of your
44friends and family, to help us build a free postcode database?
45There is more detail about why we want to do this in
46the <a href="FAQ.html">FAQ</a>.</p>
47</div>
48
49</div>
50<div class="right-col">
51<p>
52Click on the map to zoom in and get on with it.
53</p>
54<script type="text/javascript">
55document.write(' <a href="#" id="link"> <img src="thumbnail.jpg" alt="Click this map to zoom"/> </a>');
56</script>
57<noscript>
58This site requires javascript
59</noscript>
60
61<form onsubmit="return find()" action="">
62<p>
63<script type="text/javascript">
64document.write(' <label for="where">Place:</label><input id="where" name="where" /> <input type="submit" name="Zoom To" value="Go" />');
65</script>
66</p>
67</form>
68      <span class="terms">Functionality by <a href="http://www.geonames.org/">Geonames</a>.</span>
69</div>
70
71<script type="text/javascript">
72var ROOTURL = ".";
73
74var xOffset = 62;
75
76function find() {
77   request = 'http://ws.geonames.org/searchJSON?name=' +  encodeURIComponent(document.getElementById('where').value)  + '&maxRows=1&callback=getLocation&country=GB&fclass=P&style=SHORT';
78  aObj = new JSONscriptRequest(request);
79  // Build the script tag
80  aObj.buildScriptTag();
81  // Execute (add) the script tag
82  aObj.addScriptTag();
83  return false;
84}
85
86// this function will be called by our JSON callback
87function getLocation(jData) {
88  if (jData == null) {
89    // There was a problem parsing search results
90    return;
91  }
92
93  var geonames = jData.geonames;
94  if (geonames.length > 0) {
95    var name = geonames[0];
96    var ll = new LatLng(name.lat,name.lng);
97    ll.WGS84ToOSGB36();
98    var en = ll.toOSRef();
99    var easting = Math.round(en.easting/1000);
100    var northing = Math.round(en.northing/1000);
101    location.href = urlFor(easting, northing, 1);
102  }
103  else {
104    alert("Sorry, can't find that location"); 
105  }
106}
107
108
109
110function click(e) {
111       
112  e = YAHOO.util.Event.getEvent(e);
113  var img = YAHOO.util.Event.getTarget(e);
114  var imgPos = YAHOO.util.Dom.getXY(img);
115
116        var x = (xOffset + YAHOO.util.Event.getPageX(e) - imgPos[0]) * 2;
117        var y = (img.height-(YAHOO.util.Event.getPageY(e) - imgPos[1])) * 2;
118
119        location.href=(urlFor(x, y, 3));
120
121        YAHOO.util.Event.stopEvent(e);
122}
123
124YAHOO.util.Event.addListener("link", "click", click);
125
126var zooms = new Array(1);
127zooms[1] = 1;
128zooms[2] = 3;
129zooms[3] = 6;
130
131function urlFor(easting, northing, zoom) {
132  var x= Math.round(easting / zooms[zoom]); 
133  var y= Math.round(northing/ zooms[zoom]); 
134  return ROOTURL + "/tiles/map.html#" +  x + "," + y +","+zoom;
135}
136
137</script>
138
139</div>
140<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
141</script>
142<script type="text/javascript">
143_uacct = "UA-732621-2";
144if (typeof urchinTracker == 'function') urchinTracker();
145</script>
146<!--#include virtual="inc/footer.shtml" -->
Note: See TracBrowser for help on using the repository browser.