Update map

This commit is contained in:
Hoang Huu 2019-10-02 15:15:24 +07:00
parent b3a3673ba7
commit f2e6a5e5d0

View File

@ -243,14 +243,54 @@
pricelabel = ' / ' + properties[i].pricelabel;
}
// console.log( properties[i] );
boxText.className = 'map-info-preview media';
function opalestate_get_property_icon( $key ) {
var $icon = $key;
switch ( $key ) {
case 'builtyear':
$icon = 'fas fa-calendar';
break;
case 'parking':
$icon = 'fas fa-car';
break;
case 'bedrooms':
$icon = 'fas fa-bed';
break;
case 'bathrooms':
$icon = 'fas fa-bath';
break;
case 'plotsize':
$icon = 'fas fa-map';
break;
case 'areasize':
$icon = 'fas fa-arrows-alt';
break;
case 'orientation':
$icon = 'fas fa-compass';
break;
case 'livingrooms':
$icon = 'fas fa-tv';
break;
case 'kitchens':
$icon = 'fas fa-utensils';
break;
case 'amountrooms':
$icon = 'fas fa-building';
break;
default:
$icon = $key;
break;
}
return $icon;
}
var meta = '<ul class="list-inline property-meta-list">';
if( properties[i].metas ){
for ( var x in properties[i].metas ){
var m = properties[i].metas[x];
meta += '<li><i class="icon-property-'+x+'"></i>' + m.value +'<span class="label-property">' + m.label + '</span></li>'
meta += '<li><i class="icon-property-'+x+' ' + opalestate_get_property_icon(x) + '"></i>' + m.value +'<span' +
' class="label-property">' + m.label + '</span></li>'
}
}
meta += '</ul>';