Skip to content

Commit

Permalink
Added feature counts for 3 WebSocket streams
Browse files Browse the repository at this point in the history
  • Loading branch information
De Wet van Niekerk committed Oct 3, 2014
1 parent 6ba425b commit 9e9627a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
13 changes: 13 additions & 0 deletions www/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,17 @@ body {

#map_canvas{
height:100%;
}

#count-badges {
font-size: 75%;
position: absolute;
bottom: 25px;
right: 10px;
background-color: rgba(255,255,255,0.75);
padding: 5px 10px;
}

#count-badges .badge {
font-size: 75%;
}
8 changes: 7 additions & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@
</div>

<div class="container">
<div id="map_canvas"></div>
<div id="map_canvas"></div>
<div id="count-badges">
<p><b>Messages received</b></p>
<p><span id="shipcount" class="badge">0</span> Ships</p>
<p><span id="buscount" class="badge">0</span> Buses</p>
<p><span id="planecount" class="badge">0</span> Planes</p>
</div>
</div>
</body>
</html>
13 changes: 12 additions & 1 deletion www/js/spatialDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ function initialize() {
token : "b442e0b8ea9f85c1860ee85d8c6709d36ab40bb4"
});

var shipcount = document.getElementById('shipcount');
var buscount = document.getElementById('buscount');
var planecount = document.getElementById('planecount');

var myLatlng = new google.maps.LatLng(37.7850,-122.4183);

var myOptions = {
Expand Down Expand Up @@ -59,6 +63,9 @@ function initialize() {
}
*/


shipcount.textContent = parseInt(shipcount.textContent) + 1;

var data = evt.data;
dataObj = eval('(' + eval('(' + data + ')').ws_publisher_content + ')');
// document.getElementById('container').innerHTML = dataObj['latitude'];
Expand Down Expand Up @@ -123,7 +130,9 @@ function initialize() {
"speed": "0.0"
}
*/


buscount.textContent = parseInt(buscount.textContent) + 1;

var data = evt.data;
dataObj = eval('(' + eval('(' + data + ')').ws_publisher_content + ')');

Expand Down Expand Up @@ -172,6 +181,8 @@ function initialize() {
}
*/

planecount.textContent = parseInt(planecount.textContent) + 1;

var data = evt.data;
dataObj = eval('(' + eval('(' + data + ')').ws_publisher_content + ')');

Expand Down

0 comments on commit 9e9627a

Please sign in to comment.