@@ -25,11 +25,15 @@ var bearing_confidence_threshold = 5.0;
2525var bearing_max_age = 10 * 60.0 ;
2626
2727var bearing_length = 10000 ;
28- var bearing_weight = 0.5 ;
28+ var bearing_weight = 1.0 ;
29+ var manual_bearing_weight = 5.0 ; // Should probably add this to a setting
2930var bearing_color = "#000000" ;
3031var bearing_max_opacity = 0.8 ;
3132var bearing_min_opacity = 0.1 ;
3233
34+ // If any of these tags are in the bearing source name, we consider this a 'manual' bearing and make the line thicker.
35+ var manual_bearing_sources = [ "BPI" , "manual" , "EasyBearing" ] ;
36+
3337var bearing_large_plot = false ;
3438
3539// Store for the latest server timestamp.
@@ -50,6 +54,7 @@ var timeSeqTimes = [0,0,0,0];
5054function updateBearingSettings ( ) {
5155 // Update bearing settings, but do *not* redraw.
5256 bearing_weight = parseFloat ( $ ( '#bearingWeight' ) . val ( ) ) ;
57+ manual_bearing_weight = parseFloat ( $ ( '#manualBearingWeight' ) . val ( ) ) ;
5358 bearing_length = parseFloat ( $ ( '#bearingLength' ) . val ( ) ) * 1000 ;
5459 bearing_confidence_threshold = parseFloat ( $ ( '#bearingConfidenceThreshold' ) . val ( ) ) ;
5560 bearing_max_age = parseFloat ( $ ( '#bearingMaximumAge' ) . val ( ) ) * 60.0 ;
@@ -152,11 +157,21 @@ function addBearing(timestamp, bearing, live){
152157
153158 var _opacity = calculateBearingOpacity ( timestamp ) ;
154159
160+ var _is_manual_bearing = manual_bearing_sources . some ( function ( s ) {
161+ return bearing . source . toLowerCase ( ) . includes ( s . toLowerCase ( ) ) ;
162+ } ) ;
163+
164+ if ( _is_manual_bearing ) {
165+ var _temp_bearing_weight = manual_bearing_weight ;
166+ } else {
167+ var _temp_bearing_weight = bearing_weight ;
168+ }
169+
155170 // Create the PolyLine
156171 bearing_store [ timestamp ] . line = L . polyline (
157172 [ [ bearing_store [ timestamp ] . lat , bearing_store [ timestamp ] . lon ] , _end ] , {
158173 color : bearing_color ,
159- weight : bearing_weight ,
174+ weight : _temp_bearing_weight ,
160175 opacity : _opacity
161176 } ) ;
162177
@@ -211,10 +226,20 @@ function restyleBearings(){
211226 // Calculate the end position.
212227 var _opacity = calculateBearingOpacity ( key ) ;
213228
229+ var _is_manual_bearing = manual_bearing_sources . some ( function ( s ) {
230+ return bearing_store [ key ] . source . toLowerCase ( ) . includes ( s . toLowerCase ( ) ) ;
231+ } ) ;
232+
233+ if ( _is_manual_bearing ) {
234+ var _temp_bearing_weight = manual_bearing_weight ;
235+ } else {
236+ var _temp_bearing_weight = bearing_weight ;
237+ }
238+
214239 // Create the PolyLine
215240 bearing_store [ key ] . line . setStyle ( {
216241 color : bearing_color ,
217- weight : bearing_weight ,
242+ weight : _temp_bearing_weight ,
218243 opacity : _opacity
219244 } ) ;
220245
@@ -235,12 +260,21 @@ function redrawBearings(){
235260 var _end = calculateDestination ( L . latLng ( [ bearing_store [ key ] . lat , bearing_store [ key ] . lon ] ) , bearing_store [ key ] . true_bearing , bearing_length ) ;
236261 var _opacity = calculateBearingOpacity ( key ) ;
237262
263+ var _is_manual_bearing = manual_bearing_sources . some ( function ( s ) {
264+ return bearing_store [ key ] . source . toLowerCase ( ) . includes ( s . toLowerCase ( ) ) ;
265+ } ) ;
266+
267+ if ( _is_manual_bearing ) {
268+ var _temp_bearing_weight = manual_bearing_weight ;
269+ } else {
270+ var _temp_bearing_weight = bearing_weight ;
271+ }
238272
239273 // Create the PolyLine
240274 bearing_store [ key ] . line = L . polyline (
241275 [ [ bearing_store [ key ] . lat , bearing_store [ key ] . lon ] , _end ] , {
242276 color : bearing_color ,
243- weight : bearing_weight ,
277+ weight : _temp_bearing_weight ,
244278 opacity : _opacity
245279 } ) ;
246280
0 commit comments