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

Få på plass ny knapp med boks og valg av lag

parent 566da594
No related branches found
No related tags found
2 merge requests!73Dev,!72Resolve "Egnethetsanalyse / prioritering"
......@@ -31,7 +31,7 @@ p {
.box1 {
display: flex;
flex-grow: 7;
flex-grow: 8;
flex-direction: row;
}
......
......@@ -28,12 +28,13 @@
<div style="display: flex; flex-grow: 2; flex-direction: column;">
<h1 style="margin: 0; padding: 0; text-align: center; font-size: 12vh;">ProgGIS</h1>
<div id="buttons1" class="box1">
<p style="width: 7vw;"></p>
<p style="width: 1vw;"></p>
<button class="button" onclick="openBox('bufferBox')">Buffer</button>
<button class="button" onclick="openBox('differenceBox')">Difference</button>
<button class="button" onclick="openBox('dissolveBox')">Dissolve</button>
<button class="button" onclick="openBox('extractBox')">Extract</button>
<button class="button" onclick="openBox('intersectionBox')">Intersection</button>
<button class="button" onclick="openBox('suitabilityBox')">Suitability</button>
<button class="button" onclick="openBox('unionBox')">Union</button>
</div>
<div id="buttons2" class="box2" style="display: none;">
......@@ -193,6 +194,32 @@
<button class="button" style="font-size: 25px;" onclick="makeIntersection()">Intersect</button>
</div>
<div id="suitabilityBox" class="box">
<div class="box3">
<h1 style="font-size: 4vh; text-align: center; width: 36vw;">Suitability</h1>
<svg style="cursor: pointer; padding-top: 15px;" onclick="closeBox('suitabilityBox')"
xmlns="http://www.w3.org/2000/svg" width="3vw" height="3vw" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"/>
</svg>
</div>
<p>Choose map layers in prioritised order:</p>
<div id="priorityDiv">
<div style="display: flex; justify-content: center;">
<select id="priority1"></select>
<svg onclick="addPrioritizedLayer()" style="cursor: pointer; margin-left: 1vw;" xmlns="http://www.w3.org/2000/svg"
width="3vh" height="3vh" fill="currentColor" class="bi bi-plus-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v3h-3a.5.5 0 0 0 0 1h3v3a.5.5 0 0 0 1 0v-3h3a.5.5 0 0 0 0-1h-3v-3z"/>
</svg>
</div>
</div>
<p>Hei 8)</p>
</div>
<div id="unionBox" class="box">
<div class="box3">
<h1 style="font-size: 4vh; text-align: center; width: 36vw;">Union</h1>
......@@ -291,6 +318,7 @@
<script src="javascript/intersect.js"></script>
<script src="javascript/union.js"></script>
<script src="javascript/extract.js"></script>
<script src="javascript/suitability.js"></script>
<!-- Map change -->
......
......@@ -36,6 +36,11 @@ function openBox(id) { // Åpner aktuell boks (id)
fillSelect("extractSelect");
} else if (id == "intersectionBox") {
fillDoubleSelect("intersectionSelect");
} else if (id == "suitabilityBox") {
var numb = document.getElementById("priorityDiv").childElementCount;
for (var i=1; i<=numb; i++) {
fillSelect("priority" + i.toString());
}
} else if (id == "unionBox") {
fillDoubleSelect("unionSelect");
}
......
function addPrioritizedLayer() {
var newPriority = document.createElement("div");
var numb = document.getElementById("priorityDiv").childElementCount + 1;
var start =`<div id="div${numb}" style="display: flex; flex-grow: 2; flex-direction: row; justify-content: center; margin-top: 1vh;">`;
var newSelect = `<select id="priority${numb.toString()}"></select>`;
var newButton = `<svg onclick="removePrioritizedLayer(${numb})" style="cursor: pointer; margin-left: 1vw;" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-trash3-fill" viewBox="0 0 16 16"> <path d="M11 1.5v1h3.5a.5.5 0 0 1 0 1h-.538l-.853 10.66A2 2 0 0 1 11.115 16h-6.23a2 2 0 0 1-1.994-1.84L2.038 3.5H1.5a.5.5 0 0 1 0-1H5v-1A1.5 1.5 0 0 1 6.5 0h3A1.5 1.5 0 0 1 11 1.5m-5 0v1h4v-1a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5M4.5 5.029l.5 8.5a.5.5 0 1 0 .998-.06l-.5-8.5a.5.5 0 1 0-.998.06Zm6.53-.528a.5.5 0 0 0-.528.47l-.5 8.5a.5.5 0 0 0 .998.058l.5-8.5a.5.5 0 0 0-.47-.528ZM8 4.5a.5.5 0 0 0-.5.5v8.5a.5.5 0 0 0 1 0V5a.5.5 0 0 0-.5-.5"/> </svg>`;
var end = '</div>'
newPriority.innerHTML = start + newSelect + newButton + end;
document.getElementById("priorityDiv").appendChild(newPriority);
fillSelect("priority" + numb.toString());
}
function removePrioritizedLayer(numb) {
var count = document.getElementById("priorityDiv").childElementCount;
if (numb == count) {
document.getElementById("priorityDiv").removeChild(document.getElementById("div" + numb.toString()).parentElement);
} else {
for (var i=numb; i<count; i++) {
document.getElementById("priority" + i.toString()).value = document.getElementById("priority" + (i+1).toString()).value;
}
document.getElementById("priorityDiv").removeChild(document.getElementById("div" + count.toString()).parentElement);
}
}
function suitability() {
}
\ No newline at end of file
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