X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fmap.html;h=3122de6a0025ac10b1ef334f054cbc2d554ff558;hb=5f2456557fee6e8d09733aad18200e4b2bbc2d93;hp=71a15384236266d4f9d790171ac8573c690e5536;hpb=8cbe016ac2c28cd209c48f053f361573368e7988;p=freeside.git diff --git a/httemplate/view/map.html b/httemplate/view/map.html index 71a153842..3122de6a0 100644 --- a/httemplate/view/map.html +++ b/httemplate/view/map.html @@ -1,120 +1,69 @@ +%# the actual page <& /elements/header-popup.html, { title => '',#$name, - head => $head, - etc => 'onload="html_googlemaps_initialize()"', + head => include('.head'), + etc => 'onload="initialize()"', nobr => 1, } &> -<% $map_div %> +
-<%init> - -my $name = js_string( scalar($cgi->param('name')) ); +<%def .head> + -my $point = [ map scalar($cgi->param($_)), qw( longitude latitude ) ]; + - - -##our own hacked in code for displaying a marker at the center -$header .= ' -var markerOptions = { - map: map, - position: latlng, - title: '. $name. ' -}; -var marker = new google.maps.Marker(markerOptions); -'; +'; - - - #my $div = '
'; - my $div = '
'; +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 }); - $header .= " + +<%shared> +my ($lat, $lon, $name); + +<%init> - - "; +$name = $cgi->param('name'); - return ($header,$div) - -} +$lat = $cgi->param('lat'); +$lon = $cgi->param('lon'); +$lat =~ /^-?\d+(\.\d+)?$/ or die "bad latitude: $lat"; +$lon =~ /^-?\d+(\.\d+)?$/ or die "bad longitude: $lat";