Changeset 570 in tmcsimulator for trunk/webapps/GTEC/js
- Timestamp:
- 01/24/2020 08:14:32 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/webapps/GTEC/js/vdsLayer.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/GTEC/js/vdsLayer.js
r568 r570 58 58 //var color_arr = []; 59 59 var white_arr = []; //stores all white dots 60 // Initialize the current time to zero 61 var currentTime = new Date(0); 62 currentTime.setHours(0); 63 currentTime.setMinutes(0); 64 currentTime.setSeconds(0); 65 60 66 map.data.addListener('click', function(event) 61 67 { … … 101 107 }); 102 108 //color_arr.push(clicked_dots); 103 console.log(clicked_dots);104 console.log(range);109 //console.log(clicked_dots); 110 //console.log(range); 105 111 // extracts ids for all the white dots 106 112 var white_arr_ids = white_arr.map(function (marker) { … … 113 119 // computes difference between the white dots and clicked dots to find the unused dots 114 120 var unused_ids = white_arr_ids.diff(clicked_dots_ids); 115 console.log("Unused: ",unused_ids, "White: ",white_arr_ids);121 //console.log("Unused: ",unused_ids, "White: ",white_arr_ids); 116 122 // change the dot color of all the unused white dots back to their previous color 117 123 unused_ids.forEach(function (id){ … … 130 136 }); 131 137 } 138 // Increment the time by one-half minute (30 seconds) 139 var millisecs = currentTime.getTime(); 140 millisecs += 30000; 141 currentTime = new Date(millisecs); 142 143 // Create a printable string for the time (HH:MM:SS) 144 var printableTime = currentTime.toLocaleTimeString('it-IT'); 132 145 133 146 // Assemble the line to be written to the events file 134 var lineOut = "1 81 00:00:00 " + first[0] + "" +135 first[1] + " " + first[2] + " " + range.toFixed(3) + ""147 var lineOut = "101 " + printableTime + "\t" + first[0] + "\t" + 148 first[1] + "\t" + first[2] + "\t" + range.toFixed(3) + "\t" 136 149 + getColorAbbr(chosenColor); 137 150 console.log(lineOut); … … 156 169 var direction = postmileList[curr].charAt(firstBlank+1); // extract direction 157 170 target = event.feature.getId().substring(0,secondBlank); // extract target string 158 console.log("making white dots from " + selectedID + " in direction "+direction)171 //console.log("making white dots from " + selectedID + " in direction "+direction) 159 172 // Decide whether to increment or decrement based on direction of hwy; 160 173 // N and E increment, S and W decrement … … 328 341 greenColor.style.background = "gray"; 329 342 }); 343 // set default button on 344 yellowColor.style.background = "yellow"; 330 345 }
Note: See TracChangeset
for help on using the changeset viewer.
