& /elements/header.html, '' &>
<& /elements/footer.html &> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('List services'); my $conf = new FS::Conf; my $apikey = $conf->config('google_maps_api_key'); my @features; # geoJSON structure my @towers = qsearch('tower', { 'latitude' => { op=>'!=', value=>''}, 'longitude' => { op=>'!=', value=>''}, }); my %sectors; # towernum => arrayref my @towernums; foreach my $tower (@towers) { my $towernum = $tower->towernum; push @towernums, $towernum; my @coord = ( $tower->longitude + 0, $tower->latitude + 0, ); push @features, { type => 'Feature', id => 'tower/'.$towernum, geometry => { type => 'Point', coordinates => \@coord, }, properties => { style => { icon => { path => undef, url => $fsurl.'images/antenna-square-21x51.png', anchor => { x => 10, y => 4 }, strokeColor => ($tower->color || 'black'), }, }, content => include('.tower', $tower), }, }; $sectors{$towernum} = [ $tower->tower_sector ]; } # foreach $tower my $tower_data = { type => 'FeatureCollection', features => \@features }; %init> <%def .tower> % my $tower = shift; % my $can_edit = $FS::CurrentUser::CurrentUser->access_right('Configuration');