async function loadVaccineSearchBarData() {
  const state = await getString(); 
  console.log(state);
  const appended = false;
  fetch('https://api.covidactnow.org/v2/states.json?apiKey=4ac37661a08a40b5a50cbe35eb941043').then(response => response.json()).then((vaccine) => {
    const vaccineElement = document.getElementById('vaccine-container');
    vaccine.forEach((ind_vaccine) => {
         if(state.localeCompare(ind_vaccine.state) == 0){
            vaccineElement.appendChild(createVaccineElement(ind_vaccine));
            var linebreak = document.createElement("br");
            vaccineElement.appendChild(linebreak);
            vaccineElement.appendChild(linebreak);
            appended = true;
        }
     })
    //  if(state.localeCompare('CHICAGO')== 0){
    //     console.log(state);
    //     const centerUS = { lat: 39.8283, lng: -98.5795 };
    //     const map = new google.maps.Map(document.getElementById('map'),
    //     {center: centerUS,
    //     zoom: 10});
    //     const uluru = { lat: 41.8807, lng: -87.6742 };
    //     const marker = new google.maps.Marker({
    //     position: uluru,
    //     map: map,        
    // })
    //  }
    //  else{
        const errorElement = document.createElement('span');
        errorElement.innerText = "invalid input, enter state as abbreveations : See table below ";
        vaccineElement.append(errorElement);
        const img = document.createElement("img");
        img.src = '/images/state abbreviation.jpeg' ;
        vaccineElement.appendChild(img);
     //}
        
   
  });
}
/**fetches coviddata from api to access vaccine info and adds to DOM */
fetches coviddata from api to access vaccine info and adds to DOM
fetches coviddata from api to access vaccine info and adds to DOM
async function loadVaccineSearchBarData() {
  const state = await getString(); 
  console.log(state);
  const appended = false;
  fetch('https://api.covidactnow.org/v2/states.json?apiKey=4ac37661a08a40b5a50cbe35eb941043').then(response => response.json()).then((vaccine) => {
    const vaccineElement = document.getElementById('vaccine-container');
    vaccine.forEach((ind_vaccine) => {
         if(state.localeCompare(ind_vaccine.state) == 0){
            vaccineElement.appendChild(createVaccineElement(ind_vaccine));
            var linebreak = document.createElement("br");
            vaccineElement.appendChild(linebreak);
            vaccineElement.appendChild(linebreak);
            appended = true;
        }
     })
        const errorElement = document.createElement('span');
        errorElement.innerText = "invalid input, enter state as abbreveations : See table below ";
        vaccineElement.append(errorElement);
        const img = document.createElement("img");
        img.src = '/images/state abbreviation.jpeg' ;
        vaccineElement.appendChild(img);
  });
}
async function loadVaccineSearchBarData ( ) { const state = await getString ( ) ; console . log ( state ) ; const appended = false ; fetch ( 'https://api.covidactnow.org/v2/states.json?apiKey=4ac37661a08a40b5a50cbe35eb941043' ) . then ( response => response . json ( ) ) . then ( ( vaccine ) => { const vaccineElement = document . getElementById ( 'vaccine-container' ) ; vaccine . forEach ( ( ind_vaccine ) => { if ( state . localeCompare ( ind_vaccine . state ) == 0 ) { vaccineElement . appendChild ( createVaccineElement ( ind_vaccine ) ) ; var linebreak = document . createElement ( "br" ) ; vaccineElement . appendChild ( linebreak ) ; vaccineElement . appendChild ( linebreak ) ; appended = true ; } } ) const errorElement = document . createElement ( 'span' ) ; errorElement . innerText = "invalid input, enter state as abbreveations : See table below " ; vaccineElement . append ( errorElement ) ; const img = document . createElement ( "img" ) ; img . src = '/images/state abbreviation.jpeg' ; vaccineElement . appendChild ( img ) ; } ) ; }
fetches coviddata from api to access vaccine info and adds to DOM
fetches coviddata from api to access vaccine info and adds to DOM
//  if(state.localeCompare('CHICAGO')== 0){ //     console.log(state); //     const centerUS = { lat: 39.8283, lng: -98.5795 }; //     const map = new google.maps.Map(document.getElementById('map'), //     {center: centerUS, //     zoom: 10}); //     const uluru = { lat: 41.8807, lng: -87.6742 }; //     const marker = new google.maps.Marker({ //     position: uluru, //     map: map,         // }) //  } //  else{ //}