Changeset 192
 Timestamp:
 Oct 26, 2006, 9:56:28 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/npemap.org.uk/static/tiles/mapTiles.js
r190 r192 49 49 50 50 var mapContainerElement; 51 var mapElement;52 51 var markerElement; 53 52 var postcodeFormElement; 54 var locationElement;55 53 var mainPageElement; 56 54 var spinnerElement; … … 116 114 YAHOO.util.Dom.setXY(postcodeFormElement, [Math.max(0, (x50)), (y180) < 0 ? (y+10):(y180)]); 117 115 fixIE(postcodeFormElement); 118 locationElement.innerHTML = easting + ', ' + northing ;116 $('location').innerHTML = easting + ', ' + northing ; 119 117 $('easting').value = easting; 120 118 $('northing').value = northing; … … 175 173 sizeGridX = Math.round((screenWidth / tileWidth)2) 176 174 sizeGridY = Math.round((screenHeight / tileHeight)1) 177 mapElement = $('map');178 175 179 176 page = '' … … 185 182 } 186 183 187 mapElement.innerHTML = page184 $('map').innerHTML = page 188 185 } 189 186 … … 198 195 199 196 function initializePage() { 200 mapElement = $('map');201 197 mapContainerElement = $('map_container'); 202 198 markerElement = $('marker'); 203 199 postcodeFormElement = $('postcode_form'); 204 locationElement = $('location');205 200 mainPageElement = $('main_page'); 206 201 spinnerElement = $('spinner'); … … 258 253 for(var x=1; x<=sizeGridX; x++) { 259 254 for(var y=1; y<=sizeGridY; y++) { 260 // Update the table using the array data from position 0,0. 261 tileX = trimNumber(x+offsetGridXMath.round(sizeGridX/2)); 262 tileY = trimNumber(y+offsetGridYMath.round(sizeGridY/2)); 255 tileX = x+offsetGridXMath.round(sizeGridX/2); 256 tileY = y+offsetGridYMath.round(sizeGridY/2); 263 257 $('element' + x + '.' + y).src = tileURL(tileX, tileY); 264 258 } … … 280 274 function tileURL(tileX, tileY) { 281 275 var root = (tileX % 2) == 0 ? root1 : root2; 282 return root + prefixes[zoomLevel]+t ileX+'/'+ tileY+ '.jpg';276 return root + prefixes[zoomLevel]+trimNumber(tileX)+'/'+ trimNumber(tileY) + '.jpg'; 283 277 } 284 278
Note: See TracChangeset
for help on using the changeset viewer.