diff --git a/Lora-Map/Lora-Map.csproj b/Lora-Map/Lora-Map.csproj index 1527cd3..e407024 100644 --- a/Lora-Map/Lora-Map.csproj +++ b/Lora-Map/Lora-Map.csproj @@ -63,6 +63,9 @@ + + PreserveNewest + @@ -92,6 +95,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + diff --git a/Lora-Map/Model/Botclient.cs b/Lora-Map/Model/Botclient.cs index bc3633c..bdcc23f 100644 --- a/Lora-Map/Model/Botclient.cs +++ b/Lora-Map/Model/Botclient.cs @@ -9,7 +9,7 @@ using LitJson; namespace Fraunhofer.Fit.IoT.LoraMap.Model { class Botclient { - public Botclient(JsonData json) { + public Botclient(String id, JsonData json, JsonData marker) { if (json.ContainsKey("Rssi") && json["Rssi"].IsDouble) { this.Rssi = (Double)json["Rssi"]; } @@ -58,6 +58,17 @@ namespace Fraunhofer.Fit.IoT.LoraMap.Model { this.Height = (Double)json["Gps"]["Height"]; } } + if(marker.ContainsKey(id)) { + if(marker[id].ContainsKey("name") && marker[id]["name"].IsString) { + this.Name = (String)marker[id]["name"]; + } + if(marker[id].ContainsKey("icon") && marker[id]["icon"].IsString) { + this.Icon = (String)marker[id]["icon"]; + } + } else { + this.Name = id; + this.Icon = null; + } } public Double Rssi { get; private set; } @@ -70,6 +81,8 @@ namespace Fraunhofer.Fit.IoT.LoraMap.Model { public Int32 Batterysimple { get; private set; } public Boolean Fix { get; private set; } public Double Height { get; private set; } + public String Name { get; private set; } + public String Icon { get; private set; } public virtual Dictionary ToDictionary() { Dictionary dictionary = new Dictionary(); diff --git a/Lora-Map/Properties/AssemblyInfo.cs b/Lora-Map/Properties/AssemblyInfo.cs index 20c474e..2dc5b64 100644 --- a/Lora-Map/Properties/AssemblyInfo.cs +++ b/Lora-Map/Properties/AssemblyInfo.cs @@ -1,6 +1,5 @@ using System.Resources; using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden @@ -11,7 +10,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Fraunhofer FIT")] [assembly: AssemblyProduct("Lora-Map")] -[assembly: AssemblyCopyright("Copyright © 2018 - 08.03.2019")] +[assembly: AssemblyCopyright("Copyright © 2018 - 10.03.2019")] [assembly: AssemblyTrademark("Fraunhofer FIT, BlubbFish")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("de-DE")] @@ -34,11 +33,12 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.3")] -[assembly: AssemblyFileVersion("1.1.3")] +[assembly: AssemblyVersion("1.1.4")] +[assembly: AssemblyFileVersion("1.1.4")] /* * 1.1.1 Add Debian package config * 1.1.2 #2 Show versions number in Site * 1.1.3 #1 Click on icon and show details +* 1.1.4 #3 Create icons for devices */ diff --git a/Lora-Map/Server.cs b/Lora-Map/Server.cs index 863a23e..4af7e80 100644 --- a/Lora-Map/Server.cs +++ b/Lora-Map/Server.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Net; using System.Text; using BlubbFish.Utils; @@ -13,8 +14,9 @@ namespace Fraunhofer.Fit.IoT.LoraMap { class Server : Webserver { private readonly SortedDictionary locations = new SortedDictionary(); - - public Server(ADataBackend backend, Dictionary settings, InIReader requests) : base(backend, settings, requests) { } + private readonly JsonData marker; + + public Server(ADataBackend backend, Dictionary settings, InIReader requests) : base(backend, settings, requests) => this.marker = JsonMapper.ToObject(File.ReadAllText("names.json")); protected override void Backend_MessageIncomming(Object sender, BackendEvent e) { try { @@ -33,7 +35,7 @@ namespace Fraunhofer.Fit.IoT.LoraMap { && d["Gps"].ContainsKey("Height") && d["Gps"]["Height"].IsDouble && d.ContainsKey("Name") && d["Name"].IsString) { String name = (String)d["Name"]; - Botclient b = new Botclient(d); + Botclient b = new Botclient(name, d, this.marker); if (this.locations.ContainsKey(name)) { this.locations[name] = b; } else { diff --git a/Lora-Map/names.json b/Lora-Map/names.json new file mode 100644 index 0000000..03c7b06 --- /dev/null +++ b/Lora-Map/names.json @@ -0,0 +1,10 @@ +{ + "A": { + "name": "26/91", + "icon": "icons/marker/thw/einheiten/26-91.png" + }, + "C": { + "name": "27/92", + "icon": "icons/marker/thw/einheiten/27-92.png" + } +} \ No newline at end of file diff --git a/Lora-Map/resources/icons/marker/Person.png b/Lora-Map/resources/icons/marker/Person.png new file mode 100644 index 0000000..37dcdf4 Binary files /dev/null and b/Lora-Map/resources/icons/marker/Person.png differ diff --git a/Lora-Map/resources/icons/marker/Person.svg b/Lora-Map/resources/icons/marker/Person.svg new file mode 100644 index 0000000..b204144 --- /dev/null +++ b/Lora-Map/resources/icons/marker/Person.svg @@ -0,0 +1,363 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + B1 + + + + + + + + diff --git a/Lora-Map/resources/icons/marker/thw/Allgemein.png b/Lora-Map/resources/icons/marker/thw/Allgemein.png new file mode 100644 index 0000000..401a4c5 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/Allgemein.png differ diff --git a/Lora-Map/resources/icons/marker/thw/Marker.svg b/Lora-Map/resources/icons/marker/thw/Marker.svg new file mode 100644 index 0000000..d2c2bf5 --- /dev/null +++ b/Lora-Map/resources/icons/marker/thw/Marker.svg @@ -0,0 +1,119 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + 27/92 + + + + + + diff --git a/Lora-Map/resources/icons/marker/thw/Trupps-Gruppen-Zuege.svg b/Lora-Map/resources/icons/marker/thw/Trupps-Gruppen-Zuege.svg new file mode 100644 index 0000000..99ed82d --- /dev/null +++ b/Lora-Map/resources/icons/marker/thw/Trupps-Gruppen-Zuege.svg @@ -0,0 +1,406 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + B1 + + + + diff --git a/Lora-Map/resources/icons/marker/thw/einheiten/26-91.png b/Lora-Map/resources/icons/marker/thw/einheiten/26-91.png new file mode 100644 index 0000000..bead5ab Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/einheiten/26-91.png differ diff --git a/Lora-Map/resources/icons/marker/thw/einheiten/27-92.png b/Lora-Map/resources/icons/marker/thw/einheiten/27-92.png new file mode 100644 index 0000000..6314724 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/einheiten/27-92.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/Allgemein.png b/Lora-Map/resources/icons/marker/thw/gruppe/Allgemein.png new file mode 100644 index 0000000..b57f3ad Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/Allgemein.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/B1-ASH.png b/Lora-Map/resources/icons/marker/thw/gruppe/B1-ASH.png new file mode 100644 index 0000000..b0e03f6 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/B1-ASH.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/B1-EGS.png b/Lora-Map/resources/icons/marker/thw/gruppe/B1-EGS.png new file mode 100644 index 0000000..9c5a467 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/B1-EGS.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/B1.png b/Lora-Map/resources/icons/marker/thw/gruppe/B1.png new file mode 100644 index 0000000..fc1bc1f Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/B1.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/B2-A.png b/Lora-Map/resources/icons/marker/thw/gruppe/B2-A.png new file mode 100644 index 0000000..c678aa8 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/B2-A.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/B2-B.png b/Lora-Map/resources/icons/marker/thw/gruppe/B2-B.png new file mode 100644 index 0000000..7082390 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/B2-B.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/B2.png b/Lora-Map/resources/icons/marker/thw/gruppe/B2.png new file mode 100644 index 0000000..6d0c39a Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/B2.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/Bel-A.png b/Lora-Map/resources/icons/marker/thw/gruppe/Bel-A.png new file mode 100644 index 0000000..d915102 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/Bel-A.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/Bel-B.png b/Lora-Map/resources/icons/marker/thw/gruppe/Bel-B.png new file mode 100644 index 0000000..db5ee7c Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/Bel-B.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/FGr.png b/Lora-Map/resources/icons/marker/thw/gruppe/FGr.png new file mode 100644 index 0000000..5cb0d60 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/FGr.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/Fuehrer-B.png b/Lora-Map/resources/icons/marker/thw/gruppe/Fuehrer-B.png new file mode 100644 index 0000000..d83e754 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/Fuehrer-B.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/Fuehrer-B1.png b/Lora-Map/resources/icons/marker/thw/gruppe/Fuehrer-B1.png new file mode 100644 index 0000000..e9679f5 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/Fuehrer-B1.png differ diff --git a/Lora-Map/resources/icons/marker/thw/gruppe/Fuehrer-B2.png b/Lora-Map/resources/icons/marker/thw/gruppe/Fuehrer-B2.png new file mode 100644 index 0000000..c59e731 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/gruppe/Fuehrer-B2.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/Allgemein.png b/Lora-Map/resources/icons/marker/thw/trupp/Allgemein.png new file mode 100644 index 0000000..58c6bf7 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/Allgemein.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/B.png b/Lora-Map/resources/icons/marker/thw/trupp/B.png new file mode 100644 index 0000000..d8f1282 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/B.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/B1-ASH.png b/Lora-Map/resources/icons/marker/thw/trupp/B1-ASH.png new file mode 100644 index 0000000..ac87dd2 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/B1-ASH.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/B1-EGS.png b/Lora-Map/resources/icons/marker/thw/trupp/B1-EGS.png new file mode 100644 index 0000000..89e48c9 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/B1-EGS.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/B1.png b/Lora-Map/resources/icons/marker/thw/trupp/B1.png new file mode 100644 index 0000000..0ef9a47 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/B1.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/B2-A.png b/Lora-Map/resources/icons/marker/thw/trupp/B2-A.png new file mode 100644 index 0000000..c6a5eac Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/B2-A.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/B2-B.png b/Lora-Map/resources/icons/marker/thw/trupp/B2-B.png new file mode 100644 index 0000000..ad8f2b0 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/B2-B.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/Bel-A.png b/Lora-Map/resources/icons/marker/thw/trupp/Bel-A.png new file mode 100644 index 0000000..be38763 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/Bel-A.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/Bel-B.png b/Lora-Map/resources/icons/marker/thw/trupp/Bel-B.png new file mode 100644 index 0000000..cf67efb Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/Bel-B.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/FGr.png b/Lora-Map/resources/icons/marker/thw/trupp/FGr.png new file mode 100644 index 0000000..7d0d8b0 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/FGr.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/Fuehrer-B.png b/Lora-Map/resources/icons/marker/thw/trupp/Fuehrer-B.png new file mode 100644 index 0000000..1f221ad Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/Fuehrer-B.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/Fuehrer-B1.png b/Lora-Map/resources/icons/marker/thw/trupp/Fuehrer-B1.png new file mode 100644 index 0000000..ddd9b3f Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/Fuehrer-B1.png differ diff --git a/Lora-Map/resources/icons/marker/thw/trupp/Fuehrer-B2.png b/Lora-Map/resources/icons/marker/thw/trupp/Fuehrer-B2.png new file mode 100644 index 0000000..df14ae9 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/trupp/Fuehrer-B2.png differ diff --git a/Lora-Map/resources/icons/marker/thw/zug/Allgemein.png b/Lora-Map/resources/icons/marker/thw/zug/Allgemein.png new file mode 100644 index 0000000..54bf958 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/zug/Allgemein.png differ diff --git a/Lora-Map/resources/icons/marker/thw/zug/Fuehrer-TZ-1.png b/Lora-Map/resources/icons/marker/thw/zug/Fuehrer-TZ-1.png new file mode 100644 index 0000000..204133d Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/zug/Fuehrer-TZ-1.png differ diff --git a/Lora-Map/resources/icons/marker/thw/zug/Fuehrer-TZ-2.png b/Lora-Map/resources/icons/marker/thw/zug/Fuehrer-TZ-2.png new file mode 100644 index 0000000..474afa6 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/zug/Fuehrer-TZ-2.png differ diff --git a/Lora-Map/resources/icons/marker/thw/zug/Fuehrer-TZ.png b/Lora-Map/resources/icons/marker/thw/zug/Fuehrer-TZ.png new file mode 100644 index 0000000..91cac18 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/zug/Fuehrer-TZ.png differ diff --git a/Lora-Map/resources/icons/marker/thw/zug/TZ-Bel-A.png b/Lora-Map/resources/icons/marker/thw/zug/TZ-Bel-A.png new file mode 100644 index 0000000..f104827 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/zug/TZ-Bel-A.png differ diff --git a/Lora-Map/resources/icons/marker/thw/zug/TZ-Bel-B.png b/Lora-Map/resources/icons/marker/thw/zug/TZ-Bel-B.png new file mode 100644 index 0000000..ebcd090 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/zug/TZ-Bel-B.png differ diff --git a/Lora-Map/resources/icons/marker/thw/zug/TZ-BrB-A.png b/Lora-Map/resources/icons/marker/thw/zug/TZ-BrB-A.png new file mode 100644 index 0000000..a6953e2 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/zug/TZ-BrB-A.png differ diff --git a/Lora-Map/resources/icons/marker/thw/zug/TZ-BrB-B.png b/Lora-Map/resources/icons/marker/thw/zug/TZ-BrB-B.png new file mode 100644 index 0000000..9e7df00 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/zug/TZ-BrB-B.png differ diff --git a/Lora-Map/resources/icons/marker/thw/zug/TZ-E.png b/Lora-Map/resources/icons/marker/thw/zug/TZ-E.png new file mode 100644 index 0000000..4d46f34 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/zug/TZ-E.png differ diff --git a/Lora-Map/resources/icons/marker/thw/zug/TZ-FGr.png b/Lora-Map/resources/icons/marker/thw/zug/TZ-FGr.png new file mode 100644 index 0000000..ad312f2 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/zug/TZ-FGr.png differ diff --git a/Lora-Map/resources/icons/marker/thw/zug/TZ.png b/Lora-Map/resources/icons/marker/thw/zug/TZ.png new file mode 100644 index 0000000..1484327 Binary files /dev/null and b/Lora-Map/resources/icons/marker/thw/zug/TZ.png differ diff --git a/Lora-Map/resources/js/marker.js b/Lora-Map/resources/js/marker.js index 90319ec..2551daa 100644 --- a/Lora-Map/resources/js/marker.js +++ b/Lora-Map/resources/js/marker.js @@ -11,14 +11,25 @@ function datarunner() { //https://leafletjs.com/reference-1.4.0.html#marker function parsedata() { - if (this.readyState == 4 && this.status == 200) { + if (this.readyState === 4 && this.status === 200) { serverLocation = JSON.parse(this.responseText); for (var key in serverLocation) { if (serverLocation.hasOwnProperty(key)) { var markeritem = serverLocation[key]; - if (markeritem['Latitude'] != 0 || markeritem['Longitude'] != 0) { + if (markeritem['Latitude'] !== 0 || markeritem['Longitude'] !== 0) { if (!markers.hasOwnProperty(key)) { - markers[key] = L.marker([markeritem['Latitude'], markeritem['Longitude']], { 'title': key }).addTo(mymap).on("click", showMarkerInfo, key); + var marker = null; + if (markeritem['Icon'] === null) { + marker = L.marker([markeritem['Latitude'], markeritem['Longitude']], { 'title': markeritem['Name'] }); + } else { + var myIcon = L.icon({ + 'iconUrl': markeritem['Icon'], + 'iconSize': [56, 80], + 'iconAnchor': [0, 80] + }); + marker = L.marker([markeritem['Latitude'], markeritem['Longitude']], { 'title': markeritem['Name'], 'icon': myIcon }); + } + markers[key] = marker.addTo(mymap).on("click", showMarkerInfo, key); } else { markers[key].setLatLng([markeritem['Latitude'], markeritem['Longitude']]); } diff --git a/Lora-Map/resources/js/menu.js b/Lora-Map/resources/js/menu.js index 2dd4520..a562630 100644 --- a/Lora-Map/resources/js/menu.js +++ b/Lora-Map/resources/js/menu.js @@ -4,8 +4,9 @@ function showHidePanel(name) { document.getElementById("pannels").style.display = "block"; document.getElementById(name).style.display = "block"; visiblePanel = name; - } else if (visiblePanel === name && name !== "pannels_info") { + } else if (visiblePanel === name && name !== "pannels_info" || name === null) { document.getElementById("pannels").style.display = "none"; + document.getElementById(visiblePanel).style.display = "none"; visiblePanel = null; } else { document.getElementById(visiblePanel).style.display = "none"; @@ -31,7 +32,7 @@ function updateDeviceStatus() { document.getElementById("pannels_info").innerHTML = ""; if (serverLocation.hasOwnProperty(statusToDevice)) { var markeritem = serverLocation[statusToDevice]; - var html = "
Name: " + statusToDevice + "
"; + var html = "
Name: " + markeritem["Name"] + "
"; html += "
Batterie: " + markeritem["Battery"] + "V
"; if (markeritem["Fix"]) { html += "
GPS-Empfang
"; @@ -58,11 +59,11 @@ function updateStatus() { divItem.setAttribute("rel", name); var spanColor = document.createElement("span"); spanColor.className = "color"; - if (markeritem["Batterysimple"] == 0) { + if (markeritem["Batterysimple"] === 0) { spanColor.style.backgroundColor = "red"; - } else if (markeritem["Batterysimple"] == 1 || markeritem["Batterysimple"] == 2) { + } else if (markeritem["Batterysimple"] === 1 || markeritem["Batterysimple"] === 2) { spanColor.style.backgroundColor = "yellow"; - } else if (markeritem["Batterysimple"] == 3 || markeritem["Batterysimple"] == 4) { + } else if (markeritem["Batterysimple"] === 3 || markeritem["Batterysimple"] === 4) { spanColor.style.backgroundColor = "green"; } divItem.appendChild(spanColor); @@ -76,7 +77,7 @@ function updateStatus() { divLine1.className = "line1"; var spanName = document.createElement("span"); spanName.className = "name"; - spanName.innerText = name; + spanName.innerText = markeritem["Name"]; divLine1.appendChild(spanName); var spanAkku = document.createElement("span"); spanAkku.className = "akku"; @@ -110,10 +111,10 @@ function timeDiffToText(time) { if (diff < 60) { return diff + " s"; } - if (diff < (60 * 60)) { + if (diff < 60 * 60) { return Math.floor(diff / 60) + " m"; } - if (diff < (60 * 60 * 24)) { + if (diff < 60 * 60 * 24) { return Math.floor(diff / (60 * 60)) + " h"; } return Math.floor(diff / (60 * 60 * 24)) + " d"; diff --git a/Lora-Map/resources/js/nav.js b/Lora-Map/resources/js/nav.js index 1d4df22..8f31acd 100644 --- a/Lora-Map/resources/js/nav.js +++ b/Lora-Map/resources/js/nav.js @@ -1,8 +1,14 @@ -var mymap = L.map('bigmap').setView([{%START_LOCATION%}], 14); +var mymap = L.map('bigmap').setView(["{%START_LOCATION%}"], 14); L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', { attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox', maxZoom: 20, id: 'mapbox.streets', - accessToken: '{%YOUR_API_KEY%}' -}).addTo(mymap); \ No newline at end of file + accessToken: '"{%YOUR_API_KEY%}"' +}).addTo(mymap); + +mymap.on("click", hidePanel); + +function hidePanel(e) { + showHidePanel(null); +} \ No newline at end of file