+ [
+ [
+ { 'data' => "Latitude: ". $tower->latitude.
+ "<br>Longitude: ". $tower->longitude.
+ "<br>Altitude: ". $tower->altitude.
+ "<br>Height: ". $tower->height.
+ "<br>Veg. height: ". $tower->veg_height,
+ },
+ { 'data' => $coords, 'link' => "Coordinates", },
+ ],
+ ]
+};
+
+my $tower_sub = sub {
+ my $tower = shift;
+ my $sectors = join(',',
+ map { $_->sectornum } $tower->tower_sector, $tower->default_sector
+ );
+ [ #rows
+ [
+ { 'data' => $tower->towername. ' ', },
+ { 'data' => ' (edit) ', size => '-1',
+ 'link' => $p.'edit/tower.html?' . $tower->towernum },
+ ],
+ # turn these into rows
+ map { [ $_ ] }
+ &{$num_svc_links}( 'towernum='.$tower->towernum, $sectors )
+ ] #rows
+};
+
+my $sector_sub = sub {
+ my $tower = shift;
+
+ [ #rows
+ map {
+ my $sector = $_;
+ my $sectornum = $sector->sectornum;
+ [
+ {
+ 'data' => $sector->sectorname. ' ',
+ 'link' => ( $sector->ip_addr ? 'http://'. $sector->ip_addr : '' ),
+ },
+
+ &{$num_svc_links}( 'sectornum='.$sectornum, $sectornum )
+ ]
+ } $tower->tower_sector
+ ] #rows