26 |
|
|
27 |
print $q->header; |
print $q->header; |
28 |
|
|
29 |
print qq{ |
my $head = ''; |
30 |
<html> |
my $html = join('', qq{ |
|
<title>Read GPS - NMEA sentence and display it on GoogleMaps</title> |
|
|
<body> |
|
31 |
<h1>Select GPS NMEA dump</h1> |
<h1>Select GPS NMEA dump</h1> |
32 |
}, |
}, |
33 |
$q->start_form, |
$q->start_form, |
43 |
], |
], |
44 |
), |
), |
45 |
$q->submit( -value => 'Show trace' ), |
$q->submit( -value => 'Show trace' ), |
46 |
$q->end_form; |
$q->end_form, |
47 |
|
); |
48 |
|
|
49 |
if ( my $trace = $q->param('trace') ) { |
if ( my $trace = $q->param('trace') ) { |
50 |
$trace =~ s/\s.+$//; |
$trace =~ s/\s.+$//; |
74 |
} |
} |
75 |
close($fh); |
close($fh); |
76 |
|
|
77 |
#$map->zoom(10); |
if ( $points > 0 ) { |
78 |
#$map->v2_zoom(0); |
|
79 |
$map->controls("large_map_control", "map_type_control"); |
#$map->zoom(10); |
80 |
$map->map_type('hybrid'); |
#$map->v2_zoom(0); |
81 |
|
$map->controls("large_map_control", "map_type_control"); |
82 |
|
$map->map_type('hybrid'); |
83 |
|
|
84 |
my ($head, $map_div, $map_script) = $map->render; |
my ( $map_div, $map_script ); |
85 |
|
( $head, $map_div, $map_script ) = $map->render; |
86 |
|
|
87 |
print qq{ |
$html .= join('', qq{ |
88 |
<h1>Plotting $points points from }, $q->param('trace'), qq{</h1> |
<h1>Plotting $points points from }, $q->param('trace'), qq{</h1> |
89 |
$map_div |
$map_div |
90 |
$map_script |
$map_script |
91 |
<a href="http://aprs.gids.nl/nmea/">GPS - NMEA sentence information</a> |
<a href="http://aprs.gids.nl/nmea/">GPS - NMEA sentence information</a> |
92 |
}; |
}); |
93 |
|
|
94 |
|
} else { |
95 |
|
$html .= '<em>No points found for ' . $q->param('trace') . '</em>'; |
96 |
|
} |
97 |
|
|
98 |
} |
} |
99 |
|
|
100 |
print qq{ |
print qq{ |
101 |
|
<html> |
102 |
|
<head> |
103 |
|
<title>Read GPS - NMEA sentence and display it on GoogleMaps</title> |
104 |
|
$head |
105 |
|
</head> |
106 |
|
<body> |
107 |
|
$html |
108 |
</body> |
</body> |
109 |
</html> |
</html> |
110 |
}; |
}; |