" + id + "'");
}
}
}
drawPopup(string.split("><").join(">
<").split("
<tag").join("
<tag"));
}
////////////////////////////////////////////////////////////////////////////////
/////////////////////////////// Server handling ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// Define an AJAX request object
//
function ajaxGET(url,success,failure,state)
{
var ajaxRequest=new XMLHttpRequest();
function ajaxGOT(options) {
if(this.readyState==4)
if(this.status==200)
{ if(typeof(options.success)=="function") options.success(this,options.state); }
else
{ if(typeof(options.failure)=="function") options.failure(this,options.state); }
}
ajaxRequest.onreadystatechange = function(){ ajaxGOT.call(ajaxRequest,{success: success, failure: failure, state: state}); };
ajaxRequest.open("GET", url, true);
ajaxRequest.send(null);
}
//
// Display the status
//
function displayStatus(type,subtype,content)
{
var child=document.getElementById("result_status").firstChild;
do
{
if(child.id !== undefined)
child.style.display="none";
child=child.nextSibling;
}
while(child !== null);
var chosen_status=document.getElementById("result_status_" + type);
chosen_status.style.display="";
if(subtype !== undefined)
{
var format_status=document.getElementById("result_status_" + subtype).innerHTML;
chosen_status.innerHTML=format_status.replace("#",String(content));
}
}
//
// Display data statistics
//
function displayStatistics()
{
// Use AJAX to get the statistics
ajaxGET("fixme.cgi?statistics=yes", runStatisticsSuccess);
}
//
// Success in running data statistics generation.
//
function runStatisticsSuccess(response)
{
document.getElementById("statistics_data").innerHTML="" + response.responseText + "
";
document.getElementById("statistics_link").style.display="none";
}
//
// Get the requested data
//
function displayData(datatype) // called from fixme.html
{
// Delete the old data
vectorData=[];
unselectFeature();
layerVectors.getSource().clear();
// Print the status
displayStatus("no_data");
// Return if just here to clear the data
if(datatype === "")
return;
displayMoreData();
}
function displayMoreData()
{
// Get the new data
var mapbounds=map.getView().calculateExtent(map.getSize());
var url="fixme.cgi";
url=url + "?lonmin=" + format5f(ol.proj.toLonLat([mapbounds[0],mapbounds[1]])[0]);
url=url + ";latmin=" + format5f(ol.proj.toLonLat([mapbounds[0],mapbounds[1]])[1]);
url=url + ";lonmax=" + format5f(ol.proj.toLonLat([mapbounds[2],mapbounds[3]])[0]);
url=url + ";latmax=" + format5f(ol.proj.toLonLat([mapbounds[2],mapbounds[3]])[1]);
url=url + ";data=fixmes";
// Use AJAX to get the data
ajaxGET(url, runFixmeSuccess, runFailure);
updateURLs(true);
}
//
// Success in getting the error log data
//
function runFixmeSuccess(response)
{
var lines=response.responseText.split("\n");
var style = new ol.style.Style({image: new ol.style.Circle({fill: new ol.style.Fill({color: "#FF0000"}),
radius: 3})});
var features=[];
for(var line=0;line