aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-03-16 07:54:18 -0400
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-03-30 17:13:47 +0100
commit97dd5b788578cedbf65672fd65d88bcf37d9a56b (patch)
tree7d8394f53b06087a11a6f3ef60d54c563a8bc5bd
parent35bf6ddb2e58c027a888931bf57de0458cdf898c (diff)
Use Google Maps JS API key, if present.
This appends the GOOGLE_MAPS_API_KEY to the Google Maps JavaScript URL as a `key` parameter.
-rw-r--r--templates/web/base/maps/google-ol.html7
1 files changed, 6 insertions, 1 deletions
diff --git a/templates/web/base/maps/google-ol.html b/templates/web/base/maps/google-ol.html
index e326bd713..7c7711de9 100644
--- a/templates/web/base/maps/google-ol.html
+++ b/templates/web/base/maps/google-ol.html
@@ -1,6 +1,11 @@
[%
+google_maps_url = "https://maps.googleapis.com/maps/api/js?v=3";
+IF c.config.GOOGLE_MAPS_API_KEY;
+ google_maps_url = google_maps_url _ "&amp;key=" _ c.config.GOOGLE_MAPS_API_KEY;
+END;
+
map_js = [
- "https://maps.googleapis.com/maps/api/js?v=3",
+ google_maps_url,
version('/js/OpenLayers/OpenLayers.google.js'),
version('/js/map-OpenLayers.js'),
version('/js/map-google-ol.js'),