projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cust_main fields only
[freeside.git]
/
httemplate
/
view
/
directions.html
diff --git
a/httemplate/view/directions.html
b/httemplate/view/directions.html
index
f14a11a
..
0b4d139
100644
(file)
--- a/
httemplate/view/directions.html
+++ b/
httemplate/view/directions.html
@@
-38,8
+38,7
@@
body { height: 100%; margin: 0px; padding: 0px }
}
</style>
}
</style>
-<script type="text/javascript"
-src="https://maps.google.com/maps/api/js?v=3.4&sensor=false">
+<script type="text/javascript" src="https://maps.google.com/maps/api/js?v=3<% $apikey ? '&key='.$apikey : '' %>">
</script>
<script type="text/javascript">
</script>
<script type="text/javascript">
@@
-62,10
+61,22
@@
function show_route() {
directionsService.route(directionsRequest, function(result, status) {
if ( status == google.maps.DirectionsStatus.OK ) {
directionsDisplay.setDirections(result);
directionsService.route(directionsRequest, function(result, status) {
if ( status == google.maps.DirectionsStatus.OK ) {
directionsDisplay.setDirections(result);
+ } else {
+ var errmsg = ('<P STYLE="color: red;">Directions lookup failed with the following error: '+status+'</P>');
+ if (status == 'REQUEST_DENIED') {
+ errmsg = errmsg + <% include('/elements/google_maps_api_key.html' ) |js_string%>;
+ }
+ document.body.innerHTML = errmsg;
}
});
}
}
});
}
+// 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 => $apikey ) |js_string%>;
+}
+
function initialize() {
var myOptions = {
zoom: 14,
function initialize() {
var myOptions = {
zoom: 14,
@@
-85,6
+96,8
@@
function initialize() {
</%def>
<%shared>
my ($lat, $lon, $name, $origin);
</%def>
<%shared>
my ($lat, $lon, $name, $origin);
+my $conf = new FS::Conf;
+my $apikey = $conf->config('google_maps_api_key');
</%shared>
<%init>
</%shared>
<%init>