Changeset 717 for trunk


Ignore:
Timestamp:
Feb 7, 2010, 4:33:13 PM (10 years ago)
Author:
Nick Burch
Message:

Select the correct set of map tiles

Location:
trunk/npemap.org.uk/static/tiles
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/static/tiles/1920s/map.html

    r716 r717  
    66        <h1>Browse our maps from the 1920s</h1>
    77</div>
     8<script type="text/javascript">
     9        setVersion("1920s");
     10</script>
    811
    912<!--#include virtual="../../inc/by-decade/map-footer.shtml" -->
  • trunk/npemap.org.uk/static/tiles/1930s/map.html

    r716 r717  
    66        <h1>Browse our maps from the 1930s</h1>
    77</div>
     8<script type="text/javascript">
     9        setVersion("1930s");
     10</script>
    811
    912<!--#include virtual="../../inc/by-decade/map-footer.shtml" -->
  • trunk/npemap.org.uk/static/tiles/1940s/map.html

    r716 r717  
    66        <h1>Browse our maps from the 1940s</h1>
    77</div>
     8<script type="text/javascript">
     9        setVersion("1940s");
     10</script>
    811
    912<!--#include virtual="../../inc/by-decade/map-footer.shtml" -->
  • trunk/npemap.org.uk/static/tiles/1950s/map.html

    r716 r717  
    66        <h1>Browse our maps from the 1950s</h1>
    77</div>
     8<script type="text/javascript">
     9        setVersion("1950s");
     10</script>
    811
    912<!--#include virtual="../../inc/by-decade/map-footer.shtml" -->
  • trunk/npemap.org.uk/static/tiles/mapTiles.js

    r715 r717  
    4040var zoomLevel = 1;
    4141var grid = 'osgb'; // One of osgb or osie, for now anyway
     42var version = 'latest'; // Either "latest" or a decade eg "1920s"
    4243
    4344var needCalibration = true;
     
    300301
    301302
    302 function initializePage(skipMarkers) {
     303function setVersion(tileVersion) {
     304    if(tileVersion != null) {
     305       version = tileVersion;
     306    }
     307}
     308
     309function initializePage(skipMarkers, tileVersion) {
    303310    markerElement = $('marker');
    304311    postcodeFormElement = $('postcode_form');
    305312    mainPageElement = $('main_page');
     313
     314    if(tileVersion != null) {
     315       version = tileVersion;
     316    }
    306317
    307318        if(skipMarkers != null && skipMarkers) {
     
    428439function tileURL(tileX, tileY) {
    429440          //var root = (tileX % 2) == 0 ? root1 : root2;
    430                 return root + grid + '/' + prefixes[zoomLevel] + trimNumber(tileX)+'/'+ trimNumber(tileY) + '.jpg';
     441                return root + grid + '/' + version + '/' + prefixes[zoomLevel] + trimNumber(tileX)+'/'+ trimNumber(tileY) + '.jpg';
    431442}
    432443
Note: See TracChangeset for help on using the changeset viewer.