Changeset 451 for trunk


Ignore:
Timestamp:
Jan 21, 2007, 11:08:45 AM (13 years ago)
Author:
Nick Burch
Message:

New thumbnail, and new JS

Location:
trunk/gpx.npemap.org.uk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gpx.npemap.org.uk/index.html

    r191 r451  
    8181
    8282<script type="text/javascript">
    83 var xOffset = 62;
     83// The X offset
     84// (The number of pixels that were trimmed from the left of the thumbnail
     85//   image, when it was created to start at 0,0 , but after it was halved
     86//   in size)
     87var xOffset = 38;
    8488
    8589function find() {
  • trunk/gpx.npemap.org.uk/js/mapTiles.js

    r188 r451  
    198198// Need to use substring for IE, and it doesn't take negative numbers.
    199199function trimNumber(string) {
    200   str = '000' + string
     200        // If we have a 4 digit number, no need to do any padding
     201        if(parseInt(string) >= 1000) { return string; }
     202
     203        // Pad it so that it'll always have leading 0s, and be at least 3 long
     204        str = '000' + string
     205        // Grab the right most 3 digits, which will have any required padding
    201206        return str.substring(str.length -3)
    202207}
    203208
    204209function trimSixDigits(string) {
    205   str = '000000' + string
     210        // If we have a 7 digit number, no need to do any padding
     211        if(parseInt(string) >= 1000000) { return string; }
     212
     213        // Pad it so that it'll always have leading 0s, and be at least 6 long
     214        str = '000000' + string
     215        // Grab the right most 6 digits, which will have any required padding
    206216        return str.substring(str.length -6)
    207217}
Note: See TracChangeset for help on using the changeset viewer.