Changeset 8


Ignore:
Timestamp:
Oct 10, 2006, 10:20:38 PM (13 years ago)
Author:
David Sheldon
Message:

Dom's resizing of the map.

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

Legend:

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

    r6 r8  
    44        <link rel="stylesheet" type="text/css" href="grid.css">
    55    </head>
    6 <body onload="initializePage(); initialGrid();">
     6<body onload="initializePage(); initialGrid();"  onResize="window.location.href = window.location.href;">
    77<script src="mapTiles.js"></script>
    88        <h1 id=theTitle>New popular mapping</h1>
     
    4343<div id="grid" style="float:left">
    4444        <table border=1 bgcolor="red" cellpadding="10" id="theTable">
    45 <img width=125 height=125 id=element1.4><img width=125 height=125 id=element2.4><img width=125 height=125 id=element3.4><img width=125 height=125 id=element4.4><img width=125 height=125 id=element5.4><img width=125 height=125 id=element6.4><br>
    46 <img width=125 height=125 id=element1.3><img width=125 height=125 id=element2.3><img width=125 height=125 id=element3.3><img width=125 height=125 id=element4.3><img width=125 height=125 id=element5.3><img width=125 height=125 id=element6.3><br>
    47 <img width=125 height=125 id=element1.2><img width=125 height=125 id=element2.2><img width=125 height=125 id=element3.2><img width=125 height=125 id=element4.2><img width=125 height=125 id=element5.2><img width=125 height=125 id=element6.2><br>
    48 <img width=125 height=125 id=element1.1><img width=125 height=125 id=element2.1><img width=125 height=125 id=element3.1><img width=125 height=125 id=element4.1><img width=125 height=125 id=element5.1><img width=125 height=125 id=element6.1><br>
     45<script type="text/javascript">
     46  drawTable()
     47</script>
    4948
    5049        </table>
  • trunk/npemap.org.uk/static/tiles/mapTiles.js

    r6 r8  
    3030
    3131
     32if (document.body.clientWidth) {
     33  sizeGridX = Math.round(((document.body.clientWidth) / tileWidth)-2)
     34  sizeGridY = Math.round(((document.body.clientHeight) / tileHeight)-1)
     35 }     
     36
    3237function zoomOut() {
    3338        if(zoomLevel == (prefixes.length-1)) {
     
    5762        refreshGrid();
    5863}
     64
     65function drawTable() {
     66        for(var y=sizeGridY; y>=1; y--) {
     67        for(var x=1; x<=sizeGridX; x++) {
     68      document.write('<img width=' + tileWidth + ' height=' + tileHeight + ' id=element' + x + '.' + y + '>')
     69        }
     70        document.write('<br>')
     71        }
     72}
     73
     74
    5975
    6076
Note: See TracChangeset for help on using the changeset viewer.