X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fsvc_broadband-map.html;h=65830b5d2a085815464158ec91a0efa691405e10;hp=4c660b016d586bd42b898b666b5c2cc5dabb1b72;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hpb=5befe347dfac36159ab2f68a1487111eb97996dc diff --git a/httemplate/search/svc_broadband-map.html b/httemplate/search/svc_broadband-map.html index 4c660b016..65830b5d2 100755 --- a/httemplate/search/svc_broadband-map.html +++ b/httemplate/search/svc_broadband-map.html @@ -1,6 +1,6 @@ <& /elements/header.html, 'Broadband Search Results' &> -<& elements/gmap.html, features => \@features &> +<& elements/gmap.html, features => \@features, overlays => \@overlays &> <& /elements/footer.html &> <%init> @@ -10,6 +10,8 @@ die "access denied" unless my $conf = new FS::Conf; +$m->comp('/elements/handle_uri_query'); + my @features; # geoJSON structure # accept all the search logic from svc_broadband.cgi... @@ -49,15 +51,24 @@ foreach my $svc_broadband (@rows) { push @coord, $svc_broadband->altitude + 0 if length($svc_broadband->altitude); # it's optional + my $svcnum = $svc_broadband->svcnum; + my $color = $svc_broadband->addr_status_color; + push @features, { - id => 'svc_broadband/'.$svc_broadband->svcnum, + id => 'svc_broadband/'.$svcnum, geometry => { type => 'Point', coordinates => \@coord, }, properties => { - content => include('.svc_broadband', $svc_broadband), + #content => include('.svc_broadband', $svc_broadband), + url => $fsurl . 'view/svc_broadband-popup.html?' . $svcnum, + style => { + icon => { + fillColor => $color, + }, + }, }, }; # look up tower location and draw connecting line @@ -76,7 +87,6 @@ foreach my $svc_broadband (@rows) { } - my $tower = $towers{$towernum}; if ( $tower->latitude and $tower->longitude ) { push @features, { @@ -86,8 +96,8 @@ foreach my $svc_broadband (@rows) { }, properties => { style => { - strokeColor => ($tower->color || 'green'), - strokeWeight => 2, + strokeColor => $color, + strokeWeight => 1, }, }, }; @@ -136,7 +146,7 @@ foreach my $tower (values(%towers)) { style => { icon => { path => undef, - url => $fsurl.'images/jcartier-antenna-square-21x51.png', + url => $fsurl.'images/antenna-square-21x51.png', anchor => { x => 10, y => 4 } }, }, @@ -146,23 +156,20 @@ foreach my $tower (values(%towers)) { }; } +my @overlays; +foreach my $sector (values %sectors) { + if ( length($sector->image) > 0 ) { + my $o = { + url => $fsurl.'view/sector_map-png.cgi?' . $sector->sectornum + }; + foreach (qw(south north west east)) { + $o->{$_} = $sector->get($_) + 0; + } + push @overlays, $o; + }; +}; + -<%def .svc_broadband> -% my $svc = shift; -% my @label = $svc->cust_svc->label; -

- - <% $label[0] |h %> #<% $svc->svcnum %> | <% $label[1] %> - -

-% my $cust_main = $svc->cust_main; - -<& /elements/small_custview.html, { - cust_main => $svc->cust_main, - #url => $fsurl.'view/cust_main.cgi', -} &> - - <%def .tower> % my $tower = shift; % my $can_edit = $FS::CurrentUser::CurrentUser->access_right('Configuration');