Changeset 557 for trunk


Ignore:
Timestamp:
Jun 13, 2007, 6:38:41 PM (13 years ago)
Author:
Nick Burch
Message:

Finish off NI support

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

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/static/tiles/grid.css

    r487 r557  
    2929}
    3030
    31 #postcode_form {
     31#postcode_form,#location_form {
    3232  line-height: 100%;
    3333  background-color: white;
  • trunk/npemap.org.uk/static/tiles/ni-raw-map.html

    r556 r557  
    6464  <div id="location_form">
    6565    <div class="close"><a href="javascript:closeLocationWindow()" title="close">X</a></div>
    66                 <div><span id="location"></span></div>
    67     <div><p><strong>Please email ni@npemap.org.uk with the raw location below, and the real WGS84 location that corresponds to</strong></p></div>
     66                <div><span id="location"></span></div><br />
     67    <div><b>Please email ni@npemap.org.uk with the raw location below, and the real WGS84 location that corresponds to</b></div><br />
    6868    <div id="easting"></div>
    6969    <div id="northing"></div>
  • trunk/npemap.org.uk/static/tiles/ni-raw-mapTiles.js

    r556 r557  
    1414var markerYOffset = 11;
    1515
    16 var offsetGridX = 450;
    17 var offsetGridY = 207;
     16var offsetGridX = 259;
     17var offsetGridY = 036;
    1818
    1919var zoomLevel = 1;
     
    3131prefixes[3] =  "scaled6/";
    3232prefixes[4] =  "scaled12/";
     33prefixes[5] =  "scaled24/";
    3334
    3435var jumpOut = new Array(1);
     
    3637jumpOut[2] = 2;
    3738jumpOut[3] = 2;
     39jumpOut[4] = 2;
    3840var jumpIn = new Array(1);
    3941jumpIn[2] = 3;
    4042jumpIn[3] = 2;
    4143jumpIn[4] = 2;
     44jumpIn[5] = 2;
    4245
    4346var zooms = new Array(1);
     
    4649zooms[3] = 6;
    4750zooms[4] = 12;
     51zooms[5] = 24;
    4852
    4953
     
    5458
    5559var markerElement;
    56 var postcodeFormElement;
     60var locationFormElement;
    5761var mainPageElement;
    5862
     
    7680
    7781
    78 function showPostcodeWindow(easting, northing, x, y) {
    79     hideMarkerWindow();
    80 
     82function showLocationWindow(easting, northing, x, y) {
    8183    var easting = trimSixDigits(Math.round(easting));
    8284    var northing = trimSixDigits(Math.round(northing));
     
    8587    YAHOO.util.Dom.setXY(markerElement, [(x-markerXOffset), (y-markerYOffset)]);
    8688   
    87     postcodeFormElement.style.display = 'block';
    88     YAHOO.util.Dom.setXY(postcodeFormElement, [Math.max(0, (x-50)), (y-180) < 0 ? (y+10):(y-180)]);
     89    locationFormElement.style.display = 'block';
     90    YAHOO.util.Dom.setXY(locationFormElement, [Math.max(0, (x-50)), (y-180) < 0 ? (y+10):(y-180)]);
    8991   
    90    // Compute lat+long
    91    var en = new OSRef(easting,northing);
    92    var latlong = en.toLatLng();
    93    var lat = Math.round(latlong.lat*10000) / 10000;
    94    var lng = Math.round(latlong.lng*10000) / 10000;
    95    
    96 
    97     $('location').innerHTML = easting + ', ' + northing + " (" + lat + ", " + lng + ")";
    98     $('easting').value = easting;
    99     $('northing').value = northing;
    100     $('returnX').value = offsetGridX;
    101     $('returnY').value = offsetGridY;
    102     $('grid').value = grid;
    103     $('grid2').value = grid;
     92    $('location').innerHTML = easting + ', ' + northing;
     93    $('easting').innerHTML = "The raw easting is " + easting;
     94    $('northing').innerHTML = "The raw northing is " + northing;
    10495
    10596    $('postcode1').value = "";
     
    123114           onComplete: function(o) {drawExisting(); updateStatus(o);  }
    124115 });
    125  closePostcodeWindow();
     116 closeLocationWindow();
    126117 YAHOO.util.Event.preventDefault(e);
    127118}
    128119
    129120
    130 function closePostcodeWindow() {
    131   postcodeFormElement.style.display = 'none';
     121function closeLocationWindow() {
     122  locationFormElement.style.display = 'none';
    132123  markerElement.style.visibility = 'hidden';
    133124}
    134 
    135 function showMarkerWindow(x,y, postcode, easting, northing, source, id) {
    136   closePostcodeWindow();
    137    // Compute lat+long
    138    var en = new OSRef(easting,northing);
    139    var latlong = en.toLatLng();
    140    var lat = Math.round(latlong.lat*10000) / 10000;
    141    var lng = Math.round(latlong.lng*10000) / 10000;
    142 
    143    // Display
    144    $('location_detail').innerHTML = easting + ", "+northing;
    145    $('latlong_detail').innerHTML = lat + ", " + lng;
    146    $('postcode_detail').innerHTML = postcode;
    147    $('postcode_id_detail').value= id;
    148    $('reason_email').value= '';
    149    $('reason').value= '';
    150    $('grid').value = grid;
    151    $('grid2').value = grid;
    152    $('source_detail').innerHTML = ((source == 0) ? 'this site' : '<a href="http://www.freethepostcode.org/">freethepostcode.org</a>');
    153    $('postcode_detail_window').style.display = 'block';
    154    $('bad').style.display = '';
    155    $('report_form').style.display = 'none';
    156    YAHOO.util.Dom.setXY('postcode_detail_window', [Math.max(0, (x-50)), (y-100) < 0 ? (y+10):(y-100)]);
    157 }
    158 
    159 function hideMarkerWindow() {
    160    $('postcode_detail_window').style.display = 'none';
    161 }
    162 
    163125
    164126// MAP METHODS --------------------------------------------
     
    185147    } else {
    186148   
    187       showPostcodeWindow(((baseEasting  + tileXratio)*1000), ((baseNorthing +tileYratio)*1000), x, y);
     149      showLocationWindow(((baseEasting  + tileXratio)*1000), ((baseNorthing +tileYratio)*1000), x, y);
    188150
    189151    }
     
    196158function zoomOut() {
    197159        if(zoomLevel == (prefixes.length-1)) {
    198     location.href="allmaps.html";
     160                //location.href="allmaps.html";
    199161                return;
    200162        }
     
    220182    Element.hide('zoomin_enabled');
    221183    Element.show('zoomin_disabled');
    222     Element.show('showHideMarkers');
    223184        } else {
    224185    Element.show('zoomin_enabled');
    225186    Element.hide('zoomin_disabled');
    226     Element.hide('showHideMarkers');
    227187  }
    228188}
     
    266226function initializePage() {
    267227        markerElement = $('marker');
    268         postcodeFormElement = $('postcode_form');
     228        locationFormElement = $('location_form');
    269229    mainPageElement = $('main_page');
    270230
     
    300260      zoomLevel = urlterms[2]-0 ;
    301261    }
    302 
    303     grid = 'osgb';
    304     if(urlterms.length > 3) {
    305       if(urlterms[3] == 'ie') {
    306          grid = 'osie';
    307       }
    308     }
    309262  }
    310263}
     
    341294
    342295function refreshGrid() {
    343   closePostcodeWindow();
    344   hideMarkerWindow();
     296  closeLocationWindow();
    345297
    346298        for(var x=1; x<=sizeGridX; x++) {
     
    608560 });
    609561  if (typeof urchinTracker == 'function') urchinTracker('/tiles/reportBad');
    610  hideMarkerWindow();
    611562 YAHOO.util.Event.preventDefault(e);
    612563}
Note: See TracChangeset for help on using the changeset viewer.