Commit 48f9e849 authored by Eric Duminil's avatar Eric Duminil
Browse files

slight refactor.

parent c1c38a9b
......@@ -234,12 +234,13 @@ var regionChooser = (function(){
dataPanel.prepend("<h2 class='error'>Sorry, the CityGML files should all be written with the same coordinate system.</h2><br/>\n");
}
document.documentElement.className = 'wait';
var citygmlNames = features.map(f => f.get("name"));
// Waiting 100ms in order to let the cursor change
setTimeout(function() {
var start = new Date().getTime();
if (proj4.defs(srsName)){
document.documentElement.className = 'wait';
console.log("Selected region is written in " + srsName + " coordinate system.");
try {
fxapp.downloadRegionFromCityGMLs(sketchAsWKT(srsName), project, citygmlNames.join(";"), srsName);
......@@ -374,13 +375,10 @@ var regionChooser = (function(){
}
publicScope.downloadFromSelectedCityGMLs = function() {
document.getElementById("download_region_button").disabled = true;
var checkedBoxes = Array.from(document.querySelectorAll("input.select_citygml")).filter(c => c.checked);
if (checkedBoxes.length === 0){
console.log("You should select at least one citygml, though.");
} else{
document.getElementById("download_region_button").disabled = true;
publicScope.downloadRegionFromCityGMLs(checkedBoxes.map(c => c.id));
}
// CheckBoxes isn't empty, because otherwise the button cannot be clicked.
publicScope.downloadRegionFromCityGMLs(checkedBoxes.map(c => c.id));
}
publicScope.checkCityGMLS = function(allOrNone) {
......
Markdown is supported
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