Changeset 195


Ignore:
Timestamp:
Oct 26, 2006, 10:32:50 PM (13 years ago)
Author:
David Sheldon
Message:

Colour the FTP postcodes blue.

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

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/cgi/get-postcodes.fcgi

    r169 r195  
    7373    }
    7474
    75     my $sth = $dbh->prepare("SELECT outward || ' ' || inward AS postcode, easting, northing,id FROM postcodes WHERE easting BETWEEN ? AND ? AND northing BETWEEN ? AND ? AND NOT deleted");
     75    my $sth = $dbh->prepare("SELECT outward || ' ' || inward AS postcode, easting, northing,id,source FROM postcodes WHERE easting BETWEEN ? AND ? AND northing BETWEEN ? AND ? AND NOT deleted");
    7676   
    7777    if ($sth->execute($cgi->param('mineasting'), $cgi->param('maxeasting'), $cgi->param('minnorthing'), $cgi->param('maxnorthing'))) {
     
    8181        foreach my $key (keys %$hr) {
    8282            my $hash = $$hr{$key};
    83             print "addMarker('$$hash{postcode}', $$hash{easting}, $$hash{northing}, $$hash{id});\n";
     83            print "addMarker('$$hash{postcode}', $$hash{easting}, $$hash{northing}, [$$hash{id}, $$hash{source}]);\n";
    8484        }
    8585        print "completeMarkers();\n";
  • trunk/npemap.org.uk/static/tiles/mapTiles.js

    r192 r195  
    336336}
    337337
    338 function addMarker(postcode, easting, northing, id) {
     338var markerColours = new Array(1);
     339markerColours[0] = "../images/green-marker.gif";
     340markerColours[1] = "../images/blue-marker.gif";
     341
     342
     343function addMarker(postcode, easting, northing, others ) {
     344  // Others is an array for us to put extra stuff in
     345
    339346  var newMarker;
     347  var id = others[0];
     348  var source = others[1];
     349
    340350  if (nextMarker < markers.length) {
    341351    newMarker = markers[nextMarker];
    342352        var img=newMarker.firstChild;
    343353    img.title = postcode;
     354    img.src = markerColours[source];
    344355    newMarker.style.visibility = 'visible';
    345356  }
     
    348359        var img=document.createElement('img');
    349360    img.title = postcode;
    350     img.src = "../images/green-marker.gif";
     361    img.src = markerColours[source];
    351362    newMarker.appendChild(img);
    352363    newMarker.style.position = 'absolute';
Note: See TracChangeset for help on using the changeset viewer.