Changeset 524 for trunk


Ignore:
Timestamp:
Apr 10, 2007, 7:41:48 PM (13 years ago)
Author:
Nick Burch
Message:

Add /go/, with support for /go/?Oxford to take you straight to Oxford

Location:
trunk/npemap.org.uk/static
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/static/index.html

    r505 r524  
    99<script src="tiles/prototype.js" type="text/javascript"></script>
    1010<script src="find.js" type="text/javascript"></script>
     11<script src="indexPage.js" type="text/javascript"></script>
    1112
    1213<div id="body">
     
    9091
    9192<script type="text/javascript">
    92 var ROOTURL = ".";
    93 
    94 // The X offset
    95 // (The number of pixels that were trimmed from the left of the thumbnail
    96 //   image, when it was created to start at 0,0 , but after it was halved
    97 //   in size)
    98 var xOffset = 38;
    99 
    100 function gotoLocation(easting, northing, zoom) {
    101     location.href = urlFor(easting, northing, zoom);
    102 }
    103 
    104 
    105 function click(e) {
    106        
    107   e = YAHOO.util.Event.getEvent(e);
    108   var img = YAHOO.util.Event.getTarget(e);
    109   var imgPos = YAHOO.util.Dom.getXY(img);
    110 
    111         var x = (xOffset + YAHOO.util.Event.getPageX(e) - imgPos[0]) * 2;
    112         var y = (img.height-(YAHOO.util.Event.getPageY(e) - imgPos[1])) * 2;
    113 
    114         location.href=(urlFor(x, y, 3));
    115 
    116         YAHOO.util.Event.stopEvent(e);
    117 }
    118 
     93// Attach an onclick action to the thumbnail image
    11994YAHOO.util.Event.addListener("link", "click", click);
    120 
    121 var zooms = new Array(1);
    122 zooms[1] = 1;
    123 zooms[2] = 3;
    124 zooms[3] = 6;
    125 
    126 function urlFor(easting, northing, zoom) {
    127   var x= Math.round(easting / zooms[zoom]);
    128   var y= Math.round(northing/ zooms[zoom]);
    129   return ROOTURL + "/tiles/map.html#" +  x + "," + y +","+zoom;
    130 }
    131 
    13295</script>
    13396
Note: See TracChangeset for help on using the changeset viewer.