Changeset 293


Ignore:
Timestamp:
Nov 2, 2006, 8:53:14 PM (13 years ago)
Author:
David Sheldon
Message:

add lat and long to the location when you click.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/static/tiles/mapTiles.js

    r275 r293  
    9696    postcodeFormElement.style.display = 'block';
    9797    YAHOO.util.Dom.setXY(postcodeFormElement, [Math.max(0, (x-50)), (y-180) < 0 ? (y+10):(y-180)]);
    98     $('location').innerHTML = easting + ', ' + northing ;
     98   
     99   // Compute lat+long
     100   var en = new OSRef(easting,northing);
     101   var latlong = en.toLatLng();
     102   var lat = Math.round(latlong.lat*10000) / 10000;
     103   var lng = Math.round(latlong.lng*10000) / 10000;
     104
     105    $('location').innerHTML = easting + ', ' + northing + " (" + lat + ", " + lng + ")";
    99106    $('easting').value = easting;
    100107    $('northing').value = northing;
Note: See TracChangeset for help on using the changeset viewer.