Changeset 180


Ignore:
Timestamp:
Oct 26, 2006, 12:50:25 PM (13 years ago)
Author:
David Sheldon
Message:

Alternate columns from uk/us.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/static/tiles/mapTiles.js

    r175 r180  
    2222
    2323var prefixes = new Array(1);
     24var root1 = "http://ustile.npemap.org.uk/";
     25var root2 = "http://tile.npemap.org.uk/";
    2426var root = "http://ustile.npemap.org.uk/";
    2527
    26 prefixes[1] = root + "scaled1/";
    27 prefixes[2] = root + "scaled3/";
    28 prefixes[3] = root + "scaled6/";
     28prefixes[1] = "scaled1/";
     29prefixes[2] = "scaled3/";
     30prefixes[3] = "scaled6/";
    2931
    3032var jumpOut = new Array(1);
     
    4042zooms[3] = 6;
    4143
    42 var prefix;
    4344
    4445var screenWidth = YAHOO.util.Dom.getViewportWidth();
     
    155156
    156157function fixZoomButton() {
    157   prefix = prefixes[zoomLevel];
    158158  if(zoomLevel == 1) {
    159159    $('zoomin_enabled').style.visibility = 'hidden';
     
    210210  fixZoomButton();
    211211
    212   prefix = prefixes[zoomLevel];
    213212  doResize();
    214213}
     
    262261            tileX = trimNumber(x+offsetGridX-Math.round(sizeGridX/2));
    263262            tileY = trimNumber(y+offsetGridY-Math.round(sizeGridY/2));
    264             $('element' + x + '.' + y).src = prefix+tileX+'/'+ tileY + '.jpg';
     263            $('element' + x + '.' + y).src = tileURL(tileX, tileY);
    265264        }
    266265    }
     
    277276  firstTime = 0;
    278277        updatePermalink();
     278}
     279
     280function tileURL(tileX, tileY) {
     281          var root = (tileX % 2) == 0 ? root1 : root2;
     282                return root + prefixes[zoomLevel]+tileX+'/'+ tileY + '.jpg';
    279283}
    280284
Note: See TracChangeset for help on using the changeset viewer.