[freeside-commits] branch FREESIDE_3_BRANCH updated. f894f28f646e6a233ccb10624f37d7a5f216279b
Mitch Jackson
mitch at freeside.biz
Wed Aug 22 12:05:27 PDT 2018
The branch, FREESIDE_3_BRANCH has been updated
via f894f28f646e6a233ccb10624f37d7a5f216279b (commit)
from 2fc8238ca5301e2ed686447f4efea0e55cd69567 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f894f28f646e6a233ccb10624f37d7a5f216279b
Author: Mitch Jackson <mitch at freeside.biz>
Date: Wed Aug 22 14:14:30 2018 -0400
RT# 81150 Google now requires api key for drawing api
diff --git a/FS/FS/deploy_zone.pm b/FS/FS/deploy_zone.pm
index 6ad355f72..7c3a76ca5 100644
--- a/FS/FS/deploy_zone.pm
+++ b/FS/FS/deploy_zone.pm
@@ -6,7 +6,7 @@ use FS::Record qw( qsearch qsearchs dbh );
use Storable qw(thaw);
use MIME::Base64;
-use JSON qw(encode_json decode_json) ;
+use Cpanel::JSON::XS qw(encode_json decode_json);
use LWP::UserAgent;
use HTTP::Request::Common;
diff --git a/httemplate/elements/polygon.html b/httemplate/elements/polygon.html
index 813aa419f..b5aa93753 100644
--- a/httemplate/elements/polygon.html
+++ b/httemplate/elements/polygon.html
@@ -5,13 +5,16 @@ my $id = $opt{'id'} || $opt{'field'};
my $div_id = "div_$id";
my $vertices_json = $opt{'curr_value'} || '[]';
+
+my $apikey = FS::Conf->new->config('google_maps_api_key');
+
</%init>
<& hidden.html, %opt &>
<div id="<% $div_id %>" style="height: 600px; width: 600px"></div>
<div id="<% $div_id %>_hint" style="width: 100%; border: 2px solid black; text-align: center; box-sizing: border-box; padding: 4px"> </div>
<script src="<% $fsurl %>elements/jquery.js"></script>
-<script src="https://maps.googleapis.com/maps/api/js?libraries=drawing&v=3.22"></script>
+<script src="https://maps.googleapis.com/maps/api/js?libraries=drawing&v=3.22<% $apikey ? "&key=$apikey" : '' %>"></script>
<script>
var map;
var drawingManager;
diff --git a/httemplate/search/elements/gmap.html b/httemplate/search/elements/gmap.html
index 47db1507d..1caf76718 100644
--- a/httemplate/search/elements/gmap.html
+++ b/httemplate/search/elements/gmap.html
@@ -37,6 +37,9 @@ Generic Google Maps front end.
</%doc>
<%init>
+
+my $apikey = FS::Conf->new->config('google_maps_api_key');
+
foreach (@features) {
$_->{type} = 'Feature';
# any other per-feature massaging can go here
@@ -57,7 +60,7 @@ body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100%; }
</style>
-<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3">
+<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3<% $apikey ? "&key=$apikey" : '' %>">
</script>
<script type="text/javascript">
-----------------------------------------------------------------------
Summary of changes:
FS/FS/deploy_zone.pm | 2 +-
httemplate/elements/polygon.html | 5 ++++-
httemplate/search/elements/gmap.html | 5 ++++-
3 files changed, 9 insertions(+), 3 deletions(-)
More information about the freeside-commits
mailing list