map: allow rename of topic in map popups

This commit is contained in:
Jan-Piet Mens
2016-02-04 13:00:17 +01:00
parent 0eb1149fc2
commit 44a990083f
4 changed files with 23 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
/*
* Optionally rename the topic in the location popup on the map
*/
var renames = {
'owntracks/jjolie/phone' : 'Jane Jolie',
'owntracks/john/android' : "John Smith",
};
+9
View File
@@ -0,0 +1,9 @@
/*
* Optionally rename the topic in the location popup on the map
*/
var renames = {
'owntracks/jjolie/phone' : 'Jane Jolie',
'owntracks/john/android' : "John Smith",
};
+4 -1
View File
@@ -129,8 +129,11 @@ function map_marker(loc)
var dt = moment.utc(loc.tst * 1000).local();
var userdev = username + "/" + device;
userdev = renames[userdev] ? renames[userdev] : userdev;
var data = {
userdev: username + "/" + device,
userdev: userdev,
ghash: loc.ghash ? loc.ghash : 'unknown',
addr: loc.addr,
lat: loc.lat,
+1
View File
@@ -31,6 +31,7 @@
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
<script src="functions.js"></script>
<script src="websock.js"></script>
<script src="config.js"></script>
<script src="../table/js/moment.min.js"></script>
<script src="../table/js/mustache.js"></script>
</head>