// Currently selected source and target var source; var target; var relationPloyline; var relationMarker; function drawRelation() { // Remove an old line if( typeof(relationPolyline) != "undefined" ) { map.removeOverlay(relationPolyline); map.removeOverlay(relationMarker); } // And draw the new one relationPolyline = new GPolyline([source[1], target[1]], "#FF0000", 10); center = relationPolyline.getBounds().getCenter(); relationMarker = new GMarker(center); GEvent.addListener(relationMarker, "click", function() { doRelationInfoWindow(center); map.setCenter(center, map.getBoundsZoomLevel(relationPolyline.getBounds())); }); map.addOverlay(relationPolyline); map.addOverlay(relationMarker); } var infoTabs; function doRelationInfoWindow(center) { infoTabs = [ new GInfoWindowTab(source[0]+" -> "+target[0], "Loading Stats..."), new GInfoWindowTab(target[0]+" -> "+source[0], "Loading Stats... ") ]; map.openInfoWindowTabsHtml(center, infoTabs); getRelationStats(infoTabs); } // All the stuff commented out in this function would need the daily updated // xml files. Since we rushed the move to www.ripe.net from www.ttm.ripe.net // these things have not been adjusted to the www.ripe.net dir structure. That // still needs to be done. function getRelationStats(tabs) { //var xmlFileName = "xml/day/"+source[0]+"-summary.xml"; //GDownloadUrl(xmlFileName, //function(data, responseCode) { //var xml = GXml.parse(data); //var targetTags = xml.documentElement.getElementsByTagName("target"); //var status; // Get the data we need //status = getStatus(xml, 0); // And fill our outgoing tab var text = ""; text += "

"; /** This doesn't seem to be accurate yet if(status == 0) text += "No recent anomalies in measured delays from "+source[0]+" to "+target[0]+".
"; else if(status == 1) text += "The measured delay from "+source[0]+" to "+target[0]+" has increased dramatically within the last 24 hours.
"; else if(status == 2) text += "The measured delay from "+source[0]+" to "+target[0]+" has increased significantly within the last 24 hours.
"; else if(status == 3) text += "The measured delay from "+source[0]+" to "+target[0]+" has dropped dramatically within the last 24 hours.
"; else if(status == 4) text += "The measured delay from "+source[0]+" to "+target[0]+" has dropped significantly within the last 24 hours.
"; **/ text += "
"; text += ""; text += "More Plots..."; text += "

"; tabs[0].contentElem.innerHTML = text; // Get incoming data text = ""; //status = getStatus(xml, 1); // And fill our incoming tab text += "

"; /** This doesn't seem to be accurate yet if(status == 0) text += "No recent anomalies in measured delays from "+target[0]+" to "+source[0]+".
"; if(status == 1) text += "The measured delay from "+target[0]+" to "+source[0]+" has increased dramatically within the last 24 hours.
"; else if(status == 2) text += "The measured delay from "+target[0]+" to "+source[0]+" has increased significantly within the last 24 hours.
"; else if(status == 3) text += "The measured delay from "+target[0]+" to "+source[0]+" has dropped dramatically within the last 24 hours.
"; else if(status == 4) text += "The measured delay from "+target[0]+" to "+source[0]+" has dropped significantly within the last 24 hours.
"; **/ text += "
"; text += ""; text += "More Plots..."; text += "

"; tabs[1].contentElem.innerHTML = text; map.updateInfoWindow(infoTabs); //}); }