diff --git a/Repositories/Maps/css_map.js b/Repositories/Maps/css_map.js index 148263c..6db684b 100755 --- a/Repositories/Maps/css_map.js +++ b/Repositories/Maps/css_map.js @@ -5,19 +5,26 @@ { // Open the request. Setting the third argument to TRUE makes the // request asynchronous, i.e., the browser doesn't wait. - http.open('GET', 'css_map.php?top=' + numEntries, true); + httpRequest.open('GET', 'css_map.pl?width=1024&height=520&top=' + numEntries, true); // When we hear something from the server, call the handleResponse() // function to find out what happened. - http.onreadystatechange = function () + httpRequest.onreadystatechange = function () { - if(http.readyState == 4) + if(httpRequest.readyState == 4) { - if (http.status == 200) // Did it work? + if (httpRequest.status == 200) // Did it work? { // Grab the response content. - var response = http.responseText; - + document.getElementById( "map" ).innerHTML = httpRequest.responseText; + // Grab finishing time. We have to do this here rather than in + // the main part of the load() function because the map data + // are generated asynchronously. + var endTime = new Date(); + document.getElementById( "timer" ).innerHTML = + 'Page generated in ' + + ( endTime - startMillis ) + + ' ms.'; } else { @@ -27,41 +34,6 @@ }; // Send the request. - http.send(null); + httpRequest.send(null); - - GDownloadUrl( "google_map_generate_data.pl?top=" + numEntries, - function( data, responseCode ) - { - var xml = GXml.parse( data ); - var markerlist = xml.documentElement.getElementsByTagName( "marker" ); - for ( var i = 0; i < markerlist.length; i++ ) - { - var point = new GLatLng( parseFloat( markerlist[i].getAttribute( "lat" ) ), - parseFloat( markerlist[i].getAttribute( "long" ) ) ); - map.addOverlay( createMarker( point, markerlist[i].getAttribute( "city" ), - markerlist[i].getAttribute( "abs" ), markerlist[i].getAttribute( "dl" ) ) ); - } - // Grab finishing time. We have to do this here rather than in - // the main part of the load() function because the map data - // are loaded asynchronously. - var endTime = new Date(); - var numUA = xml.documentElement.getAttribute( "ua" ); - var numUD = xml.documentElement.getAttribute( "ud" ); - document.getElementById( "timer" ).innerHTML = - '' + - xml.documentElement.getAttribute( "dl" ) + - ' downloads' + ( ( numUD > 0 ) ? ( ' (+' + numUD + ' unmappable)' ) : '' ) + - ' & ' + - xml.documentElement.getAttribute( "abs" ) + - ' abstracts' + ( ( numUD > 0 ) ? ( ' (+' + numUA + ' unmappable)' ) : '' ) + - ' from ' + - markerlist.length + - ' cities (' + - xml.documentElement.getAttribute( "ips" ) + - ' IP addresses), page generated in ' + - ( endTime - startMillis ) + - ' ms.'; - } ); - } }