world map: move markers to foreground for hosts that are down

This commit is contained in:
Sebastian Neuner
2015-10-13 16:46:31 +02:00
parent eb54421f6d
commit ef424da411

View File

@ -123,11 +123,13 @@ var greenMarker = L.AwesomeMarkers.icon({
}
foreach (dbFetchRows($sql, array($_SESSION['user_id'])) as $map_devices) {
$icon = 'greenMarker';
$z_offset = 0;
if ($map_devices['status'] == 0) {
$icon = 'redMarker';
$z_offset = 10000; // move marker to foreground
}
$temp_output .= "var title = '<a href=\"" . generate_device_url($map_devices) . "\"><img src=\"".getImageSrc($map_devices)."\" width=\"32\" height=\"32\" alt=\"\">".$map_devices['hostname']."</a>';
var marker = L.marker(new L.LatLng(".$map_devices['lat'].", ".$map_devices['lng']."), {title: title, icon: $icon});
var marker = L.marker(new L.LatLng(".$map_devices['lat'].", ".$map_devices['lng']."), {title: title, icon: $icon, zIndexOffset: $z_offset});
marker.bindPopup(title);
markers.addLayer(marker);\n";
}