Commit 652df34d authored by Eric Duminil's avatar Eric Duminil
Browse files

Show how many buildings have been extracted.

parent 533350b6
......@@ -98,7 +98,7 @@ public Integer call() throws IOException, XPathParseException, NavException, Par
downloadTask.setOnRunning(e -> jsApp.call("downloadStart"));
downloadTask.setOnSucceeded(e -> jsApp.call("downloadFinished"));
downloadTask.setOnSucceeded(e -> jsApp.call("downloadFinished", e.getSource().getValue()));
new Thread(downloadTask).start();
}
......
......@@ -88,7 +88,7 @@ static int selectRegionDirectlyFromCityGML(String wktPolygon, String srsName, Wr
LOGGER.warning("No building found in the selected region.");
}
LOGGER.info("Buildings found in selected region " + foundBuildingsCount);
LOGGER.info("Buildings found in selected region : " + foundBuildingsCount);
//NOTE: This could be a problem if header starts with <core:CityModel> and footer ends with </CityModel>
sb.append(citygml.getFooter());
return foundBuildingsCount;
......
......@@ -246,13 +246,17 @@ const regionChooser = (function(){
publicScope.downloadStart = function(){
document.getElementById("download_region_button").disabled = true;
document.documentElement.className = 'wait';
dataPanel.prepend("<h2 id='download_start' class='ok'>Starting to extract region.</h2><br/>\n");
dataPanel.prepend("<h2 id='download_start' class='ok'>Starting to extract region...</h2><br/>\n");
}
publicScope.downloadFinished = function(){
publicScope.downloadFinished = function(count){
document.documentElement.className = ''; // Stop waiting
document.getElementById("download_start").remove();
dataPanel.prepend("<h2 class='ok'>Region has been extracted</h2><br/>\n");
if (count > 0){
dataPanel.prepend("<h2 class='ok'>Done! (" + count + " buildings found) </h2><br/>\n");
} else {
dataPanel.prepend("<h2 class='error'>No building has been found in this region</h2><br/>\n");
}
var button = document.getElementById("download_region_button");
if (button){ // Region might have been modified since download start
button.disabled = false;
......@@ -325,6 +329,7 @@ const regionChooser = (function(){
} finally {
displayHelp();
document.documentElement.className = ''; // Stop waiting
kml_source.getFeatures().forEach(f => refreshStyle(f, "original"));
draw.setActive(true);
drawnLayer.getFeatures().clear();
intersections.clear();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment