Commit 4218fabd authored by Eric Duminil's avatar Eric Duminil
Browse files

Show a warning if no gml was found

parent 23f6be67
......@@ -87,6 +87,8 @@ const regionChooser = (function(){
features_by_project = utils.groupBy(features, "project");
// Sort CityGMLs inside each project
Object.values(features_by_project).forEach(features => features.sort((a, b) => a.name.localeCompare(b.name)));
return features.length;
}
// The features are not added to a regular vector layer/source,
......@@ -404,7 +406,7 @@ const regionChooser = (function(){
featureProjection : ol.proj.get('EPSG:3857')
});
} catch (e){
console.error("Couldn't import geometry!");
console.warn("Couldn't import geometry!");
dataPanel.prepend("<h2 class='error'>Couldn't import geometry!</h2><br/>\n");
return false;
}
......@@ -413,7 +415,7 @@ const regionChooser = (function(){
var coordinatesCount = feature.getGeometry().getLinearRing(0).getCoordinates().length - 1;
if (coordinatesCount < 2){
console.error("Too few points!");
console.warn("Too few points!");
dataPanel.prepend("<h2 class='error'>There should be at least 2 points in WKT polygon</h2><br/>\n");
return false;
}
......@@ -437,8 +439,12 @@ const regionChooser = (function(){
// Executed by JavaFX when whole page is loaded.
publicScope.ready = function() {
updateGMLPolygons();
var n = updateGMLPolygons();
displayHelp();
if (n == 0){
console.warn("No CityGML found!");
dataPanel.prepend("<h2 class='error'>No CityGML has been found!<br/>repository/name.proj/file.gml</h2><br/>\n");
}
document.documentElement.className = ''; // Stop waiting
console.log("Ready!");
}
......
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