From 31bb69d4b0b8db6fe4ccd0ead9a67f86712b5bdb Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Tue, 8 Sep 2015 12:38:23 +0200 Subject: [PATCH] handle location messages only --- wdocs/last/ws.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wdocs/last/ws.js b/wdocs/last/ws.js index 4840bf9..0ea4ad4 100644 --- a/wdocs/last/ws.js +++ b/wdocs/last/ws.js @@ -12,7 +12,7 @@ window.onload = function() { websocket = new WebSocket(url); websocket.onopen = function(ev) { - // out('CONNECTED'); + out('CONNECTED'); var msg = 'LAST'; // out('SENT: ' + msg); websocket.send(msg); @@ -29,7 +29,10 @@ window.onload = function() { // out('RESPONSE: ' + ev.data + ' '); try { var loc = JSON.parse(ev.data); - map_marker(loc); + + if (loc['_type'] == 'location') { + map_marker(loc); + } } catch (x) { ; }