/**
* @file app.js
* @author Andreas Tholen
* Contact: info@littwin-systechnik.de
* @version 0.5.3
* @description Basic Functions
*/
$(document).foundation();
//document.getElementById("fullSideMenuCard").style.height = windowHeight+"px";
// Sidemenu Config
if ((!standardSideMenu) || (fullSideMenu)) {
const collection = document.getElementsByClassName("standardSideMenu");
for (let i = 0; i < collection.length; i++) {
collection[i].style.display = "none";
}
}
if ((!fullSideMenu) || (standardSideMenu)) {
const collectionb = document.getElementsByClassName("fullSideMenu");
for (let i = 0; i < collectionb.length; i++) {
collectionb[i].style.display = "none";
}
}
var stationCardTempList = "";
var stationCardTemp = '
'
+'
'
+'
'
+'Standort'
+'
'
+'
'
+'
'
+'
'
+'Test'
+'
'
+'
';
for (let index = 0; index < 11; index++) {
stationCardTempList += stationCardTemp;
}
//document.getElementById('stationenFullSideMenu').innerHTML = stationCardTempList;
function getDataMenu() {
var stationsListing = [];
// Stationen erfassen
for (var i = 0; i < dataStaticlength; i++) {
var gisStatics = dataStatic[i];
if(filterSystems.includes(gisStatics.System)){
var stationListing = gisStatics.Area_Name; // Area_Name
stationsListing.push(stationListing);
}
}
// Doppelte Einträge löschen
console.log("%cMAP| Einträge der Stationen werden geprüft",'color: green');
let uniqueStations = [];
stationsListing.forEach((c) => {
if (!uniqueStations.includes(c)) {
uniqueStations.push(c);
}
});
console.log("%cMAP| Stationen indexiert: %c"+uniqueStations.sort(),'color: green', 'color:grey');
uniqueStations = uniqueStations.sort();
var select = document.getElementById("stationListing");
for(var i = 0; i < uniqueStations.length; i++) {
var opt = uniqueStations[i];
var el = document.createElement("option");
el.textContent = opt;
el.value = opt;
el.style.color = "#000000";
el.style.fontWeight = "thin";
select.appendChild(el);
}
}
/*var checkbox = document.querySelector("#box-TALAS");
checkbox.addEventListener('change', function() {
if (this.checked) {
map.addLayer(TALAS);
console.log("TALAS is checked..");
} else {
map.removeLayer(TALAS);
console.log("TALAS is not checked..");
}
});
var checkbox = document.querySelector("#box-GMA");
checkbox.addEventListener('change', function() {
if (this.checked) {
map.addLayer(GMA);
document.getElementById("data-"+LocID).style.display = "none";
console.log("GMA is checked..");
} else {
map.removeLayer(GMA);
console.log("GMA is not checked..");
}
});
var checkbox = document.querySelector("#box-MODEM");
checkbox.addEventListener('change', function() {
if (this.checked) {
map.addLayer(GSM);
console.log("GSM is checked..");
} else {
map.removeLayer(GSM);
console.log("GSM is not checked..");
}
});
var checkbox = document.querySelector("#box-SIEMENS");
checkbox.addEventListener('change', function() {
if (this.checked) {
map.addLayer(Siemens);
console.log("Notrufsäulen is checked..");
} else {
map.removeLayer(Siemens);
console.log("Notrufsäulen is not checked..");
}
});*/
// ISS Positions-Update Test
var iss;
function update_position() {
$.getJSON('http://api.open-notify.org/iss-now.json', function(data) {
var latitude = data["iss_position"]["latitude"];
var longitude = data["iss_position"]["longitude"];
if (!iss) {
iss = L.marker([latitude,longitude], {icon: spaceStationMarker}).bindPopup("Ich bin die ISS").addTo(map);
}
iss.setLatLng([latitude,longitude]).update();
setTimeout(update_position, 1000);
});
}
update_position();