fix #165
This commit is contained in:
parent
e00d70b385
commit
a30f51e5a0
|
|
@ -147,6 +147,18 @@ int readLine(Stream &stream, char *buffer, int maxlen) {
|
||||||
// Replaces placeholder with LED state value
|
// Replaces placeholder with LED state value
|
||||||
String processor(const String& var) {
|
String processor(const String& var) {
|
||||||
Serial.println(var);
|
Serial.println(var);
|
||||||
|
if (var == "MAPCENTER") {
|
||||||
|
double lat, lon;
|
||||||
|
if(gpsPos.valid) { lat=gpsPos.lat; lon=gpsPos.lon; }
|
||||||
|
else { lat = sonde.config.rxlat; lon = sonde.config.rxlon; }
|
||||||
|
if( !isnan(lat) && !isnan(lon) ) {
|
||||||
|
char p[40];
|
||||||
|
snprintf(p, 40, "%g,%g", lat, lon);
|
||||||
|
return String(p);
|
||||||
|
} else {
|
||||||
|
return String("48,13");
|
||||||
|
}
|
||||||
|
}
|
||||||
if (var == "VERSION_NAME") {
|
if (var == "VERSION_NAME") {
|
||||||
return String(version_name);
|
return String(version_name);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
|
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
|
||||||
|
<script>var mapcenter=[%MAPCENTER%];</script>
|
||||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
|
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
|
||||||
<script src="https://unpkg.com/leaflet.marker.slideto@0.2.0/Leaflet.Marker.SlideTo.js"></script>
|
<script src="https://unpkg.com/leaflet.marker.slideto@0.2.0/Leaflet.Marker.SlideTo.js"></script>
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,8 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
map.setView([51.163361,10.447683], 5); // Mitte DE
|
if(mapcenter) map.setView(mapcenter, 5);
|
||||||
|
else map.setView([51.163361,10.447683], 5); // Mitte DE
|
||||||
|
|
||||||
var reddot = '<span class="ldot rbg"></span>';
|
var reddot = '<span class="ldot rbg"></span>';
|
||||||
var yellowdot = '<span class="ldot ybg"></span>';
|
var yellowdot = '<span class="ldot ybg"></span>';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue