{"action":"created","issue":{"url":"https://api.github.com/repos/owntracks/recorder/issues/241","repository_url":"https://api.github.com/repos/owntracks/recorder","labels_url":"https://api.github.com/repos/owntracks/recorder/issues/241/labels{/name}","comments_url":"https://api.github.com/repos/owntracks/recorder/issues/241/comments","events_url":"https://api.github.com/repos/owntracks/recorder/issues/241/events","html_url":"https://github.com/owntracks/recorder/issues/241","id":332976726,"node_id":"MDU6SXNzdWUzMzI5NzY3MjY=","number":241,"title":"How to add speed information to map points?","user":{"login":"edautz","id":11003867,"node_id":"MDQ6VXNlcjExMDAzODY3","avatar_url":"https://avatars2.githubusercontent.com/u/11003867?v=4","gravatar_id":"","url":"https://api.github.com/users/edautz","html_url":"https://github.com/edautz","followers_url":"https://api.github.com/users/edautz/followers","following_url":"https://api.github.com/users/edautz/following{/other_user}","gists_url":"https://api.github.com/users/edautz/gists{/gist_id}","starred_url":"https://api.github.com/users/edautz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edautz/subscriptions","organizations_url":"https://api.github.com/users/edautz/orgs","repos_url":"https://api.github.com/users/edautz/repos","events_url":"https://api.github.com/users/edautz/events{/privacy}","received_events_url":"https://api.github.com/users/edautz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-16T10:04:50Z","updated_at":"2018-06-16T12:58:43Z","closed_at":null,"author_association":"NONE","body":"I made a GPS car tracker device that logs data to Ot-recorder.\r\n\r\nThe data is logged in the correct file : store/rec/eugene/auto and contains vel(ocity) data.\r\n\r\n```\r\n2018-06-15T08:44:41Z    *                       {\"tst\":1529052281.865,\"_type\":\"location\",\"lon\":5.7983,\"vac\":10,\"lat\":51.0101,\"vel\":104.63,\"bat\r\nt\":\"--\",\"conn\":\"l\",\"tid\":\"1\",\"topic\":\"owntracks/eugene/auto\",\"username\":\"eugene\",\"device\":\"auto\",\"fulldate\":\"Fri Jun 15 2018 10:44:41 GMT+0200\r\n (CEST)\"}\r\n2018-06-15T08:55:16Z    *                       {\"tst\":1529052916.414,\"_type\":\"location\",\"lon\":5.9291,\"vac\":10,\"lat\":51.1439,\"vel\":101.48,\"bat\r\nt\":\"--\",\"conn\":\"l\",\"tid\":\"1\",\"topic\":\"owntracks/eugene/auto\",\"username\":\"eugene\",\"device\":\"auto\",\"fulldate\":\"Fri Jun 15 2018 10:55:16 GMT+0200\r\n (CEST)\"}\r\n2018-06-15T08:57:16Z    *                       {\"tst\":1529053036.596,\"_type\":\"location\",\"lon\":5.9656,\"vac\":10,\"lat\":51.1644,\"vel\":104.1,\"batt\r\n\":\"--\",\"conn\":\"l\",\"tid\":\"1\",\"topic\":\"owntracks/eugene/auto\",\"username\":\"eugene\",\"device\":\"auto\",\"fulldate\":\"Fri Jun 15 2018 10:57:16 GMT+0200\r\n(CEST)\"}\r\n2018-06-15T08:58:16Z    *                       {\"tst\":1529053096.618,\"_type\":\"location\",\"lon\":5.9826,\"vac\":10,\"lat\":51.1742,\"vel\":100.76,\"bat\r\nt\":\"--\",\"conn\":\"l\",\"tid\":\"1\",\"topic\":\"owntracks/eugene/auto\",\"username\":\"eugene\",\"device\":\"auto\",\"fulldate\":\"Fri Jun 15 2018 10:58:16 GMT+0200\r\n (CEST)\"}\r\n2018-06-15T09:02:46Z    *                       {\"tst\":1529053366.397,\"_type\":\"location\",\"lon\":6.0237,\"vac\":10,\"lat\":51.2078,\"vel\":10.16,\"batt\r\n\":\"--\",\"conn\":\"l\",\"tid\":\"1\",\"topic\":\"owntracks/eugene/auto\",\"username\":\"eugene\",\"device\":\"auto\",\"fulldate\":\"Fri Jun 15 2018 11:02:46 GMT+0200\r\n(CEST)\"}\r\n```\r\n\r\nHowever this data is not show on the maps with the data points! It displays only address, lat,lon, and time.\r\n\r\nI tracekd down this behaviour to the htdocs/map/functions.js file.\r\n\r\nIn this file  I added some statements to display the speed:\r\n\r\n```\r\n             // click dot on map to show info\r\n        map.data.addListener('click', function(event) {\r\n                var tst = event.feature.getProperty('tst');\r\n                var dt = moment.utc(tst * 1000).local();\r\n                var data = {\r\n                        lat:   event.latLng.lat().toFixed(4),\r\n                        lon:   event.latLng.lng().toFixed(4),\r\n           ====> speed: event.feature.getProperty('vel'),\r\n                        tst:   tst,\r\n                        addr:  event.feature.getProperty('address'),\r\n                        fulldate: dt.format(\"DD MMM YYYY HH:mm:ss\"),\r\n                };\r\n\r\n      =====>   var t = \"{{ addr }}<br/> {{ speed }}<span class='latlon'>({{ lat }},{{lon}})</span> {{ fulldate }}\";\r\n                if (typeof(tst) === 'undefined') {\r\n                        t = \"Position: {{lat}}, {{lon}}\";\r\n                }\r\n\r\n                infowindow.setContent(Mustache.render(t, data));\r\n                infowindow.setPosition(event.latLng);\r\n                infowindow.open(map);\r\n        });   \r\n```\r\n\r\nBut nothings changes. I refreshed the webbrowser and the OT-recorder docker container, but that doesn't matter.\r\n\r\nCan anyone help me out?"},"comment":{"url":"https://api.github.com/repos/owntracks/recorder/issues/comments/397810860","html_url":"https://github.com/owntracks/recorder/issues/241#issuecomment-397810860","issue_url":"https://api.github.com/repos/owntracks/recorder/issues/241","id":397810860,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzgxMDg2MA==","user":{"login":"edautz","id":11003867,"node_id":"MDQ6VXNlcjExMDAzODY3","avatar_url":"https://avatars2.githubusercontent.com/u/11003867?v=4","gravatar_id":"","url":"https://api.github.com/users/edautz","html_url":"https://github.com/edautz","followers_url":"https://api.github.com/users/edautz/followers","following_url":"https://api.github.com/users/edautz/following{/other_user}","gists_url":"https://api.github.com/users/edautz/gists{/gist_id}","starred_url":"https://api.github.com/users/edautz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edautz/subscriptions","organizations_url":"https://api.github.com/users/edautz/orgs","repos_url":"https://api.github.com/users/edautz/repos","events_url":"https://api.github.com/users/edautz/events{/privacy}","received_events_url":"https://api.github.com/users/edautz/received_events","type":"User","site_admin":false},"created_at":"2018-06-16T12:58:43Z","updated_at":"2018-06-16T12:58:43Z","author_association":"NONE","body":"Modified the code a bit and commented the check for tst out, so my tst precision of milles wil not bother. I will fix that later to an integer.\r\n\r\n        // click dot on map to show info\r\n        map.data.addListener('click', function(event) {\r\n                var tst = event.feature.getProperty('tst');\r\n                var dt = moment.utc(tst * 1000).local();\r\n                var speed = event.feature.getProperty('vel');\r\n                var data = {\r\n                        lat:   event.latLng.lat().toFixed(4),\r\n                        lon:   event.latLng.lng().toFixed(4),\r\n                        speed: speed,\r\n                        tst:   tst,\r\n                        addr:  event.feature.getProperty('address'),\r\n                        fulldate: dt.format(\"DD MMM YYYY HH:mm:ss\"),\r\n                };\r\n\r\n                var t = \"{{ addr }}<br/>{{ speed }}<span class='latlon'>({{ lat }},{{lon}})</span> {{ fulldate }}\";\r\n                //if (typeof(tst) === 'undefined') {\r\n                //      t = \"Position: {{lat}}, {{lon}}\";\r\n                //}\r\n\r\n                console.log(\"speed=\" + speed);\r\n\r\n                infowindow.setContent(Mustache.render(t, data));\r\n                infowindow.setPosition(event.latLng);\r\n                infowindow.open(map);\r\n\r\nBut                 var speed = event.feature.getProperty('vel'); doesn't work.\r\n\r\nConsole log:\r\n\r\ndataURL = http://192.168.2.113:8083/api/0/locations?user=eugene&device=auto&format=geojson&from=2018-06-14T00:28\r\nfunctions.js:94 \r\n\r\nspeed=undefined\r\n\r\nCan you tell how to fix this?\r\n"}}
{"actor":{"display_login":"edautz"}}