Changeset 144
- Timestamp:
- Oct 23, 2006, 6:56:23 PM (14 years ago)
- Location:
- trunk/npemap.org.uk/static
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/npemap.org.uk/static/default.css
r132 r144 35 35 margin: 4px; 36 36 } 37 38 span.terms { 39 margin-top: 0px; 40 font-family: sans; 41 font-size: 65%; 42 line-height: 100%; 43 } -
trunk/npemap.org.uk/static/index.html
r143 r144 47 47 48 48 <form onsubmit="return find()"> 49 <p><label for="where">Place Name</label>50 <input id="where" name="where" /> </p>51 < p><input type="submit" name="Zoom To" /></p>49 <p><label for="where">Place:</label> 50 <input id="where" name="where" /> 51 <input type="submit" name="Zoom To" value="Go" /></p> 52 52 </form> 53 <span class="terms">Functionality by <a href="http://geonames.org/">Geonames</a>.</span> 53 54 </div> 54 55 … … 83 84 var easting = Math.round(en.easting/1000); 84 85 var northing = Math.round(en.northing/1000); 85 window.location= urlFor(easting, northing, 1);86 location.href = urlFor(easting, northing, 1); 86 87 } 87 88 else { … … 101 102 var y = (img.height-(YAHOO.util.Event.getPageY(e) - imgPos[1])) * 2; 102 103 103 window.location=(urlFor(x, y, 1));104 location.href=(urlFor(x, y, 1)); 104 105 105 106 YAHOO.util.Event.stopEvent(e); -
trunk/npemap.org.uk/static/tiles/map.html
r142 r144 11 11 <script src="event.js"></script> 12 12 <!-- Our functions --> 13 <script src="jsr_class.js"></script> 14 <script src="jscoord-1.1.1.js"></script> 13 15 <script src="mapTiles.js"></script> 14 16 <h1 id=theTitle>New Popular Edition Maps</h1> … … 50 52 <a href="/reportBug.html">problem?</a> 51 53 </div> 54 <div> 55 <form onsubmit="return find()"> 56 <p><label for="where">Place name:</label><br/> 57 <input id="where" name="where" /> 58 <input type="submit" name="Zoom To" value="Go" /></p> 59 </form> 60 <span class="terms">Functionality by <a href="http://geonames.org/">Geonames</a>.</span> 61 </div> 62 </div> 52 63 </div> 53 64 <div id="map_container" style="float:left"> -
trunk/npemap.org.uk/static/tiles/mapTiles.js
r142 r144 224 224 } 225 225 226 function gotoLocation(easting, northing, zoom) { 227 offsetGridX = easting; 228 offsetGridY = northing; 229 zoomLevel = zoom; 230 refreshGrid(); 231 } 232 226 233 227 234 // Need to use substring for IE, and it doesn't take negative numbers. … … 360 367 361 368 362 363 369 function find() { 370 request = 'http://ws.geonames.org/searchJSON?name=' + encodeURIComponent(document.getElementById('where').value) + '&maxRows=1&callback=getLocation&country=GB&fclass=P&style=SHORT'; 371 aObj = new JSONscriptRequest(request); 372 // Build the script tag 373 aObj.buildScriptTag(); 374 // Execute (add) the script tag 375 aObj.addScriptTag(); 376 return false; 377 } 378 // this function will be called by our JSON callback 379 function getLocation(jData) { 380 if (jData == null) { 381 // There was a problem parsing search results 382 return; 383 } 384 385 var geonames = jData.geonames; 386 if (geonames.length > 0) { 387 var name = geonames[0]; 388 var ll = new LatLng(name.lat,name.lng); 389 ll.WGS84ToOSGB36(); 390 var en = ll.toOSRef(); 391 var easting = Math.round(en.easting/1000); 392 var northing = Math.round(en.northing/1000); 393 gotoLocation(easting, northing, 1); 394 395 document.getElementById('where').value = ''; 396 } 397 else { 398 alert("Sorry, can't find that location"); 399 } 400 } 401 402
Note: See TracChangeset
for help on using the changeset viewer.