summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2016-09-23 19:00:29 -0500
committerJonathan Prykop <jonathan@freeside.biz>2016-09-27 12:22:22 -0500
commit90c1ccf59eae95cb54907d6cb0ffc989eb3d2399 (patch)
treefca23d1ec2fa65426bdd047185a878c6a602e2c5 /httemplate/view
parent2ba9f65dcb6407e582b21140bef9924f3a10036f (diff)
71873: GlobalVision - directions
Diffstat (limited to 'httemplate/view')
-rw-r--r--httemplate/view/directions.html7
-rw-r--r--httemplate/view/map.html5
2 files changed, 8 insertions, 4 deletions
diff --git a/httemplate/view/directions.html b/httemplate/view/directions.html
index f14a11a07..a07df403b 100644
--- a/httemplate/view/directions.html
+++ b/httemplate/view/directions.html
@@ -38,8 +38,9 @@ body { height: 100%; margin: 0px; padding: 0px }
}
</style>
-<script type="text/javascript"
-src="https://maps.google.com/maps/api/js?v=3.4&sensor=false">
+% my $conf = new FS::Conf;
+% my $apikey = $conf->config('google_maps_api_key');
+<script type="text/javascript" src="https://maps.google.com/maps/api/js?v=3&key=<% $apikey %>">
</script>
<script type="text/javascript">
@@ -62,6 +63,8 @@ function show_route() {
directionsService.route(directionsRequest, function(result, status) {
if ( status == google.maps.DirectionsStatus.OK ) {
directionsDisplay.setDirections(result);
+ } else {
+ document.body.innerHTML = ('<P STYLE="color: red;">Directions lookup failed with the following error: '+status+'</P>');
}
});
}
diff --git a/httemplate/view/map.html b/httemplate/view/map.html
index 3122de6a0..d996a330c 100644
--- a/httemplate/view/map.html
+++ b/httemplate/view/map.html
@@ -22,8 +22,9 @@ body { height: 100%; margin: 0px; padding: 0px }
@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">
+% my $conf = new FS::Conf;
+% my $apikey = $conf->config('google_maps_api_key');
+<script type="text/javascript" src="https://maps.google.com/maps/api/js?v=3&key=<% $apikey %>">
</script>
<script type="text/javascript">