Changeset 24 for trunk/npemap.org.uk
- Timestamp:
- Oct 12, 2006, 9:50:03 AM (15 years ago)
- Location:
- trunk/npemap.org.uk/static/tiles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/npemap.org.uk/static/tiles/map.html
r18 r24 4 4 <link rel="stylesheet" type="text/css" href="grid.css"> 5 5 </head> 6 <body onload="initializePage(); initialGrid(); go();" onResize="window.location.href = window.location.href;">6 <body onload="initializePage(); doResize(); go();" onResize="doResize() "> 7 7 <!-- Yahoo functions --> 8 8 <script src="yahoo.js"></script> … … 57 57 58 58 <div id="map"> 59 <script type="text/javascript">60 drawTable()61 </script>62 59 </div> 63 60 </div> -
trunk/npemap.org.uk/static/tiles/mapTiles.js
r22 r24 34 34 35 35 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 40 37 41 38 function zoomOut() { … … 67 64 } 68 65 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 } 69 79 function 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 76 93 } 77 94 … … 94 111 95 112 prefix = prefixes[zoomLevel]; 96 97 113 document.getElementById('msgCall').innerHTML = 'Ajax Enabled.'; 98 114 } … … 100 116 101 117 function refreshGrid() { 118 102 119 for(var x=1; x<=sizeGridX; x++) { 103 120 for(var y=1; y<=sizeGridY; y++) { … … 110 127 111 128 updatePermalink(); 112 }113 114 function initialGrid() {115 document.getElementById('msgCall').innerHTML = 'Function Called: Grid initialization...';116 refreshGrid();117 129 } 118 130
Note: See TracChangeset
for help on using the changeset viewer.