add_class = listing.fd == '1' ? ' featured' : '';
var featured_class = result.listings[i].fd == '1' && result.listings[i].gc == '1' ? ' featured' : '';
// add/update marker
if (!markers[listing_id]) {
var marker = new MarkerWithLabel({
position: myLatLng,
map: map,
labelContent: label,
labelClass: 'map-price-marker' + featured_class,
labelVisible: true,
labelAnchor: new google.maps.Point(35, 29),
zIndex: zIndex,
icon: rlConfig['tpl_base'] + 'img/blank.gif',
infobox: attacheInfo(result.listings[i]),
flGc: result.listings[i].gc,
flLat: result.listings[i].lat,
flLng: result.listings[i].lng
});
markers[listing_id] = marker;
var highlightListing = function(id, remove){
if (!markers[id])
return;
// in claster
if (markers[id].map == null) {
var add_class = remove ? '' : ' active';
var cluster = getCluster(markers[id]);
if (cluster) {
cluster.clusterIcon_.div_.className = 'cluster' + add_class;
}
}
// marker itself
else {
var set_class = 'map-price-marker';
if (markers[id].labelClass.indexOf('featured') >= 0) {
set_class += ' featured';
}
if (!remove) {
set_class += ' active';
}
// set highlighted class
markers[id].labelClass = set_class;
// manage zIndex
placeOnTop(id, remove);
// redraw marker, apply new settings
markers[id].label.draw();
}
}