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

Last change on this file since 162 was 162, checked in by David Sheldon, 14 years ago

Validation improvements.

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