diff --git a/src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js b/src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js index 368244009f4bf7384b73d160a994fb058da88005..58f30451c6b48c59473234ec597c9333b9c08b69 100644 --- a/src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js +++ b/src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js @@ -222,8 +222,18 @@ var regionChooser = (function(){ return kml_source.getFeatureById(i); }) - var project = features[0].get("project"); //TODO: Check all the same - var srsName = features[0].get("srsName"); //TODO: Check all the same + var project = features[0].get("project"); + var srsName = features[0].get("srsName"); + + if (!features.every( f => f.get("project") === project)){ + dataPanel.append("<h2 class='error'>Sorry, the CityGML files should all belong to the same project.</h2><br/>\n"); + return; + } + + if (!features.every( f => f.get("srsName") === srsName)){ + dataPanel.append("<h2 class='error'>Sorry, the CityGML files should all be written with the same coordinate system.</h2><br/>\n"); + } + var citygmlNames = features.map(f => f.get("name")); // Waiting 100ms in order to let the cursor change setTimeout(function() {