mirror of
https://github.com/owntracks/recorder.git
synced 2026-08-23 11:26:16 +00:00
Update map_leaflet.js
Added speed parameter on the openstreet map points map, but only when speed > 0.
This commit is contained in:
@@ -45,11 +45,19 @@ function initialize_leaflet() {
|
||||
var dt = moment.utc(tst * 1000).local();
|
||||
data.tst = tst;
|
||||
data.fulldate = dt.format("DD MMM YYYY HH:mm:ss")
|
||||
var t = "{{ addr }}<br/><span class='latlon'>({{ lat }},{{lon}})</span> {{ fulldate }}";
|
||||
if (typeof(tst) === 'undefined') {
|
||||
t = "Position: {{lat}}, {{lon}}";
|
||||
var t = "{{ addr }}<br/><span class='latlon'>({{ lat }},{{lon}})</span> {{ fulldate }}<br/> Speed: {{ speed }}";
|
||||
// if speed is 0 then don't display speed
|
||||
if (speed === 0) {
|
||||
t = "{{ addr }}<br/><span class='latlon'>({{ lat }},{{lon}})</span> {{ fulldate }}"
|
||||
}
|
||||
|
||||
if (typeof(tst) === 'undefined') {
|
||||
t = "Position: ({{lat}},{{lon}})<br/>Speed: {{speed}}";
|
||||
}
|
||||
// if speed is 0 then don't display speed
|
||||
if (typeof(tst) === 'undefined' && speed === 0) {
|
||||
t = "Position: ({{lat}},{{lon}})";
|
||||
}
|
||||
|
||||
layer.bindPopup(Mustache.render(t, data));
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user