handle location messages only

This commit is contained in:
Jan-Piet Mens 2015-09-08 12:38:23 +02:00
parent 059c7ded1d
commit 31bb69d4b0

View File

@ -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('<span style="color: blue;">RESPONSE: ' + ev.data + ' </span>');
try {
var loc = JSON.parse(ev.data);
map_marker(loc);
if (loc['_type'] == 'location') {
map_marker(loc);
}
} catch (x) {
;
}