Commit 8625d7f2 authored by Eric Duminil's avatar Eric Duminil
Browse files

srsName should always be defined.

parent c356313c
...@@ -67,7 +67,7 @@ var regionChooser = (function(){ ...@@ -67,7 +67,7 @@ var regionChooser = (function(){
feature.setId(gmlId++); feature.setId(gmlId++);
kml_source.addFeature(feature); kml_source.addFeature(feature);
dataPanel.append('.'); dataPanel.append('.');
srsName = feature.get("srsName") || "EPSG:31467"; srsName = feature.get("srsName");
if (proj4.defs(srsName) === undefined){ if (proj4.defs(srsName) === undefined){
console.warning(srsName + " isn't defined by Proj4js!") console.warning(srsName + " isn't defined by Proj4js!")
} }
...@@ -173,13 +173,8 @@ var regionChooser = (function(){ ...@@ -173,13 +173,8 @@ var regionChooser = (function(){
} }
publicScope.isDownloadPossible = function(){ publicScope.isDownloadPossible = function(){
var count = 0; var checkedBoxes = Array.from(document.querySelectorAll("input.select_citygml")).filter(c => c.checked);
document.querySelectorAll("input.select_citygml").forEach(c => { document.getElementById("download_region_button").disabled = (checkedBoxes.length == 0);
if (c.checked){
count += 1;
}
});
document.getElementById("download_region_button").disabled = (count == 0);
} }
function findIntersection(feature, polygon) { function findIntersection(feature, polygon) {
...@@ -228,7 +223,7 @@ var regionChooser = (function(){ ...@@ -228,7 +223,7 @@ var regionChooser = (function(){
}) })
var project = features[0].get("project"); //TODO: Check all the same var project = features[0].get("project"); //TODO: Check all the same
var srsName = features[0].get("srsName") || "EPSG:31467"; //TODO: Check all the same var srsName = features[0].get("srsName"); //TODO: Check all the same
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() {
...@@ -315,7 +310,6 @@ var regionChooser = (function(){ ...@@ -315,7 +310,6 @@ var regionChooser = (function(){
} }
function sketchAsWKT(srsName) { function sketchAsWKT(srsName) {
srsName = (typeof srsName === 'undefined') ? 'EPSG:4326' : srsName;
var wktFormat = new ol.format.WKT(); var wktFormat = new ol.format.WKT();
return wktFormat.writeFeature(sketch, { return wktFormat.writeFeature(sketch, {
dataProjection : ol.proj.get(srsName), dataProjection : ol.proj.get(srsName),
......
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