90509990) $grid = 89951105; if ($zoom == "") $zoom = 10; // Set default zoom if ($zoom < 5) $zoom = 10; // Set default zoom if ($year < 1701 || $year > 1999) $year = 2009; // Set default year if ($year > 1700 && $year < 1798) $year = 1768; if ($year > 1797 && $year < 1835) $year = 1828; if ($year > 1834 && $year < 1862) $year = 1852; if ($year > 1861 && $year < 1925) $year = 1891; if ($year > 1924 && $year < 1973) $year = 1960; if ($year > 1972 && $year < 1988) $year = 1986; if ($year > 1987 && $year < 2000) $year = 1990; // Restrict to nearest valid year if ($over != 2009 && $over != 1990 && $over != 1986 && $over != 1960 && $over != 1891 && $over != 1852 && $over != 1828 && $over != 1768) $over = ""; // Set default overlay // Set bounds according to zoom level if ($zoom < 10) { $range=0; // 1:500, 1 columns x 1 rows $zoom=5; $size=600; } else { if ($zoom < 20) { $range=0; // 1:1,000, 1 columns x 1 rows $zoom=10; $size=300; } else { $range=1; // 1:2,500, 3 columns x 3 rows $zoom=25; $size=100; } } echo '
' . "\n" . "\n"; echo '' . "\n"; for ($row=$range; $row>=-$range; $row--) { for ($yq=0; $yq<2; $yq++) { echo ''; echo "\n"; for ($col=-$range; $col<=$range; $col++) { for ($xq=0; $xq<2; $xq++) { echo '
'; echo "\n"; // Gridref of current quarter-block $gridref = $grid+10*$row+5-5*$yq+100000*$col+50000*$xq; // Create link from image to move map // Only suitable for 1:2,500 map // -2,+2 -1,+2 0,+2 0,+2 +1,+2 +2,+2 $yq=0 $row=+1 // -2,+1 -1,+1 0,+1 0,+1 +1,+1 +2,+1 $yq=1 +1 // -2, 0 -1, 0 0, 0 0, 0 +1,0 +2,0 $yq=0 0 // -2, 0 -1, 0 0, 0 0, 0 +1,0 +2,0 $yq=1 0 // -2,-1 -1,-1 0,-1 0,-1 +1,-1 +2,-1 $yq=0 -1 // -2,-2 -1,-2 0,-2 0,-2 +1,-2 +2,-2 $yq=1 -1 // // $xq= 0 1 0 1 0 1 // $col=-1 -1 0 0 +1 +1 // if ($zoom == 25) { echo ''; } // if ($zoom == 10) { } // if ($zoom == 5) { } // Create image filename // eg 3x3 grid // -9990 +1 +10010 // -10000 0 +10000 // -10010 -1 +9990 // // within each grid // a b // c d // $temp = mappath($gridref); $file = $temp[0].$temp[1].$temp[2].$temp[3].$temp[4].$temp[6].$temp[7].$temp[8]; if ($temp[5]=='0' && $temp[9]=='5') $file = $file . 'a'; if ($temp[5]=='5' && $temp[9]=='5') $file = $file . 'b'; if ($temp[5]=='0' && $temp[9]=='0') $file = $file . 'c'; if ($temp[5]=='5' && $temp[9]=='0') $file = $file . 'd'; echo ''; if ($over != "") { if ($over != $year) { echo "\n"; echo ''; } } echo "\n"; } } } } echo '
'; echo "\n"; echo "\n"; // Caption and links in final column echo '
'; echo "\n"; echo '
 Whitby Yards Map Browser 
J.G.Harston

'; echo "\n"; echo ' Central grid square:
  '; $temp = mappath($grid); echo strtoupper($temp[0]).strtoupper($temp[1]).' '.$temp[2].$temp[3].$temp[4].' '.$temp[6].$temp[7].$temp[8]; echo "\n

\n\n"; echo ' Map scale:
  '; echo "\n"; echo zoomlink("yard.php?g=" . $grid . "&z=5&o=" . $over . "&y=" . $year, "1:500", $zoom==5) . "\n"; echo zoomlink("yard.php?g=" . $grid . "&z=10&o=" . $over . "&y=" . $year, "1:1,000", $zoom==10) . "\n"; echo zoomlink("yard.php?g=" . $grid . "&z=25&o=" . $over . "&y=" . $year, "1:2,500", $zoom==25) . "\n"; echo "

\n\n"; echo ' Map year:
  '; echo"\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&o=" . $over . "&y=" , 1768, $year) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&o=" . $over . "&y=" , 1828, $year) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&o=" . $over . "&y=" , 1852, $year) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&o=" . $over . "&y=" , 1891, $year) . " "; echo "\n"; echo "
  \n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&o=" . $over . "&y=" , 1960, $year) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&o=" . $over . "&y=" , 1986, $year) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&o=" . $over . "&y=" , 1990, $year) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&o=" . $over . "&y=" , 2009, $year); echo "\n"; echo "

\n\n"; echo ' Shadow layer:
  '; echo"\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&y=" . $year . "&o=" , 1768, $over) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&y=" . $year . "&o=" , 1828, $over) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&y=" . $year . "&o=" , 1852, $over) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&y=" . $year . "&o=" , 1891, $over) . " "; echo "\n"; echo "
  \n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&y=" . $year . "&o=" , 1960, $over) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&y=" . $year . "&o=" , 1986, $over) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&y=" . $year . "&o=" , 1990, $over) . " "; echo "\n"; echo yearlink("yard.php?g=" . $grid . "&z=" . $zoom . "&y=" . $year . "&o=" , 2009, $over); echo "\n"; echo "

\n"; echo "\n"; echo '
Move grid:'; echo "\n"; echo '
 '; echo 'N'; echo ' '; echo "\n"; echo '
W '; echo "\n"; echo ' E'; echo "\n"; echo '
 '; echo 'S'; echo ' '; echo "\n"; echo '
'; echo "\n"; echo "\n"; echo '

Maps and Documents
'; echo "\n"; // echo 'A'; echo "\n"; // echo 'B'; echo "\n"; // echo '

'; echo "\n"; echo '
'; echo "\n"; // Document links for this grid square $temp = mappath($grid); $temp = "docs/" . $temp . ".htm"; if (is_file($temp)) { readfile($temp); } echo "\n
\n"; // mappath() // --------- // Convert numeric grid reference into Grid/Eastings/Northings path // function mappath($ref) { // $ref = "$ref"; // convert to string $path = "nz" . "$ref"; return $path; } // zoomlink() // ---------- // Give link/bold string for link to zoom levels // // zoomlink("yard.php?g=.$grid."&z=25", "1:100,000", $zoom==10) // zoomlink("yard.php?g=.$grid."&z=10", "1:50,000", $zoom==25) // // Gives, eg: 1:1,000 // or: 1:2,500 // function zoomlink($link, $text, $iszoom) { if ($iszoom) { return "" . $text . ""; } else { return '' . $text . ''; } } // yearlink() // ---------- // Give link/bold string for link to year mapping // // yearlink("yard.php?g=.$grid."&z=25&y=", 1852, $year) // // Gives, eg: 1852 // or: 1891 // function yearlink($link, $yearlink, $yearthis) { if ($yearlink == $yearthis) { return '' . $yearlink . ''; } else { return '' . $yearlink . ''; } } ?>