X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fmap.html;h=b3459dc1f0dd1293e412536e2efc11cc35b4e33e;hp=d996a330c7286a5794ce5d9467024d1a64d70d86;hb=ae14e320388fa5e7f400bff1c251ef885b7952e6;hpb=e1acfb2921b35fe097015208e8072a2675d01d69 diff --git a/httemplate/view/map.html b/httemplate/view/map.html index d996a330c..b3459dc1f 100644 --- a/httemplate/view/map.html +++ b/httemplate/view/map.html @@ -1,3 +1,5 @@ +% if ( $apikey ) { + %# the actual page <& /elements/header-popup.html, { title => '',#$name, @@ -9,6 +11,11 @@
+% } else { +<& /elements/header-popup.html &> +<& /elements/google_maps_api_key.html &> +% } + <%def .head> @@ -22,8 +29,6 @@ body { height: 100%; margin: 0px; padding: 0px } @media print { #map_canvas { height: 500px; margin: 0; } } -% my $conf = new FS::Conf; -% my $apikey = $conf->config('google_maps_api_key'); @@ -31,6 +36,13 @@ body { height: 100%; margin: 0px; padding: 0px } var lengthLine=0; var map; +// function name specified by google maps api, special hook for auth errors +function gm_authFailure () { + document.body.innerHTML = +<% include('/elements/google_maps_api_key.html', autherror => 1) |js_string%>; +} + + function initialize() { var latlng = new google.maps.LatLng(<%$lat%>, <%$lon%>); var myOptions = { @@ -57,6 +69,8 @@ function initialize() { <%shared> my ($lat, $lon, $name); +my $conf = new FS::Conf; +my $apikey = $conf->config('google_maps_api_key'); <%init>