diff --git a/html/map.php b/html/map.php
index 50891cca1d..5c49d1ea66 100755
--- a/html/map.php
+++ b/html/map.php
@@ -2,6 +2,8 @@
### FIXME : remove link when port/host is not in the database (things /seen/ but not *discovered*)
+$links = 1;
+
include("../includes/defaults.inc.php");
include("../config.php");
include("../includes/functions.php");
@@ -66,6 +68,8 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
{
$linkdone[] = "$local_interface_id $remote_interface_id";
+ $links++;
+
if($link['ifSpeed'] >= "10000000000")
{
$info = "color=red3 style=\"setlinewidth(6)\"";
@@ -138,8 +142,12 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
$_GET['format'] = 'png';
}
- #$maptool = 'unflatten -f -l 5 |dot';
- $maptool = 'dot';
+ if($links > 10) ### Unflatten if there are more than 10 links. beyond that it gets messy
+ {
+ $maptool = 'unflatten -f -l 5 |dot';
+ } else {
+ $maptool = 'dot';
+ }
if ($where == '') { $maptool = 'neato -Gpack'; }