commit 7e4e8bbbd1c3559ebeee98fd470fce3c4363fe28 Author: Fox News Date: Mon Dec 20 10:42:49 2021 +0100 Initial upload diff --git a/Locationtest.php b/Locationtest.php new file mode 100644 index 0000000..54789c8 --- /dev/null +++ b/Locationtest.php @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + Syddansk Erhvervsskole Map | Test Location + + + + + + +
+ +

+ +
+ + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d16bd05 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# SDE-Map +Et interaktiv map over SDE + + ![logo](/images/logotype.svg) + +# Color Palette +* #00788a +* #002d4e +* #6696b1 +* #94a964 +* #ed6c4d +* #dba227 + +# json struktur +Vi er ikke sikker på om det vil blive brugt. +``` json +"BygningNavn": { + "info": [ + "info tekst 1", + "info tekst 2" + ], + "image": [ + { + "url": "../images/bygning/hus1.jpg", + "description": "huset foran" + } + ] +} +``` + +Du kan adde flere billedere i image, det vil blive +automatisk sat via [`information.js`](/javascript/information.js) +```json +"image": [ + { + "url": "../images/bygning/hus1.jpg", + "description": "huset foran" + }, + { + "url": "../images/bygning/hus2.jpg", + "description": "huset bagved" + } +] +``` diff --git a/css/font.css b/css/font.css new file mode 100644 index 0000000..b792704 --- /dev/null +++ b/css/font.css @@ -0,0 +1,9 @@ +@font-face { + font-family: 'SDEFont'; + src: url('../fonts/TitilliumWeb-Regular.ttf'); +} + +.dropbtn { + font-family: SDEFont; + +} \ No newline at end of file diff --git a/css/image.css b/css/image.css new file mode 100644 index 0000000..f63c546 --- /dev/null +++ b/css/image.css @@ -0,0 +1,80 @@ +* {box-sizing: border-box} +body {margin:0;} +.mySlides {display: none} +.show-image {vertical-align: middle;} + +.slideshow-container { + max-width: 1000px; + position: relative; + + margin: auto; + top: 0px; +} + +.prev, .next { + cursor: pointer; + position: absolute; + top: 50%; + width: auto; + padding: 16px; + margin-top: -22px; + color: white; + font-weight: bold; + font-size: 18px; + transition: 0.6s ease; + border-radius: 0 10px 10px 0; + user-select: none; +} + +.next { + right: 0; + border-radius: 10px 0 0 10px; +} + +.prev:hover, .next:hover { + background-color: rgba(0, 120, 138, 0.8); +} + +.text { + color: #f2f2f2; + background-color: rgba(0, 120, 138, 0.8); + font-size: 15px; + padding: 4px 6px; + position: absolute; + bottom: 2px; + margin-left: 20%; + width: 60%; + border-radius: 15px; + text-align: center; +} + +.numbertext { + color: #f2f2f2; + background-color: rgba(0, 120, 138, 0.8); + border-radius: 0 0 15px 0; + font-size: 12px; + padding: 4px 10px; + position: absolute; + top: 0; +} + +.fade { + -webkit-animation-name: fade; + -webkit-animation-duration: 1.5s; + animation-name: fade; + animation-duration: 1.5s; +} + +@-webkit-keyframes fade { + from {opacity: .9} + to {opacity: 1} +} + +@keyframes fade { + from {opacity: .9} + to {opacity: 1} +} + +@media only screen and (max-width: 300px) { + .prev, .next,.text {font-size: 11px} +} \ No newline at end of file diff --git a/css/index.css b/css/index.css new file mode 100644 index 0000000..b9e6e55 --- /dev/null +++ b/css/index.css @@ -0,0 +1,62 @@ +html { + height: 100%; +} + +body { + min-height: 100%; +} + +.wrapper { + display: flex; + flex-direction: column; + justify-content: space-around; + + height: 100vh; +} + +.sde-icon { + width: 50vh; + height: 50vh; +} + +.button { + border-radius: 15px; + background-color: rgba(0, 120, 138); + border: none; + color: #FFFFFF; + text-align: center; + position: relative; + left: 20%; + font-size: 15px; + padding: 10px; + width: 60%; + transition: all 0.5s; + cursor: pointer; + margin: 5px; + font-family: 'Titillium Web'; +} + +.button span { + cursor: pointer; + display: inline-block; + position: relative; + transition: 0.5s; +} + +.button span:after { + content: '\00bb'; + position: absolute; + opacity: 0; + top: 0; + right: -20px; + transition: 0.5s; +} + +.button:hover span { + padding-right: 25px; +} + +.button:hover span:after { + opacity: 1; + right: 0; +} \ No newline at end of file diff --git a/css/map.css b/css/map.css new file mode 100644 index 0000000..bd76e70 --- /dev/null +++ b/css/map.css @@ -0,0 +1,233 @@ +body { + font-family: 'Titillium Web'; + overflow: hidden; +} + +.container { + float: left; + height: auto; + width: auto; +} + +.wrapper { + display: flex; + border-radius: 0px; + padding: 5px; + overflow-x: auto; + overflow-y: auto; + width: 100%; + top: auto; + height: 100%; + position: absolute; +} + +ul { + list-style-type: none; + margin: 0; + padding: 0; + overflow-y: visible; + background-color: #00788A; +} + +button { + font-family: 'Titillium Web'; +} + +h2 { + font-family: 'Titillium Web'; +} + +p { + font-family: 'Titillium Web'; +} + +.areas div { + background-color: #00788a57; + border-radius: 15px; + transform: rotate(3deg); + position: absolute; + +} + +.area { + display: none; +} + +.area.show { + display: block; + animation:scale-up-center 0.5s linear infinite alternate both; +} + +@keyframes scale-up-center{ + from { + transform: scale(.9) rotate(3deg); + background-color: #ed6c4d5e; + } + to { + transform: scale(1) rotate(3deg); + background-color: #b12e0e5e; + } +} + +.backbtn { + background-color: #00788A; + color: white; + padding: 14px; + font-size: 16px; + border: none; + cursor: pointer; +} + +.backbtn:hover { + background-color: rgba(221, 221, 221, 0.329); +} + +.close { + color: #FFFFFF; + + float: right; + font-size: 28px; + font-weight: bold; + padding: 5px; +} + +.close:hover, +.close:focus { + text-decoration: none; + cursor: pointer; +} + +#myInput { + box-sizing: border-box; + background-position: 14px 12px; + background-repeat: no-repeat; + font-size: 16px; + padding: 14px 20px 12px 15px; + border: none; + border-bottom: 1px solid #ddd; +} + +#myInput:focus {outline: 3px solid #ddd;} + +.map-choice-wrapper { + background-color: rgba(0, 0, 0, 0.37); + + position: absolute; + z-index: 500; + + display: flex; + align-items: center; + justify-content: center; + + width: 100%; + height: 100%; +} + +.map-choice { + background-color: #00788A; + + border-radius: 10px; + + display: flex; + align-items: center; + justify-content: center; + + gap: 1%; + + height: 10%; + width: 75%; +} + +.map-choice button { + background-color: #00000059; + color: white; + + border-style: none; + border-radius: 5px; + + text-align: center; + font-size: small; + + height: 45%; + width: 48%; +} + +.map-choice button:hover { + cursor: pointer; +} + +.area-choice-container { + display: none; + z-index: 99; + + background-color: rgba(0, 0, 0, 0.6); + + height: 100%; + width: 100%; + + position: absolute; +} + +.area-choice-container.show { + display: block; +} + +.area-choice h1 { + background-color: #00788A; + margin: auto; +} + +.area-list-container { + display: flex; + justify-content: left; + + height: 100%; + bottom: 0px; +} + +.area-list button { + height: 5%; + width: 100%; + background-color: #00788A; + color: white; + border-style: none; + + text-align: center; + margin: 2px; + overflow: hidden; + border-radius: 1vh; + width: 96%; + position: relative; + left: 2%; +} + +.area-list button:hover { + background-color: #00788aab; +} + +.area-list { + display: flex; + flex-direction: column; + + background-color: #ffffff; + width: 100%; + + position: relative; +} + +.choice-title { + position: relative; + text-align: center; + + background-color: #00788A; + + padding: 0.5%; + + border-radius: 1vh; + width: 50%; + left: 25%; +} + +.text-white { + color: white; +} \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..a583ad8 Binary files /dev/null and b/favicon.ico differ diff --git a/images/InfoIcons.svg b/images/InfoIcons.svg new file mode 100644 index 0000000..4bf4b68 --- /dev/null +++ b/images/InfoIcons.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + Parkering + Indgang + + + D + + + + P + + + + R + + Reception + It service + + + IT + + + + IT + + + diff --git a/images/SdeHandLogo.svg b/images/SdeHandLogo.svg new file mode 100644 index 0000000..aaf1812 --- /dev/null +++ b/images/SdeHandLogo.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/images/bruger.svg b/images/bruger.svg new file mode 100644 index 0000000..2db8f36 --- /dev/null +++ b/images/bruger.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/images/colorIcons/Blue.svg b/images/colorIcons/Blue.svg new file mode 100644 index 0000000..b24be86 --- /dev/null +++ b/images/colorIcons/Blue.svg @@ -0,0 +1,3 @@ + + + diff --git a/images/colorIcons/DarkBlue.svg b/images/colorIcons/DarkBlue.svg new file mode 100644 index 0000000..8727d9f --- /dev/null +++ b/images/colorIcons/DarkBlue.svg @@ -0,0 +1,3 @@ + + + diff --git a/images/colorIcons/Green.svg b/images/colorIcons/Green.svg new file mode 100644 index 0000000..cfb5b19 --- /dev/null +++ b/images/colorIcons/Green.svg @@ -0,0 +1,3 @@ + + + diff --git a/images/colorIcons/LightBlue.svg b/images/colorIcons/LightBlue.svg new file mode 100644 index 0000000..d925e7d --- /dev/null +++ b/images/colorIcons/LightBlue.svg @@ -0,0 +1,3 @@ + + + diff --git a/images/colorIcons/Orange.svg b/images/colorIcons/Orange.svg new file mode 100644 index 0000000..24fc273 --- /dev/null +++ b/images/colorIcons/Orange.svg @@ -0,0 +1,3 @@ + + + diff --git a/images/colorIcons/Yellow.svg b/images/colorIcons/Yellow.svg new file mode 100644 index 0000000..f14420c --- /dev/null +++ b/images/colorIcons/Yellow.svg @@ -0,0 +1,3 @@ + + + diff --git a/images/logotype.svg b/images/logotype.svg new file mode 100644 index 0000000..5715c67 --- /dev/null +++ b/images/logotype.svg @@ -0,0 +1 @@ +sde-logo \ No newline at end of file diff --git a/images/maps/munkebjergvej.svg b/images/maps/munkebjergvej.svg new file mode 100644 index 0000000..d3d40a1 --- /dev/null +++ b/images/maps/munkebjergvej.svg @@ -0,0 +1,504 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Munkebjergvej + + Munkerisvej + + + + + + + + Billedskærervej + MU5 + 5A + 5C + 3A + 1A + 2A + 4F + 4G + 4A + 6F + 6H + 6A + 6C + 8A + 8C + MU10 + 7A + 9A + 9D + 9C + 11A + 11B + 9F + MU1 + Mediegrafiker + It, netværk ogdesign + MU2 + MU4 + Kantine + Frisør + MU6 + Mennesker, livsstil og sundhed + Kosmetiker, hospitalsteknisk assistent,serviceassistent + + + + + + + + + + + + + + + + + + + + + MU3 + MU7 + Konferencesal + + It, netværk ogdesign + MU9 + 9B + Odense Teknisk Gymnasium + Odense Teknisk Gymnasium + MU9 + MU8 + It, netværk og design + It-supporter og datatekniker + MU11 + Byggeri, energi og konstruktion + Ejendomsservicetekniker og sikkerhedsvagt + + + + + + + + + + + + + + + + + + + + + + + + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + Mennesker, livsstilog sundhed + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + D + + + + P + + + + P + + + + R + R + + Skole praktik + + + IT + + + + + + + + + + + + + + Tandklinikassistent + + diff --git a/images/maps/risingsvej.svg b/images/maps/risingsvej.svg new file mode 100644 index 0000000..51ffc9c --- /dev/null +++ b/images/maps/risingsvej.svg @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + P + + + + + + + + + + + + + + + + + + + + + + + P10 A + P11 A + + + R + R + + + + + + + + + + + + Hovedindgang + Byggeri, energi ogkonstruktion + VVS-Energi + Tømrer + Tømrer + Byggeri, energi ogkonstruktion + Byggeri, energi ogkonstruktion + Elektriker + Maler + Byggeri, energi ogkonstruktion + Murer + Robot, teknologi ogautomatik + Robot, teknologi ogautomatik + Robot, teknologi ogautomatik + EUX + Kantine K4 + K3 + Pavillon + VVS-Energi + Smed + Automatiktekniker + P16 A + Elektriker + Industritekniker + Smed + Café + kaptajnen + Tømrer + T8 + 12 + 11 + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 13 + 14 + 15 + 16 + 17 + 18 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + P + + + + P + + + + P + + + + P + + + + P + + + + P + + + + P + + + + P + + + + + + + diff --git a/images/sdelogo.svg b/images/sdelogo.svg new file mode 100644 index 0000000..5715c67 --- /dev/null +++ b/images/sdelogo.svg @@ -0,0 +1 @@ +sde-logo \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..d2ec605 --- /dev/null +++ b/index.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + Syddansk Erhvervsskole Map | Home + + + + +
+
+ + + + + + +
+ +
+ + \ No newline at end of file diff --git a/js/ElementControl.js b/js/ElementControl.js new file mode 100644 index 0000000..bdf8202 --- /dev/null +++ b/js/ElementControl.js @@ -0,0 +1,128 @@ +function ToggleElement(elementClass) { + var element = document.getElementsByClassName(elementClass); + element[0].classList.toggle("show"); +} + +function ToggleDisplay(elementID) { + var element = document.getElementById(elementID); + element.style.display = "block"; +} + +function ToggleArea(elementID) { + var area = document.getElementById(elementID); + var areas = document.getElementsByClassName("area show"); + + for(var i = 0; i < areas.length; i++) { + areas[i].classList.toggle("show"); + } + + area.classList.toggle("show"); +} + +function CloseElement(elementClass) { + var element = document.getElementsByClassName(elementClass); + element[0].style.display = "none"; +} + +function CloseElementById(elementID) { + var element = document.getElementById(elementID); + element.style.display = "none"; +} + +function GetAreaPosition(area) { + ToggleArea(area); + ToggleElement("area-choice-container"); + start(); +} + +function ChangePage(url) { + location.href = url; +} + +function AreaListCloseAll() { + var areaListContainer = document.getElementById("AreaListContainer"); + var areaMainChoice = document.getElementById("area-main-choice"); + var chooseArea = document.getElementById("ChooseArea"); + + var areaForm = areaListContainer.getElementsByTagName("form"); + + for (let index = 0; index < areaForm.length; index++) { + const element = areaForm[index]; + element.style.display = "none"; + } + + chooseArea.style.display = "block"; + areaMainChoice.style.display = "block"; +} + +function LoadButtonAreas() { + const areaButtons = document.querySelectorAll("button"); + areaButtons.forEach((button) => { + button.addEventListener("click", (event) =>{ + const target = event.target; + if(target.hasAttribute("areaLocation")) { + AreaListCloseAll(); + GetAreaPosition(target.getAttribute("areaLocation")); + } + }); + }); +} + +function LoadAreaChoiceButtons() { + var areaMainChoice = document.getElementById("area-main-choice"); + var choiceButtons = areaMainChoice.querySelectorAll("button"); + + for (let index = 0; index < choiceButtons.length; index++) { + const element = choiceButtons[index]; + if(element.hasAttribute("id")){ + element.addEventListener("click", (event) => { + const target = event.target; + ToggleDisplay(target.getAttribute("choice")); + CloseElementById('area-main-choice'); + }) + } + } +} + +function GetCurrentDate() { + var today = new Date(); + var date = today; + return date; +} + +function EventDay() { + const eventButtons = document.getElementsByName("EventButtons"); + + var month = GetCurrentDate().getMonth(); + var day = GetCurrentDate().getDate(); + + for (let index = 0; index < eventButtons.length; index++) { + const element = eventButtons[index]; + // 20'ene November + if(month == 10 && day == 20) { + element.style.display = "block" + } else { + element.style.display = "none"; + } + } +} + +window.onload = function() { + const choiceButton = document.getElementById("choiceButton"); + const mapButton = document.getElementById("kortButton"); + + LoadButtonAreas(); + LoadAreaChoiceButtons(); + + EventDay(); + + choiceButton.addEventListener("click", (event) => { + ToggleElement("area-choice-container"); + CloseElement("map-choice-wrapper"); + }) + + mapButton.addEventListener("click", (event) => { + start(); + CloseElement("map-choice-wrapper"); + }) +} \ No newline at end of file diff --git a/js/image.js b/js/image.js new file mode 100644 index 0000000..96158af --- /dev/null +++ b/js/image.js @@ -0,0 +1,22 @@ +var slideIndex = 1; + +function plusSlides(n) { + showSlides(slideIndex += n); +} + +function currentSlide(n) { + showSlides(slideIndex = n); +} + +function showSlides(n) { + var i; + var slides = document.getElementsByClassName("mySlides"); + + if (n > slides.length) {slideIndex = 1} + if (n < 1) {slideIndex = slides.length} + for (i = 0; i < slides.length; i++) { + slides[i].style.display = "none"; + } + + slides[slideIndex-1].style.display = "block"; +} \ No newline at end of file diff --git a/js/userlocation.js b/js/userlocation.js new file mode 100644 index 0000000..2a4c7a3 --- /dev/null +++ b/js/userlocation.js @@ -0,0 +1,210 @@ +var radius = 6.371; +var latitude; +var longtitude; + +var check = false; +var accuracy; +var mapIndex; + +var mapPoints = { + "munkebjergvej": { + 0: 182.84810370036618, + 1: 141.11583965948455, + 2: 1135.02004895843, + 3: 626.1412432644905 + }, + "risingsvej": { + 0: 0, + 1: 0, + 2: 808, + 3: 692 + } +}; + + +function start(){ + mapIndex = document.getElementById("mapIndex").getAttribute("value"); + + (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera) + + + const isIOSSafari = !!window.navigator.userAgent.match(/Version\/[\d\.]+.*Safari/); + const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; + + function isMobileSafari() { + var text = false; + + if (isIOSSafari && isIOS) { + + var r = confirm("Vi kan ikke finde din position på safari. \nVil du installere chrome?"); + + if (r == true) { + window.location.href = "https://apps.apple.com/dk/app/google-chrome/id535886823?itscg=30200&itsct=apps_box_appicon" + } else{ + return; + } + + } + return text; + } + + if (isMobileSafari()) { + alert(isMobileSafari()); + } + + else{ + getUserLocation(check) + } + +} + +function test() +{ + latitude = 55.407442; + longtitude = 10.420011; + + LoadUserPosition("risingsvej", [55.40900, 10.41864], [55.40577, 10.42527] ); +} + +function getUserLocation(Device){ + dot = ''; + document.body.innerHTML += dot; + + if(Device == true){ + setInterval(function(){ + id = navigator.geolocation.getCurrentPosition(showPosition); + + navigator.geolocation.clearWatch(id); + }, 1000); + + } + else{ + id = navigator.geolocation.getCurrentPosition(showPosition); + + navigator.geolocation.clearWatch(id); + } + +} + +function showPosition(position) +{ + latitude = position.coords.latitude; + longtitude = position.coords.longitude; + accuracy = position.coords.accuracy; + + switch (mapIndex) { + case "0": + LoadUserPosition('munkebjergvej', [55.38201, 10.40751], [55.37989, 10.41480]); + break; + case "1": + LoadUserPosition('risingsvej', [55.40900, 10.41864], [55.40577, 10.42527]); + break; + default: + break; + } +} + +function LoadUserPosition(map, leftPoints, rightPoints) +{ + const img = new Image(); + + img.onload = function() + { + var height = this.height; + var width = this.width; + + var imgposx = document.getElementById('School').offsetLeft; + var imgposy = document.getElementById('School').offsetTop; + + var TopLeftPosition = { + scrX: imgposx, + scrY: imgposy, + lat: leftPoints[0], + lng: leftPoints[1] + } + + var BottomRightPosition = { + scrX: width + imgposx, + scrY: height + imgposy, + lat: rightPoints[0], + lng: rightPoints[1] + } + + function latlngToGlobalXY(lat, lng){ + + let x = radius*lng*Math.cos((TopLeftPosition.lat + BottomRightPosition.lat)/2); + + let y = radius*lat; + return {x: x, y: y} + } + + TopLeftPosition.pos = latlngToGlobalXY(TopLeftPosition.lat, TopLeftPosition.lng); + BottomRightPosition.pos = latlngToGlobalXY(BottomRightPosition.lat, BottomRightPosition.lng); + + function latlngToScreenXY(lat, lng){ + + let pos = latlngToGlobalXY(lat, lng); + + pos.perX = ((pos.x-TopLeftPosition.pos.x)/(BottomRightPosition.pos.x - TopLeftPosition.pos.x)); + + pos.perY = ((pos.y-TopLeftPosition.pos.y)/(BottomRightPosition.pos.y - TopLeftPosition.pos.y)); + + + return { + x: TopLeftPosition.scrX + (BottomRightPosition.scrX - TopLeftPosition.scrX)*pos.perX, + y: TopLeftPosition.scrY + (BottomRightPosition.scrY - TopLeftPosition.scrY)*pos.perY + } + } + + var dot_size = 30; + var half_dot = Math.floor(dot_size / 2); + + function draw_point(x, y) { + var dotpositionx = x + 0; + var dotpostiony = y + 0; + + var bruger = document.getElementById("bruger"); + bruger.style.visibility = "visible"; + bruger.style.width = "30px"; + bruger.style.height = "30px"; + bruger.style.top = dotpostiony + 'px'; + bruger.style.left = dotpositionx + 'px'; + } + + var pos = latlngToScreenXY(latitude, longtitude); + + if(insideMap(pos.x, pos.y, map)) {return} + + draw_point(pos.x - half_dot, pos.y - half_dot); + + document.getElementById('output').innerHTML = "Din Position. Latitude: " + latitude + + " Longitude: " + longtitude + " Din X/Y Position. X: " + pos.x + " Y; " + pos.y + " Accuracy: " + + accuracy + " meter;"; + + navigator.geolocation.clearWatch(id); + + } + + img.src = '../images/maps/' + map + '.svg'; +} + +last = false + +function insideMap(x, y, map) { + if(x < mapPoints[map][0] || y < mapPoints[map][1] || x > mapPoints[map][2] || y > mapPoints[map][3]) { + if(last == true) { + return true; + } + last = true; + + var bruger = document.getElementById("bruger"); + bruger.style.visibility = "hidden"; + + alert("Vi kan ikke finde din lokation hvis du ikke er på skolen område.") + + return true; + } else { + last = false; + return false; + } +} \ No newline at end of file diff --git a/maps/munkebjergvej.html b/maps/munkebjergvej.html new file mode 100644 index 0000000..280c4cd --- /dev/null +++ b/maps/munkebjergvej.html @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + SDE Munkebjergvej 130 Odense + + + + + + + + + + + +
+
+ + +
+ +
+ +
+
+

Vælg område

+
+ +
+
+

Fagretning

+ + + + + +

Andet

+ + + + +

Event

+ +
+ + + + + + + + +
+ +
+ + + + + + + +
+ + + +
+ +
+
+
+
+
+
+
+
+
+
+
+ + + +
+ +
+ + \ No newline at end of file diff --git a/maps/risingsvej.html b/maps/risingsvej.html new file mode 100644 index 0000000..1c650b0 --- /dev/null +++ b/maps/risingsvej.html @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + SDE Risingsvej 60 Odense + + + + + + + + + +
+
+ + +
+ +
+ +
+
+

Vælg område

+
+ +
+
+

Fagretning

+ + +

Andet

+ + +

Event

+ +
+ + +
+ +
+ +
    + + +
+ +
+ + +
+
+ + +
+ +
+ + \ No newline at end of file