diff options
Diffstat (limited to 'httemplate')
| -rw-r--r-- | httemplate/elements/polygon.html | 5 | ||||
| -rw-r--r-- | httemplate/search/elements/gmap.html | 5 | 
2 files changed, 8 insertions, 2 deletions
| 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"> | 
