Changes in / [30:20]


Ignore:
Location:
/trunk/npemap.org.uk
Files:
1 added
3 deleted
2 edited

Legend:

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

    r30 r20  
    44        <link rel="stylesheet" type="text/css" href="grid.css">
    55    </head>
    6 <body onload="initializePage(); doResize(); go();"  onResize="doResize() ">
     6<body onload="initializePage(); initialGrid(); go();"  onResize="window.location.href = window.location.href;">
    77<!-- Yahoo functions -->
    88<script src="yahoo.js"></script>
     
    1212<script src="postcode.js"></script>
    1313        <h1 id=theTitle>New popular mapping</h1>
     14   
     15<p id=msgCall>JavaScript not enabled: Set your browser to use JavaScript.</p>
    1416
    1517<div id="main_page">
     
    5557
    5658  <div id="map">
     59  <script type="text/javascript">
     60    drawTable()
     61  </script>
    5762  </div>
    5863</div>
  • /trunk/npemap.org.uk/static/tiles/mapTiles.js

    r30 r20  
    1818
    1919var prefixes = new Array(1);
    20 var root = "http://tile.npemap.org.uk/";
     20var root = "http://npe-tiles.torchboxapps.com/";
    2121
    2222prefixes[1] = root + "scaled1/";
     
    3434
    3535
    36 
     36if (document.body.clientWidth) {
     37  sizeGridX = Math.round(((document.body.clientWidth) / tileWidth)-2)
     38  sizeGridY = Math.round(((document.body.clientHeight) / tileHeight)-1)
     39 }     
    3740
    3841function zoomOut() {
     
    6467}
    6568
    66 
    67 // YAHOO.util.Dom.getViewportWidth(),
    68 
    69 
    70 var screenWidth = YAHOO.util.Dom.getViewportWidth();
    71 var screenHeight = YAHOO.util.Dom.getViewportHeight();
    72 
    73 function doResize() {
    74   screenWidth = YAHOO.util.Dom.getViewportWidth();
    75   screenHeight = YAHOO.util.Dom.getViewportHeight();
    76   drawTable();
    77   refreshGrid();
    78 }
    7969function drawTable() {
    80   sizeGridX = Math.round((screenWidth / tileWidth)-2)
    81   sizeGridY = Math.round((screenHeight / tileHeight)-1)
    82   mapElement = document.getElementById('map');
    83  
    84   page = ''
    85   for(var y=sizeGridY; y>=1; y--) {
    86     for(var x=1; x<=sizeGridX; x++) {
    87       page += '<img width=' + tileWidth + ' height=' + tileHeight + ' id=element' + x + '.' + y + '>';
    88      }
    89      page += '<br>';
    90   }
    91  
    92   mapElement.innerHTML = page
     70        for(var y=sizeGridY; y>=1; y--) {
     71        for(var x=1; x<=sizeGridX; x++) {
     72      document.write('<img width=' + tileWidth + ' height=' + tileHeight + ' id=element' + x + '.' + y + '>')
     73        }
     74        document.write('<br>')
     75        }
    9376}
    9477
     
    11194
    11295    prefix = prefixes[zoomLevel];
     96
     97    document.getElementById('msgCall').innerHTML = 'Ajax Enabled.';
    11398}
    11499
    115100
    116101function refreshGrid() {
    117  
    118102        for(var x=1; x<=sizeGridX; x++) {
    119103                for(var y=1; y<=sizeGridY; y++) {
     
    128112}
    129113
     114function initialGrid() {
     115    document.getElementById('msgCall').innerHTML = 'Function Called: Grid initialization...';
     116    refreshGrid();
     117}
     118
    130119function updatePermalink(tileX,tileY) {
    131120        document.getElementById("permalink").href = "?" + offsetGridX + "," + offsetGridY + "," + zoomLevel;
     
    134123
    135124function updateGrid(theDirection) {
     125    document.getElementById('msgCall').innerHTML = 'Function Called: Update Grid:' + theDirection;
    136126    if ( theDirection == 'right' ) {
    137127        if ( offsetGridX < size-sizeGridX )
Note: See TracChangeset for help on using the changeset viewer.