Skip to content
Snippets Groups Projects
Commit bce72df7 authored by Jakob Severin Steffensen Hjelseth's avatar Jakob Severin Steffensen Hjelseth
Browse files

Ferdigstilt

parent 6ceba590
No related branches found
No related tags found
Loading
......@@ -31,16 +31,13 @@ function handleFile() {
}
}
console.log(JSON.stringify(data));
//newLayer.addData(data);
newLayer.addData(data);
})
}
/*
overlayMaps[selectedFile.name] = newLayer;
updateSidebar();
handleLayer(selectedFile.name);
*/
}
......@@ -51,7 +51,7 @@ function isInputMultiPolygon(layer) {
}
function turnList(liste) {
var more = false;
/*var more = false;
try {
var test = liste[0][0][0];
if (test != null) {
......@@ -64,17 +64,17 @@ function turnList(liste) {
if (more) {
var newList = [];
console.log("JA")
for (var i = 0; i < layer.length; i++) {
newList.push(turnList(liste[i]));
}
} else {
var newList = [];
} else {*/
var newList = [];
for (var i = liste.length - 1; i > -1; i--) {
newList.push(liste[i]);
}
for (var i = liste.length - 1; i > -1; i--) {
newList.push(liste[i]);
}
//}
return newList;
}
......@@ -111,14 +111,14 @@ function inputMultiLine(layer) {
for (var i = 0; i < k; i++) {
if (liste[i]["geometry"]["coordinates"].length == 1) {
liste[i]["geometry"]["type"] = "LineString";
liste[i]["geometry"]["coordinates"] = turnList(liste[i]["geometry"]["coordinates"][0][0]);
liste[i]["geometry"]["coordinates"] = liste[i]["geometry"]["coordinates"][0];
}
else if (liste[i]["geometry"]["coordinates"].length > 1) {
var coordinates = liste[i]["geometry"]["coordinates"];
liste[i]["geometry"]["type"] = "LineString";
liste[i]["geometry"]["coordinates"] = turnList(coordinates[0][0]);
liste[i]["geometry"]["coordinates"] = coordinates[0];
for (var j = 1; j < coordinates.length; j++) {
newElement = {"type": liste[i]["type"], "properties": liste[i]["properties"], "geometry": {"type": "Polygon", "coordinates": turnList(coordinates[j][0])}};
newElement = {"type": liste[i]["type"], "properties": liste[i]["properties"], "geometry": {"type": "LineString", "coordinates": coordinates[j]}};
liste.push(newElement);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment