1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
%# the actual page
<& /elements/header-popup.html, {
title => '',#$name,
head => include('.head'),
etc => 'onload="initialize()"',
nobr => 1,
}
&>
<div id="map_canvas"></div>
<%def .head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100%; }
@media print { #map_canvas { height: 500px; margin: 0; } }
</style>
<script type="text/javascript"
src="https://maps.google.com/maps/api/js?v=3.4&sensor=false">
</script>
<script type="text/javascript">
var lengthLine=0;
var map;
function initialize() {
var latlng = new google.maps.LatLng(<%$lat%>, <%$lon%>);
var myOptions = {
center: latlng,
zoom: 14,
rotateControl: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(
document.getElementById("map_canvas"),
myOptions
);
map.setOptions( {rotateControl : true });
var markerOptions = {
map: map,
position: latlng,
title: <%$name |js_string%>
};
var marker = new google.maps.Marker(markerOptions);
}
</script>
</%def>
<%shared>
my ($lat, $lon, $name);
</%shared>
<%init>
$name = $cgi->param('name');
$lat = $cgi->param('lat');
$lon = $cgi->param('lon');
$lat =~ /^-?\d+(\.\d+)?$/ or die "bad latitude: $lat";
$lon =~ /^-?\d+(\.\d+)?$/ or die "bad longitude: $lat";
</%init>
|