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

slight refactor.

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