Changeset 568 in tmcsimulator for trunk/webapps


Ignore:
Timestamp:
01/24/2020 12:55:29 PM (6 years ago)
Author:
jdalbey
Message:

GTEC vdsLayer.js Add colors to buttons. Improve button selection so a second click is rquired on a white dot.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/webapps/GTEC/js/vdsLayer.js

    r567 r568  
    11var postmileList = [];  // the list of postmiles saved from the json file. 
    2 var chosenColor = null; // stores color that user picks 
     2var chosenColor = "yellow"; // stores color that user picks, initial default yellow 
    33 
    44// function to find differences between two arrays 
     
    135135                first[1] + "            " + first[2] + "        " + range.toFixed(3) + "         "  
    136136                + getColorAbbr(chosenColor); 
     137                console.log(lineOut); 
    137138 
    138139                // Using Ajax POST to send the data  
     
    188189            { 
    189190                console.log('wrong choice'); 
     191                clicked = !clicked; 
    190192            } 
    191193            clicked = !clicked; 
     
    306308    map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(yellowColor); 
    307309    // store the user picked color in "chosenColor" 
     310     
    308311    redColor.addEventListener('click', function() { 
    309312        chosenColor = "red"; 
     313        redColor.style.background = "red"; 
     314        greenColor.style.background = "gray"; 
     315        yellowColor.style.background = "gray"; 
     316         
    310317    }); 
    311318    greenColor.addEventListener('click', function() { 
    312319        chosenColor = "lime"; 
     320        greenColor.style.background = "green"; 
     321        redColor.style.background = "gray"; 
     322        yellowColor.style.background = "gray";         
    313323    }); 
    314324    yellowColor.addEventListener('click', function(){ 
    315325        chosenColor = "yellow"; 
     326        yellowColor.style.background = "yellow"; 
     327        redColor.style.background = "gray"; 
     328        greenColor.style.background = "gray";      
    316329    }); 
    317330} 
Note: See TracChangeset for help on using the changeset viewer.