@@ -73,8 +73,8 @@ var manual_pan = false;
7373// due to complaints it was not visible enough. - 2023-06-03
7474
7575var car_index = 0 ;
76- var car_colors = [ "blue " , "red " , "green " , "yellow " , "teal " , "purple " ] ;
77- var balloon_colors = [ "red " , "blue " , "lime " , "magenta " , "#ffb300 " , "#00ffff " ] ;
76+ var car_colors = [ "#a6cee3 " , "#1f78b4 " , "#fb9a99 " , "#e31a1c " , "#fdbf6f " , "#ff7f00" , "#cab2d6 "] ;
77+ var balloon_colors = [ "#1b9e77 " , "#d95f02 " , "#7570b3 " , "#e7298a " , "#e6ab02 " , "#a6761d" , "#666666 "] ;
7878
7979var nyan_color_index = 0 ;
8080var nyan_colors = [ 'nyan' , 'nyan-coin' , 'nyan-mon' , 'nyan-pirate' , 'nyan-cool' , 'nyan-tothemax' , 'nyan-pumpkin' , 'nyan-afro' , 'nyan-coin' , 'nyan-mummy' ] ;
@@ -2259,16 +2259,20 @@ function set_polyline_visibility(vcallsign, val) {
22592259
22602260 if ( vehicle . prediction_polyline ) {
22612261 if ( val ) {
2262- map . addLayer ( vehicle . prediction_polyline ) ;
2262+ map . addLayer ( vehicle . prediction_polyline [ 0 ] ) ;
2263+ map . addLayer ( vehicle . prediction_polyline [ 1 ] ) ;
22632264 } else {
2264- map . removeLayer ( vehicle . prediction_polyline ) ;
2265+ map . removeLayer ( vehicle . prediction_polyline [ 0 ] ) ;
2266+ map . removeLayer ( vehicle . prediction_polyline [ 1 ] ) ;
22652267 }
22662268 }
22672269 if ( vehicle . prediction_launch_polyline ) {
22682270 if ( val ) {
2269- map . addLayer ( vehicle . prediction_launch_polyline ) ;
2271+ map . addLayer ( vehicle . prediction_launch_polyline [ 0 ] ) ;
2272+ map . addLayer ( vehicle . prediction_launch_polyline [ 1 ] ) ;
22702273 } else {
2271- map . removeLayer ( vehicle . prediction_launch_polyline ) ;
2274+ map . removeLayer ( vehicle . prediction_launch_polyline ) [ 0 ] ;
2275+ map . removeLayer ( vehicle . prediction_launch_polyline ) [ 1 ] ;
22722276 }
22732277 }
22742278 if ( vehicle . prediction_target ) {
@@ -2291,7 +2295,8 @@ function set_polyline_visibility(vcallsign, val) {
22912295
22922296function removePrediction ( vcallsign ) {
22932297 if ( vehicles [ vcallsign ] . prediction_polyline ) {
2294- map . removeLayer ( vehicles [ vcallsign ] . prediction_polyline ) ;
2298+ map . removeLayer ( vehicles [ vcallsign ] . prediction_polyline [ 1 ] ) ;
2299+ map . removeLayer ( vehicles [ vcallsign ] . prediction_polyline [ 1 ] ) ;
22952300 vehicles [ vcallsign ] . prediction_polyline = null ;
22962301 }
22972302 if ( vehicles [ vcallsign ] . prediction_target ) {
@@ -2320,13 +2325,22 @@ function drawLaunchPrediction(vcallsign) {
23202325
23212326 vehicle . prediction_launch_path = line ;
23222327
2323- vehicle . prediction_launch_polyline = new L . Polyline ( line , {
2328+ vehicle . prediction_launch_polyline = [ new L . Polyline ( line , {
23242329 color : balloon_colors [ vehicle . color_index ] ,
2325- opacity : 0.4 ,
2330+ opacity : 0.8 ,
23262331 weight : 3 ,
2327- } ) //.addTo(map);
2328-
2329- vehicle . prediction_launch_polyline . on ( 'click' , function ( e ) {
2332+ } ) ,
2333+ new L . Polyline ( line , {
2334+ color : "#000" ,
2335+ opacity : 0.1 ,
2336+ weight : 6 ,
2337+ } )
2338+ ] //.addTo(map);
2339+
2340+ vehicle . prediction_launch_polyline [ 0 ] . on ( 'click' , function ( e ) {
2341+ mapInfoBox_handle_prediction_path ( e ) ;
2342+ } ) ;
2343+ vehicle . prediction_launch_polyline [ 1 ] . on ( 'click' , function ( e ) {
23302344 mapInfoBox_handle_prediction_path ( e ) ;
23312345 } ) ;
23322346
@@ -2386,16 +2400,27 @@ function redrawPrediction(vcallsign) {
23862400 vehicle . prediction_path = line ;
23872401
23882402 if ( vehicle . prediction_polyline !== null ) {
2389- vehicle . prediction_polyline . setLatLngs ( line ) ;
2403+ vehicle . prediction_polyline [ 0 ] . setLatLngs ( line ) ;
2404+ vehicle . prediction_polyline [ 1 ] . setLatLngs ( line ) ;
23902405 } else {
2391- vehicle . prediction_polyline = new L . Polyline ( line , {
2406+ vehicle . prediction_polyline = [ new L . Polyline ( line , {
23922407 color : balloon_colors [ vehicle . color_index ] ,
2393- opacity : 0.5 , // Was 0.4
2408+ opacity : 0.8 , // Was 0.4
23942409 weight : 3 ,
2395- } ) //.addTo(map);
2396- vehicle . prediction_polyline . on ( 'click' , function ( e ) {
2410+ } ) ,
2411+ new L . Polyline ( line , {
2412+ color : "#000" ,
2413+ opacity : 0.1 , // Was 0.4
2414+ weight : 6 ,
2415+ } )
2416+
2417+ ] //.addTo(map);
2418+ vehicle . prediction_polyline [ 0 ] . on ( 'click' , function ( e ) {
23972419 mapInfoBox_handle_prediction_path ( e ) ;
23982420 } ) ;
2421+ vehicle . prediction_polyline [ 1 ] . on ( 'click' , function ( e ) {
2422+ mapInfoBox_handle_prediction_path ( e ) ;
2423+ } )
23992424 }
24002425
24012426 vehicle . prediction_polyline . path_length = path_length ;
@@ -3077,26 +3102,6 @@ function addPosition(position) {
30773102 weight : 3 ,
30783103 } )
30793104 ] ;
3080- }
3081- else if ( vcallsign == "XX" ) {
3082- vehicle_type = "xmark" ;
3083- image_src = host_url + markers_url + "balloon-xmark.png" ;
3084- image_src_size = [ 48 , 38 ] ;
3085- image_src_offset = [ 0 , - 38 ] ;
3086-
3087- xmarkIcon = new L . icon ( {
3088- iconUrl : image_src ,
3089- iconSize : image_src_size ,
3090- iconAnchor : [ 24 , 18 ] ,
3091- } ) ;
3092-
3093- marker = new L . Marker ( point , {
3094- icon : xmarkIcon ,
3095- title : vcallsign ,
3096- zIndexOffset : Z_CAR ,
3097- } ) ;
3098-
3099- marker . addTo ( map ) ;
31003105 } else {
31013106 vehicle_type = "balloon" ;
31023107 let colorHash = 0 ;
@@ -3154,7 +3159,7 @@ function addPosition(position) {
31543159 } ;
31553160
31563161 marker . shadow = marker_shadow ;
3157- marker . balloonColor = ( vcallsign == "PIE" ) ? "rpi" : balloon_colors [ color_index ] ;
3162+ marker . balloonColor = balloon_colors [ color_index ] ;
31583163 marker . mode = 'balloon' ;
31593164 marker . setMode = function ( mode ) {
31603165 if ( this . mode == mode ) return ;
@@ -3303,6 +3308,11 @@ function addPosition(position) {
33033308 color : balloon_colors [ color_index ] ,
33043309 opacity : 1 ,
33053310 weight : 3 ,
3311+ } ) ,
3312+ new L . Polyline ( point , {
3313+ color : "#fff" ,
3314+ opacity : 0.6 ,
3315+ weight : 6 ,
33063316 } )
33073317 ] ;
33083318 }
@@ -3414,11 +3424,13 @@ function addPosition(position) {
34143424 vehicle_info . kill = function ( ) {
34153425 $ ( ".vehicle" + vehicle_info . uuid ) . remove ( ) ;
34163426 potentialobjects = [ marker , marker_shadow , landing_marker , horizon_circle , horizon_circle_title , subhorizon_circle , subhorizon_circle_title , polyline ] ;
3417- if ( map . hasLayer ( vehicle_info [ "prediction_polyline" ] ) ) {
3418- map . removeLayer ( vehicle_info [ "prediction_polyline" ] ) ;
3427+ if ( map . hasLayer ( vehicle_info [ "prediction_polyline" ] [ 0 ] ) ) {
3428+ map . removeLayer ( vehicle_info [ "prediction_polyline" ] [ 0 ] ) ;
3429+ map . removeLayer ( vehicle_info [ "prediction_polyline" ] [ 1 ] ) ;
34193430 }
3420- if ( map . hasLayer ( vehicle_info [ "prediction_launch_polyline" ] ) ) {
3421- map . removeLayer ( vehicle_info [ "prediction_launch_polyline" ] ) ;
3431+ if ( map . hasLayer ( vehicle_info [ "prediction_launch_polyline" ] [ 0 ] ) ) {
3432+ map . removeLayer ( vehicle_info [ "prediction_launch_polyline" ] [ 0 ] ) ;
3433+ map . removeLayer ( vehicle_info [ "prediction_launch_polyline" ] [ 1 ] ) ;
34223434 }
34233435 if ( map . hasLayer ( vehicle_info [ "prediction_target" ] ) ) {
34243436 map . removeLayer ( vehicle_info [ "prediction_target" ] ) ;
0 commit comments