+# if we were given a towernum or sectornum, ensure that the map includes
+# that tower/sector, even if there are no services
+
+foreach my $towernum ($cgi->param('towernum')) {
+ next if $towernum !~ /^\d+$/;
+ next if exists($towers{$towernum});
+ $towers{$towernum} = FS::tower->by_key($towernum);
+}
+
+foreach my $sectornum ($cgi->param('sectornum')) {
+ next if $sectornum !~ /^\d+$/;
+ next if exists($sectors{$sectornum});
+ $sectors{$sectornum} = FS::tower_sector->by_key($sectornum)
+ or die "bad sectornum $sectornum";
+ # and put it on the tower list also
+ my $towernum = $sectors{$sectornum}->towernum;
+ if (!exists($towers{$towernum})) {
+ $towers{$towernum} = FS::tower->by_key($towernum);
+ }
+}
+
+# if the tower/sector was included in the search, but has no services, set
+# default bounds around it of 1 minute in each direction
+my $default_bounds = 0.017;
+