Changeset 58
- Timestamp:
- Oct 16, 2006, 1:24:09 PM (14 years ago)
- Location:
- trunk/npemap.org.uk/static/tiles
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/npemap.org.uk/static/tiles/allmaps.html
r57 r58 4 4 <title>England and Wales maps</title> 5 5 </head> 6 <script src="yahoo.js"></script> 7 <script src="dom.js"></script> 6 8 7 9 <body> -
trunk/npemap.org.uk/static/tiles/mapTiles.js
r53 r58 115 115 } 116 116 117 // Need to use substring for IE, and it doesn't take negative numbers. 118 function trimNumber(string) { 119 str = '000' + string 120 return str.substring(str.length -3) 121 } 117 122 118 123 function refreshGrid() { … … 121 126 for(var y=1; y<=sizeGridY; y++) { 122 127 // Update the table using the array data from position 0,0. 123 tileX = ('000'+(x+offsetGridX-Math.round(sizeGridX/2))).substr(-3);124 tileY = ('000'+(y+offsetGridY-Math.round(sizeGridY/2))).substr(-3);128 tileX = trimNumber(x+offsetGridX-Math.round(sizeGridX/2)); 129 tileY = trimNumber(y+offsetGridY-Math.round(sizeGridY/2)); 125 130 document.getElementById('element' + x + '.' + y).src = prefix+tileX+'/'+ tileY + '.jpg'; 126 131 } … … 149 154 var successHandler = function(o){ 150 155 eval(o.responseText); 156 //alert(o.responseText); 151 157 } 152 158 153 159 var failHander = function(o) { 154 160 // Don't do anything 155 //alert("Failed");161 alert("Failed"); 156 162 } 157 163
Note: See TracChangeset
for help on using the changeset viewer.