--- web/googlemap.cgi 2007/12/03 14:25:40 14 +++ web/googlemap.cgi 2007/12/03 15:06:33 18 @@ -26,10 +26,8 @@ print $q->header; -print qq{ - -Read GPS - NMEA sentence and display it on GoogleMaps - +my $head = ''; +my $html = join('', qq{

Select GPS NMEA dump

}, $q->start_form, @@ -45,7 +43,8 @@ ], ), $q->submit( -value => 'Show trace' ), - $q->end_form; + $q->end_form, +); if ( my $trace = $q->param('trace') ) { $trace =~ s/\s.+$//; @@ -75,23 +74,37 @@ } close($fh); - #$map->zoom(10); - #$map->v2_zoom(0); - $map->controls("large_map_control", "map_type_control"); - $map->map_type('hybrid'); + if ( $points > 0 ) { + + #$map->zoom(10); + #$map->v2_zoom(0); + $map->controls("large_map_control", "map_type_control"); + $map->map_type('hybrid'); - my ($head, $map_div, $map_script) = $map->render; + my ( $map_div, $map_script ); + ( $head, $map_div, $map_script ) = $map->render; - print qq{ + $html .= join('', qq{

Plotting $points points from }, $q->param('trace'), qq{

$map_div $map_script GPS - NMEA sentence information - }; + }); + + } else { + $html .= 'No points found for ' . $q->param('trace') . ''; + } } print qq{ + + +Read GPS - NMEA sentence and display it on GoogleMaps +$head + + +$html };