showFood.js 894 Bytes
//import position from 'getPlaceList'

var entName = '';
var entType = '';
var entPhoto = '';
var card = '';


for(var i=0; i<entList.size(); i++){
    entName = entList[i][name];
    entType = entList[i][type];
    if(entList[i][photo]==undefined){
        entPhoto = "noimage.png";
    }
    else{
        entPhoto = entList[i][photo];
    }
    
    var tmp = '<div class="col-xl-6 col-sm-6 mb-3">'+
    '<div class="card text-white bg-light o-hidden h-100">'+
    '<div class="card-body"' + ' style="height:300px; background-size: 100% 100%; background-repeat: no-repeat; background-image:url(' + "'" + entPhoto + "');" + '">' + // place photo
    '<div class="mr-5" id="nameDiv">'+entName+'</div>'+ // place name
    '<div class="mr-5" id="typeDiv">'+entType+'</div>'+ // place type
    '</div>'+
    '</div>'+
    '</div>';
    card+=tmp;
}
document.getElementById("body").innerHTML=card;