diff --git a/mqtt-map/App.config b/mqtt-map/App.config deleted file mode 100644 index 4bba09a..0000000 --- a/mqtt-map/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/mqtt-map/Googlelocation.cs b/mqtt-map/Googlelocation.cs index b4539d5..bb794be 100644 --- a/mqtt-map/Googlelocation.cs +++ b/mqtt-map/Googlelocation.cs @@ -69,7 +69,7 @@ namespace Fraunhofer.Fit.IoT.Bots.LoraBot.Moduls_broken { public Googlelocation(ADataBackend backend, Dictionary settings) { this.config = settings; backend.MessageIncomming += this.Backend_MessageIncomming; - this._listener.Prefixes.Add("http://"+ this.config["prefix"] + ":8080/"); + this._listener.Prefixes.Add(this.config["prefix"]); this._listener.Start(); this.Run(); } diff --git a/mqtt-map/Program.cs b/mqtt-map/Program.cs index 5a29aa5..8295911 100644 --- a/mqtt-map/Program.cs +++ b/mqtt-map/Program.cs @@ -7,7 +7,8 @@ using Fraunhofer.Fit.IoT.Bots.LoraBot.Moduls_broken; namespace mqtt_map { class Program { static void Main(String[] args) { - if(!InIReader.ConfigExist("settings")) { + InIReader.SetSearchPath(new List() { "/etc/mqttmap", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mqttmap" }); + if (!InIReader.ConfigExist("settings")) { Console.WriteLine("settings.ini not found!"); Console.ReadLine(); return; diff --git a/mqtt-map/mqtt-map.csproj b/mqtt-map/mqtt-map.csproj index 1c26088..b541c71 100644 --- a/mqtt-map/mqtt-map.csproj +++ b/mqtt-map/mqtt-map.csproj @@ -50,7 +50,6 @@ - PreserveNewest diff --git a/mqtt-map/resources/google.html b/mqtt-map/resources/google.html index 9875956..e94c323 100644 --- a/mqtt-map/resources/google.html +++ b/mqtt-map/resources/google.html @@ -16,19 +16,25 @@ margin: 0; padding: 0; } + #title { + position: absolute; + z-index: 10000; + margin-left: 110px; + margin-top: 7px; + color: #e23232; + } -

Google Map

+

Mqtt-Map Monica

@@ -77,6 +83,11 @@ infowindow.open(map, m); }); m.setMap(map); + if (!center_set) { + map.setCenter(new google.maps.LatLng(list[pos]["Latitude"], list[pos]["Longitude"])); + smoothZoom(15, map.getZoom()); + center_set = true; + } j++; } } @@ -96,6 +107,17 @@ xhttp.send(); } setInterval(get_elm, 5000); + function smoothZoom(max, current) { + if (current >= max) { + return; + } else { + var z = google.maps.event.addListener(map, 'zoom_changed', function (event) { + google.maps.event.removeListener(z); + smoothZoom(max, current + 1); + }); + setTimeout(function () { map.setZoom(current) }, 150); + } + } diff --git a/mqtt-map/settings.conf.example b/mqtt-map/settings.conf.example index eeed973..f5ceafe 100644 --- a/mqtt-map/settings.conf.example +++ b/mqtt-map/settings.conf.example @@ -4,4 +4,4 @@ server=127.0.0.1 [google] api_key=abc -prefix=localhost \ No newline at end of file +prefix=http://+:8080/ \ No newline at end of file