Change Mqtt-Map a bit
This commit is contained in:
parent
3a1d3f27cc
commit
2d76fef3cf
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" />
|
||||
</startup>
|
||||
</configuration>
|
@ -69,7 +69,7 @@ namespace Fraunhofer.Fit.IoT.Bots.LoraBot.Moduls_broken {
|
||||
public Googlelocation(ADataBackend backend, Dictionary<String, String> 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();
|
||||
}
|
||||
|
@ -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<String>() { "/etc/mqttmap", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mqttmap" });
|
||||
if (!InIReader.ConfigExist("settings")) {
|
||||
Console.WriteLine("settings.ini not found!");
|
||||
Console.ReadLine();
|
||||
return;
|
||||
|
@ -50,7 +50,6 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="app.manifest" />
|
||||
<None Include="settings.conf.example">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
@ -16,19 +16,25 @@
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#title {
|
||||
position: absolute;
|
||||
z-index: 10000;
|
||||
margin-left: 110px;
|
||||
margin-top: 7px;
|
||||
color: #e23232;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Google Map</h1>
|
||||
<h1 id="title">Mqtt-Map Monica</h1>
|
||||
<div id="map"></div>
|
||||
<script>
|
||||
var map;
|
||||
var center_set = false;
|
||||
function initMap() {
|
||||
var myLatLng = { lat: 50.784077, lng: 7.228756 };
|
||||
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
zoom: 15,
|
||||
center: myLatLng
|
||||
zoom: 3,
|
||||
center: new google.maps.LatLng(0, 0)
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -4,4 +4,4 @@ server=127.0.0.1
|
||||
|
||||
[google]
|
||||
api_key=abc
|
||||
prefix=localhost
|
||||
prefix=http://+:8080/
|
Loading…
Reference in New Issue
Block a user