Changes in / [20:30]


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

Legend:

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

    r20 r30  
    44        <link rel="stylesheet" type="text/css" href="grid.css">
    55    </head>
    6 <body onload="initializePage(); initialGrid(); go();"  onResize="window.location.href = window.location.href;">
     6<body onload="initializePage(); doResize(); go();"  onResize="doResize() ">
    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>
    1614
    1715<div id="main_page">
     
    5755
    5856  <div id="map">
    59   <script type="text/javascript">
    60     drawTable()
    61   </script>
    6257  </div>
    6358</div>
  • /trunk/npemap.org.uk/static/tiles/mapTiles.js

    r20 r30  
    1818
    1919var prefixes = new Array(1);
    20 var root = "http://npe-tiles.torchboxapps.com/";
     20var root = "http://tile.npemap.org.uk/";
    2121
    2222prefixes[1] = root + "scaled1/";
     
    3434
    3535
    36 if (document.body.clientWidth) {
    37   sizeGridX = Math.round(((document.body.clientWidth) / tileWidth)-2)
    38   sizeGridY = Math.round(((document.body.clientHeight) / tileHeight)-1)
    39  }     
     36
    4037
    4138function zoomOut() {
     
    6764}
    6865
     66
     67// YAHOO.util.Dom.getViewportWidth(),
     68
     69
     70var screenWidth = YAHOO.util.Dom.getViewportWidth();
     71var screenHeight = YAHOO.util.Dom.getViewportHeight();
     72
     73function doResize() {
     74  screenWidth = YAHOO.util.Dom.getViewportWidth();
     75  screenHeight = YAHOO.util.Dom.getViewportHeight();
     76  drawTable();
     77  refreshGrid();
     78}
    6979function drawTable() {
    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         }
     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
    7693}
    7794
     
    94111
    95112    prefix = prefixes[zoomLevel];
    96 
    97     document.getElementById('msgCall').innerHTML = 'Ajax Enabled.';
    98113}
    99114
    100115
    101116function refreshGrid() {
     117 
    102118        for(var x=1; x<=sizeGridX; x++) {
    103119                for(var y=1; y<=sizeGridY; y++) {
     
    112128}
    113129
    114 function initialGrid() {
    115     document.getElementById('msgCall').innerHTML = 'Function Called: Grid initialization...';
    116     refreshGrid();
    117 }
    118 
    119130function updatePermalink(tileX,tileY) {
    120131        document.getElementById("permalink").href = "?" + offsetGridX + "," + offsetGridY + "," + zoomLevel;
     
    123134
    124135function updateGrid(theDirection) {
    125     document.getElementById('msgCall').innerHTML = 'Function Called: Update Grid:' + theDirection;
    126136    if ( theDirection == 'right' ) {
    127137        if ( offsetGridX < size-sizeGridX )
Note: See TracChangeset for help on using the changeset viewer.