Skip to content

Commit d02f537

Browse files
committed
maybe stop subtype jitter
1 parent b5fce65 commit d02f537

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

js/tracker.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,17 +1032,11 @@ function updateVehicleInfo(vcallsign, newPosition) {
10321032
var latlng = new L.LatLng(newPosition.gps_lat, newPosition.gps_lon);
10331033
}
10341034

1035-
// update market z-index based on latitude, 90 being background and -90 foreground
1036-
// the first 2 decimal digits are included for added accuracy
1037-
var zIndex = 900000 - parseInt(newPosition.gps_lat*10000);
1038-
10391035
// update position
10401036
if(vehicle.marker_shadow) {
10411037
vehicle.marker_shadow.setLatLng(latlng);
1042-
//vehicle.marker_shadow.setZIndex(Z_SHADOW + zIndex);
10431038
}
10441039
vehicle.marker.setLatLng(latlng);
1045-
//vehicle.marker.setZIndex(((vehicle.vehicle_type=="car")? Z_CAR : Z_PAYLOAD) + zIndex);
10461040

10471041
if(!!vehicle.marker.setCourse) {
10481042
if (vehicle.curr_position.gps_heading) {
@@ -1165,8 +1159,6 @@ function updateVehicleInfo(vcallsign, newPosition) {
11651159
$('.portrait').append('<div class="row vehicle'+vehicle.uuid+'" data-vcallsign="'+vcallsign+'"></div>');
11661160
$('.landscape').append('<div class="row vehicle'+vehicle.uuid+'" data-vcallsign="'+vcallsign+'"></div>');
11671161
}
1168-
1169-
11701162

11711163
} else if(elm.attr('data-vcallsign') === undefined) {
11721164
elm.attr('data-vcallsign', vcallsign);
@@ -2220,6 +2212,10 @@ function addPosition(position) {
22202212
var curr_ts = convert_time(vehicle.curr_position.gps_time);
22212213
var dt = (new_ts - curr_ts) / 1000; // convert to seconds
22222214

2215+
if (position.type.length < vehicle.curr_position.type) {
2216+
position.type.length = vehicle.curr_position.type;
2217+
}
2218+
22232219
if(dt >= 0) {
22242220
if(vehicle.num_positions > 0) {
22252221
// calculate vertical rate
@@ -2904,16 +2900,12 @@ function liveData() {
29042900
$("#stText").text("websocket |");
29052901
})
29062902

2907-
client.on('connect', function () {
2908-
client.subscribe('#')
2909-
$("#stText").text("websocket |");
2910-
})
2911-
29122903
client.on('message', function (topic, message) {
29132904
var frame = JSON.parse(message.toString());
29142905
var test = formatData(frame, true);
29152906
update(test);
29162907
$("#stTimer").attr("data-timestamp", new Date().getTime());
2908+
$("#stText").text("websocket |");
29172909
})
29182910
}
29192911

0 commit comments

Comments
 (0)